Browse Source

base: add logger for rdinitdebug

initlog logs to /init.log /dev/kmsg and /dev/console
master
Harald Hoyer 16 years ago
parent
commit
4592b6983a
  1. 2
      dracut.8
  2. 15
      modules.d/99base/init
  3. 3
      modules.d/99base/install

2
dracut.8

@ -286,7 +286,7 @@ print informational output though "quiet" is set @@ -286,7 +286,7 @@ print informational output though "quiet" is set
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

15
modules.d/99base/init

@ -7,7 +7,10 @@ @@ -7,7 +7,10 @@

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
@ -50,6 +53,12 @@ if [ ! -c /dev/ptmx ]; then @@ -50,6 +53,12 @@ if [ ! -c /dev/ptmx ]; then
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
@ -244,6 +253,10 @@ fi @@ -244,6 +253,10 @@ fi

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."

3
modules.d/99base/install

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!/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" || :)
@ -8,6 +8,7 @@ fi @@ -8,6 +8,7 @@ fi
# 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

Loading…
Cancel
Save