edk2 icon indicating copy to clipboard operation
edk2 copied to clipboard

EmbeddedPkg/VirtualRealTimeClockLib: Support SOURCE_DATE_EPOCH

Open joeyli opened this issue 1 year ago • 2 comments

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 [email protected] Cc: Ard Biesheuvel [email protected]

joeyli avatar Apr 12 '24 07:04 joeyli

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] avatar Jun 23 '24 23:06 github-actions[bot]

Hi,

Baseo n the CI result, does that mean printenv SOURCE_DATE_EPOCH || date +%s command not be supported by azure-pipelines's shell?

How can I debug it? On azure?

Thanks a lot!

joeyli avatar Jun 24 '24 03:06 joeyli

For reference: https://edk2.groups.io/g/devel/message/119756

leiflindholm avatar Jul 02 '24 10:07 leiflindholm

Thanks for Leif's suggestion. I will send a new push request.

joeyli avatar Jul 02 '24 13:07 joeyli

@joeyli No need to close the PR - you can simply force-push the new version to the branch the PR was created from.

leiflindholm avatar Jul 02 '24 14:07 leiflindholm

@joeyli No need to close the PR - you can simply force-push the new version to the branch the PR was created from.

Thanks for your reminder! But I have closed the old PR and submit a new pull request:

https://github.com/tianocore/edk2/pull/5845

Joey Lee

joeyli avatar Jul 02 '24 15:07 joeyli