allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
-set -x for the dracut shell
+set -x for the dracut shell and logs to dmesg, console and /init.log
.TP
.B rdbreak
drop to a shell at the end
emergency_shell()
{
- exec >/dev/console 2>&1 </dev/console
+ set +x
+ exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
+ # wait for loginit
+ wait
echo ; echo
echo $@
source_all emergency
fi
fi
+if getarg rdinitdebug; then
+ getarg quiet && DRACUT_QUIET="yes"
+ mkfifo /dev/initlog.pipe
+ /sbin/loginit $DRACUT_QUIET </dev/initlog.pipe >/dev/console 2>&1 &
+ exec >/dev/initlog.pipe 2>&1
+fi
setdebug
mkdir /dev/shm
info "Switching root"
+exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
+# wait for loginit
+wait
+
exec switch_root "$NEWROOT" "$INIT" $initargs || {
echo "Something went very badly wrong in the initramfs. Please "
echo "file a bug against dracut."
#!/bin/bash
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
- sed ls flock cp mv dmesg rm ln rmmod
+ sed ls flock cp mv dmesg rm ln rmmod mkfifo less
if [ ! -e "${initdir}/bin/sh" ]; then
dracut_install bash
(ln -s bash "${initdir}/bin/sh" || :)
# install our scripts and hooks
inst "$moddir/init" "/init"
inst "$moddir/initqueue" "/sbin/initqueue"
+inst "$moddir/loginit" "/sbin/loginit"
mkdir -p ${initdir}/initqueue
mkdir -p ${initdir}/initqueue-finished
mkdir -p ${initdir}/initqueue-settled