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
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
+ $shell -m
done