dustin
/
jenkinsagent
Archived
1
0
Fork 0

rootfs: Update clock epoch at build time

If systemd detects that the system clock is not correct, it sets it to a
"known good" time based on the release date of its version.  Since this
can still be weeks or months in the past, it will use the timestamp of
the `/usr/lib/clock-epoch` file, if it exists, as the reference time.

To get our system clock closer to the correct time earlier in the boot
process, we update the `clock-epoch` file's timestamp during build.
This will cause the clock to be set to approximately the build time of
the root filesystem image.  Presumably, the rootfs image is built
relatively frequently, so the time should be a lot closer to correct
than the systemd release date.
master
Dustin 2022-03-15 12:39:55 -05:00
parent c59e9de714
commit 711a8aa948
1 changed files with 2 additions and 0 deletions

View File

@ -2,3 +2,5 @@
cp -puv "${BUILD_DIR}"/nbd-*/systemd/nbd@.service \ cp -puv "${BUILD_DIR}"/nbd-*/systemd/nbd@.service \
"${TARGET_DIR}"/usr/lib/systemd/system/ "${TARGET_DIR}"/usr/lib/systemd/system/
touch "${TARGET_DIR}"/usr/lib/clock-epoch