]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base: use systemd-timestamp for RD_TIMESTAMP, if possible
authorHarald Hoyer <harald@redhat.com>
Thu, 18 Nov 2010 11:28:21 +0000 (12:28 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 18 Nov 2010 11:28:21 +0000 (12:28 +0100)
modules.d/99base/init
modules.d/99base/install

index 1c695c2f7430f8e73fb25b6df219e438efc9ca28..f79d102acb15070521bcbdfdc37458f450352508 100755 (executable)
@@ -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
index 0435e329c3f1f08593353a71cefdaa3c6b93612a..57bf4bc1416c7171db18ac83be81e49d7038c388 100755 (executable)
@@ -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