X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=utils%2Fpb-console;h=5ba98cc4692564b435d1f7d271bf07355e838c06;hb=5c726bd40a4a745e115a22e336131be8f6666b55;hp=64bf77fd0c69e4e77973dc0187bb5a155df872e3;hpb=71da0c6cb80e3708213a08c06e71f099534bcd2a;p=petitboot diff --git a/utils/pb-console b/utils/pb-console index 64bf77f..5ba98cc 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 @@ -104,16 +116,30 @@ case "$(tty)" in ;; esac +# we may have been run from udev - ensure we have a sensible PATH +if [ -z "$PATH" ] +then + PATH=/usr/bin:/usr/sbin:/bin:/sbin +fi +PATH=/var/lib/pb-plugins/bin:$PATH +export PATH + verbose_opt= if $pb_config debug | grep -q enabled 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 +trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM + while : do $ui $verbose_opt reset - echo "Exiting petitboot. Type 'exit' to return." $shell done