From b2415f4414e0a13a81c90b5356ec1a4b7a61468b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 18 Nov 2010 12:28:21 +0100 Subject: [PATCH] base: use systemd-timestamp for RD_TIMESTAMP, if possible --- modules.d/99base/init | 9 +++++++-- modules.d/99base/install | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules.d/99base/init b/modules.d/99base/init index 1c695c2f..f79d102a 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -76,8 +76,13 @@ RDDEBUG="" mount -t proc -o nosuid,noexec,nodev /proc /proc >/dev/null 2>&1 mount -t sysfs -o nosuid,noexec,nodev /sys /sys >/dev/null 2>&1 -read RD_TIMESTAMP _tmp < /proc/uptime -unset _tmp + +if [ -x /lib/systemd/systemd-timestamp ]; then + RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp) +else + read RD_TIMESTAMP _tmp < /proc/uptime + unset _tmp +fi if [ ! -c /dev/ptmx ]; then # try to mount devtmpfs diff --git a/modules.d/99base/install b/modules.d/99base/install index 0435e329..57bf4bc1 100755 --- a/modules.d/99base/install +++ b/modules.d/99base/install @@ -27,3 +27,4 @@ inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" inst_hook cmdline 10 "$moddir/parse-root-opts.sh" inst_hook cmdline 20 "$moddir/parse-blacklist.sh" mkdir -p "${initdir}/var/run" +[ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp