X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=utils%2Fpb-console;h=ad601e2eb879a4871ff93c4380f7240fa44c89b5;hp=5f8ffa6f3ef130ec8ff52d3a69e9daaf094c34c5;hb=cfd6bf4f7da1ee71a65f57f28912d43ab757b968;hpb=0b71e584078dbe370ed37bcc26f2815d138d28fc diff --git a/utils/pb-console b/utils/pb-console index 5f8ffa6..ad601e2 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -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 @@ -107,8 +119,9 @@ esac # we may have been run from udev - ensure we have a sensible PATH if [ -z "$PATH" ] then - PATH=/var/lib/pb-plugins/bin:/usr/bin:/usr/sbin:/bin:/sbin + PATH=/usr/bin:/usr/sbin:/bin:/sbin fi +PATH=/var/lib/pb-plugins/bin:$PATH export PATH verbose_opt= @@ -117,10 +130,17 @@ then verbose_opt=--verbose fi +# kernel messages may write over the ncurses ui - change log level to only +# 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