base: add logger for rdinitdebug
initlog logs to /init.log /dev/kmsg and /dev/consolemaster
parent
a0e44f97bd
commit
4592b6983a
2
dracut.8
2
dracut.8
|
@ -286,7 +286,7 @@ print informational output though "quiet" is set
|
||||||
allow dropping to a shell, if root mounting fails
|
allow dropping to a shell, if root mounting fails
|
||||||
.TP
|
.TP
|
||||||
.B rdinitdebug
|
.B rdinitdebug
|
||||||
set -x for the dracut shell
|
set -x for the dracut shell and logs to dmesg, console and /init.log
|
||||||
.TP
|
.TP
|
||||||
.B rdbreak
|
.B rdbreak
|
||||||
drop to a shell at the end
|
drop to a shell at the end
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
emergency_shell()
|
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 ; echo
|
||||||
echo $@
|
echo $@
|
||||||
source_all emergency
|
source_all emergency
|
||||||
|
@ -50,6 +53,12 @@ if [ ! -c /dev/ptmx ]; then
|
||||||
fi
|
fi
|
||||||
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
|
setdebug
|
||||||
|
|
||||||
mkdir /dev/shm
|
mkdir /dev/shm
|
||||||
|
@ -244,6 +253,10 @@ fi
|
||||||
|
|
||||||
info "Switching root"
|
info "Switching root"
|
||||||
|
|
||||||
|
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
||||||
|
# wait for loginit
|
||||||
|
wait
|
||||||
|
|
||||||
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."
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
|
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
|
if [ ! -e "${initdir}/bin/sh" ]; then
|
||||||
dracut_install bash
|
dracut_install bash
|
||||||
(ln -s bash "${initdir}/bin/sh" || :)
|
(ln -s bash "${initdir}/bin/sh" || :)
|
||||||
|
@ -8,6 +8,7 @@ fi
|
||||||
# install our scripts and hooks
|
# install our scripts and hooks
|
||||||
inst "$moddir/init" "/init"
|
inst "$moddir/init" "/init"
|
||||||
inst "$moddir/initqueue" "/sbin/initqueue"
|
inst "$moddir/initqueue" "/sbin/initqueue"
|
||||||
|
inst "$moddir/loginit" "/sbin/loginit"
|
||||||
mkdir -p ${initdir}/initqueue
|
mkdir -p ${initdir}/initqueue
|
||||||
mkdir -p ${initdir}/initqueue-finished
|
mkdir -p ${initdir}/initqueue-finished
|
||||||
mkdir -p ${initdir}/initqueue-settled
|
mkdir -p ${initdir}/initqueue-settled
|
||||||
|
|
Loading…
Reference in New Issue