From 67a3672c001879eda60de804c890764bb5da09bd Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 6 Jun 2013 15:37:46 +0200 Subject: [rootfs-stage31] add debug in the kernel command line: use with 'debug=' where level can be 1 (before switch_root), 2 (after aufs), 3 (after squashfs/nfs, before aufs), 4 (before network) --- remote/rootfs/rootfs-stage31/data/init | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index ee90cf15..bf11d9aa 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -15,7 +15,7 @@ # debug shell drop_shell() { [ $# -gt 0 ] && echo $@ - echo "Dropping debug shell. CTRL + D will continue booting." + echo "CTRL + D will continue booting." setsid sh -c 'exec sh /dev/tty1 2>&1' } @@ -49,8 +49,8 @@ read KCL < /proc/cmdline export KCL for opts in ${KCL}; do case ${opts} in - debug*) - DEBUG=1 ;; + debug=*) + DEBUG=${opts#debug=} ;; splash*) SPLASH=1 ;; ip=*) @@ -79,6 +79,8 @@ fi mkdir -p /dev/shm/union /dev/shm/uniontmp /rorootfs mount -n -t tmpfs none /dev/shm/uniontmp +[ $DEBUG -ge 4 ] && drop_shell "Requested Debug Shell (before network)." + echo "Setup networking..." # Source script so the variables are still available to us . "/bin/setup_network" || echo "Error setting up network" @@ -93,7 +95,7 @@ else mount -t squashfs /mnt/*.sqfs /rorootfs || drop_shell "Problem mounting Squashfs." fi -[ $DEBUG -ge 1 ] && drop_shell "Requested Debug Shell." +[ $DEBUG -ge 3 ] && drop_shell "Requested Debug Shell: squashfs/nfs mounted, before aufs." echo "Building aufs..." mv /mnt/modprobing /dev/shm/uniontmp @@ -102,6 +104,8 @@ mount -n -t aufs -o br:/dev/shm/uniontmp:/rorootfs=ro none /mnt || drop_shell "P mkdir -p /mnt/uniontmp /mnt/tmp mount -n --move /dev/shm/uniontmp /mnt/uniontmp || drop_shell "Problem moving uniontmp." +[ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after aufs'ing." + # create udev rule for nic we booted from cat > "/mnt/etc/udev/rules.d/70-net-boot-nic-name.rules" <