base/init: set RDTIMESTAMP
set $RDTIMESTAMP for init, if rd.timestamp is specified on the kernel command line, so that systemd can print out: "systemd: Boot finished after 15s = 3s (kernel) + 2s (initrd) + 10s (userspace)"master
parent
2d9f5858bc
commit
647bef8ca6
|
@ -164,6 +164,14 @@ This parameter can be specified multiple times.</para>
|
||||||
<para>set udev to loglevel debug</para>
|
<para>set udev to loglevel debug</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<envar>rd.timestamp</envar>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>export RDTIMESTAMP environment variable to init, which is set to the uptime of the dracut start.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
<refsect2>
|
<refsect2>
|
||||||
|
|
|
@ -77,6 +77,9 @@ mknod -m 0666 /dev/null c 1 3
|
||||||
mount -t proc /proc /proc >/dev/null 2>&1
|
mount -t proc /proc /proc >/dev/null 2>&1
|
||||||
mount -t sysfs /sys /sys >/dev/null 2>&1
|
mount -t sysfs /sys /sys >/dev/null 2>&1
|
||||||
|
|
||||||
|
read RDTIMESTAMP _tmp < /proc/uptime
|
||||||
|
unset _tmp
|
||||||
|
|
||||||
if [ ! -c /dev/ptmx ]; then
|
if [ ! -c /dev/ptmx ]; then
|
||||||
# try to mount devtmpfs
|
# try to mount devtmpfs
|
||||||
if ! mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then
|
if ! mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then
|
||||||
|
@ -305,6 +308,7 @@ else
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
initargs="$initargs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Debug: Copy state
|
# Debug: Copy state
|
||||||
|
@ -313,6 +317,12 @@ if getarg rdcopystate; then
|
||||||
cp /tmp/* /dev/.initramfs/ >/dev/null 2>&1
|
cp /tmp/* /dev/.initramfs/ >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if getarg rd.timestamp; then
|
||||||
|
export RDTIMESTAMP
|
||||||
|
else
|
||||||
|
unset RDTIMESTAMP
|
||||||
|
fi
|
||||||
|
|
||||||
info "Switching root"
|
info "Switching root"
|
||||||
|
|
||||||
wait_for_loginit
|
wait_for_loginit
|
||||||
|
@ -320,7 +330,6 @@ wait_for_loginit
|
||||||
umask $OLD_UMASK
|
umask $OLD_UMASK
|
||||||
unset HOME
|
unset HOME
|
||||||
unset TERM
|
unset TERM
|
||||||
|
|
||||||
exec switch_root "$NEWROOT" "$INIT" $initargs || {
|
exec switch_root "$NEWROOT" "$INIT" $initargs || {
|
||||||
echo "Something went very badly wrong in the initramfs. Please "
|
echo "Something went very badly wrong in the initramfs. Please "
|
||||||
echo "file a bug against dracut."
|
echo "file a bug against dracut."
|
||||||
|
|
Loading…
Reference in New Issue