From: "joeyli via groups.io" <jlee=suse.com@groups.io>
To: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Pete Batard <pete@akeo.ie>
Subject: Re: [edk2-devel] [PATCH] EmbeddedPkg/VirtualRealTimeClockLib: Support SOURCE_DATE_EPOCH
Date: Fri, 12 Apr 2024 18:03:35 +0800 [thread overview]
Message-ID: <20240412100335.GF3533@linux-l9pv.suse> (raw)
In-Reply-To: <20240412072556.30677-1-jlee@suse.com>
Hi experts,
On Fri, Apr 12, 2024 at 03:25:56PM +0800, Lee, Chun-Yi wrote:
> From: Chun-Yi Lee <jlee@suse.com>
>
> RISC-V ovmf used VirtualRealTimeClockLib but the default epoch is a
> compilation time. It causes that the RISC-V ovmf binary image is NOT
> reproducible.
>
> This patch added the support of SOURCE_DATE_EPOCH by printenv command.
> If SOURCE_DATE_EPOCH be found then we use it as BUILD_EPOCH. Otherwise
> we run date command for setting BUILD_EPOCH.
>
> For distributions want a reproducible RISC-V ovmf image, they should
> export SOURCE_DATE_EPOCH environment variable before building ovmf.
>
> References: https://reproducible-builds.org/docs/source-date-epoch/
> Cc: Pete Batard <pete@akeo.ie>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Chun-Yi Lee <jlee@suse.com>
I have filed pull request:
https://github.com/tianocore/edk2/pull/5550
Thanks!
Joey Lee
> ---
> .../Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
> index 5d0f867..285e880 100644
> --- a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
> +++ b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
> @@ -34,4 +34,4 @@
>
> # Current usage of this library expects GCC in a UNIX-like shell environment with the date command
> [BuildOptions]
> - GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`date +%s`
> + GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`printenv SOURCE_DATE_EPOCH || date +%s`
> --
> 2.35.3
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117665): https://edk2.groups.io/g/devel/message/117665
Mute This Topic: https://groups.io/mt/105479031/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-04-12 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 7:25 [edk2-devel] [PATCH] EmbeddedPkg/VirtualRealTimeClockLib: Support SOURCE_DATE_EPOCH Lee, Chun-Yi
2024-04-12 10:03 ` joeyli via groups.io [this message]
[not found] ` <17C5803AB4523E0C.19773@groups.io>
2024-04-30 15:17 ` joeyli via groups.io
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240412100335.GF3533@linux-l9pv.suse \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox