From d28c07b5e23237a97387435e157e248e19128598 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 16 May 2013 13:55:03 +0800 Subject: [PATCH 1/1] utils/pb-console: use getty rather than exec exec is a bit flaky for starting on consoles, so use getty instead. Signed-off-by: Jeremy Kerr --- utils/pb-console | 89 +++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/utils/pb-console b/utils/pb-console index 00b25ac..81be218 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -6,63 +6,90 @@ ui=petitboot-nc shell=sh - +getty=/sbin/getty +use_getty=0 detach=0 usage() { cat >&2 <$console 2>&1 + if [ -n "$getty_arg" ] + then + getty="$getty_arg" + fi + if [ "$detach" = 1 ] + then + $getty -l $0 "$@" & + else + exec $getty -l $0 "$@" + fi fi -if [ "$detach" = 1 ] -then - ( - pb_loop - ) & -else - pb_loop -fi +while : +do + $ui + echo "Exiting petitboot. Type 'exit' to return." + $shell +done -- 2.39.2