]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-console
ui/ncurses: Keep track of the default boot option
[petitboot] / utils / pb-console
index c071a2f6e5bcce686f82dbf0d098addf111a9c63..ad601e2eb879a4871ff93c4380f7240fa44c89b5 100644 (file)
@@ -80,12 +80,24 @@ then
        then
                getty="$getty_arg"
        fi
+
+       login_arg="-l$0"
+       for ttyarg in "$@"
+       do
+               # If the getty args include autologin don't override with -l
+               # and leave calling petitboot-nc to the user's init
+               if [ "$ttyarg" == "-a" ]
+               then
+                       login_arg=""
+               fi
+       done
+
        if [ "$detach" = 1 ]
        then
-               $getty -l $0 "$@" &
+               setsid -c $getty $login_arg "$@" &
                exit
        else
-               exec $getty -l $0 "$@"
+               exec $getty $login_arg "$@"
        fi
 fi
 
@@ -122,10 +134,13 @@ fi
 # show particularly important messages
 dmesg -n 1
 
+trap '' SIGINT
+
 while :
 do
        $ui $verbose_opt
        reset
        echo "Exiting petitboot. Type 'exit' to return."
+       echo "You may run 'pb-sos' to gather diagnostic data"
        $shell
 done