systemd: add the release timestamp into the build

This helps systemd during runtime to make decisions about the sanity of
the system clock. See the references news article for more details on
the matter.
This commit is contained in:
Andreas Rammhold 2021-12-31 17:21:05 +01:00 committed by Florian Klink
parent d67caf3c89
commit 49267a99d2

View File

@ -406,6 +406,14 @@ stdenv.mkDerivation {
mesonFlags = [
"-Dversion-tag=${version}"
# We bump this variable on every (major) version change to ensure
# that we have known-good value for a timestamp that is in the (not so distant) past.
# This serves as a lower bound for valid system timestamps during startup. Systemd will
# reset the system timestamp if this date is +- 15 years from the system time.
# See the systemd v250 release notes for further details:
# https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266
"-Dtime-epoch=${releaseTimestamp}"
"-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
"-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
"-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
@ -470,7 +478,6 @@ stdenv.mkDerivation {
*/
"-Dsystem-uid-max=999"
"-Dsystem-gid-max=999"
# "-Dtime-epoch=1"
"-Dsysvinit-path="
"-Dsysvrcnd-path="