summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-06-17 16:06:58 +0200
committerDave Reisner <dreisner@archlinux.org>2013-06-25 23:16:41 +0200
commitc61d4791d34591bb0fed558494a52d517d900b44 (patch)
tree297628ef2cece133a65981480d0ae5b99bc2abcb /init
parentd6e92394a4c133eb652714bb9aa13008c808301b (diff)
downloadmkinitcpio-c61d4791d34591bb0fed558494a52d517d900b44.tar.gz
mkinitcpio-c61d4791d34591bb0fed558494a52d517d900b44.tar.xz
init: allow for logging of early userspace
This introduces support for the rd.log and rd.debug kernel command line options, which log early userspace activity to /run/initramfs/init.log. Code is largely inspired by Dracut's implementation of early userspace logging, but without needless complexity and redundancies. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'init')
-rw-r--r--init6
1 files changed, 6 insertions, 0 deletions
diff --git a/init b/init
index dfebd53..2578cf8 100644
--- a/init
+++ b/init
@@ -3,6 +3,7 @@
udevd_running=0
mount_handler=default_mount_handler
init=/sbin/init
+rd_logmask=0
if [ -x /usr/bin/systemd-timestamp ]; then
RD_TIMESTAMP=$(systemd-timestamp)
@@ -19,6 +20,9 @@ mkdir -m755 /run/initramfs
# parse the kernel command line
parse_cmdline </proc/cmdline
+# setup logging as early as possible
+rdlogger_start
+
for d in ${disablehooks//,/ }; do
[ -e "/hooks/$d" ] && chmod 644 "/hooks/$d"
done
@@ -72,6 +76,8 @@ if [ "${break}" = "postmount" ]; then
launch_interactive_shell
fi
+rdlogger_stop
+
exec env -i \
"TERM=$TERM" \
"RD_TIMESTAMP=$RD_TIMESTAMP" \