From f61ad9783356ecf0ba424afdc6fdeee280bc4e38 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 2 Mar 2012 13:17:05 +0000 Subject: [PATCH] * Run the stage 2 debug shell at a more useful point (just before starting Upstart). This also causes $PATH to be set to something more sensible. svn path=/nixos/trunk/; revision=32740 --- modules/system/boot/stage-2-init.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index 452e3c99477c..ac6193b99629 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -57,6 +57,7 @@ cat /proc/mounts > /etc/mtab # Process the kernel command line. +debug2= for o in $(cat /proc/cmdline); do case $o in debugtrace) @@ -64,8 +65,7 @@ for o in $(cat /proc/cmdline); do set -x ;; debug2) - echo "Debug shell called from @out@" - exec @shell@ + debug2=1 ;; S|s|single) # !!! argh, can't pass a startup event to Upstart yet. @@ -166,7 +166,10 @@ export MODULE_DIR=@kernel@/lib/modules/ # For debugging Upstart. -#@shell@ --login < /dev/console > /dev/console 2>&1 & +if [ -n "$debug2" ]; then + echo "Debug shell called from @out@" + @shell@ +fi # Start Upstart's init.