X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=utils%2Fpb-console;h=64bf77fd0c69e4e77973dc0187bb5a155df872e3;hp=c96ac9825d870e3039fb24d86706b50e4c988871;hb=8fa3f3bd22e66329ac0dd65a82bf8eb554e2364d;hpb=e39b409ec6863ade2e070f7ed2236cee0ca46180 diff --git a/utils/pb-console b/utils/pb-console index c96ac98..64bf77f 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -6,61 +6,114 @@ ui=petitboot-nc shell=sh - +getty=/sbin/getty +use_getty=0 detach=0 +pb_config=pb-config usage() { - echo "pb-console [OPTIONS] console_dev" >&2 - echo "OPTIONS" >&2 - echo " -d, --detach" >&2 - echo " Start in a detached (background) state." >&2 - echo " -h, --help" >&2 - echo " Print a help message." >&2 + cat >&2 <$console 2>&1 -fi +# we force local terminals to use the linux termcap definition +case "$(tty)" in +/dev/tty[0-9]*) + export TERM=linux + ;; +esac -if [ "$detach" = 1 ] +verbose_opt= +if $pb_config debug | grep -q enabled then - ( - pb_loop - ) & -else - pb_loop + verbose_opt=--verbose fi + +while : +do + $ui $verbose_opt + reset + echo "Exiting petitboot. Type 'exit' to return." + $shell +done