]> code.ossystems Code Review - openembedded-core.git/commit
systemd: ensure reproducible builds by clearly exposing the time epoch support
authorRoss Burton <ross.burton@intel.com>
Thu, 5 Sep 2019 22:49:59 +0000 (23:49 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Sep 2019 13:56:05 +0000 (14:56 +0100)
commit29afbd4f02354de7103ee3a88f4ce5336b95b88a
tree16b898295900de7e99f75aaf7306a99db647c65f
parent1ce8a78e59e472d80a85667916af23c7d64bb99f
systemd: ensure reproducible builds by clearly exposing the time epoch support

systemd has the ability to check the time on boot and if it's earlier than an
epoch determined at build time, set the time to that epoch.  This is useful for
systems where the system time is January 1st 1970 (because the unix timestamp
was 0 at boot) as then at least the time is reset to something approximating the
right year at least.

By default systemd uses the mtime of the NEWS file, which is static for tarballs
and corresponds to the time the release was made, but for git checkouts this is
simply the time do_unpack() was executed.  Thus, rebuilding systemd will cause
this embedded timestamp to change.

Remove the PACKAGECONFIG time-epoch which has the logic reversed: enabling
time-epoch will set the epoch to the unix timestamp 0).  Replace with
set-time-epoch with the following semantics:

- When disabled, the time epoch is set to 0 (1st January 1970), so there is no
  time manipulation on boot.

- When enabled, if reproducible builds are configured by setting
  SOURCE_DATE_EPOCH then that timestamp is used for the time epoch.  If
  reproducible builds are not configured then the timestamp of NEWS (thus the
  build time) is used.

The set-time-epoch flag is enabled by default.

[ YOCTO #13473 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/systemd/systemd_242.bb