3 # Petitboot utility script for running a petitboot UI program
16 pb-console [OPTIONS] -- [ARGS]
19 Start in a detached (background) state.
22 Start a getty (specified by PATH, otherwise $getty),
23 passing additional ARGS to the getty process
26 Use PATH as the exit-to-shell shell
29 Use PATH as the petitboot UI
37 opts=$(getopt --options 'hdg::s:u:' \
38 --long 'help,detach,getty::,shell:,ui:' \
77 if [ "$use_getty" = 1 ]
79 if [ -n "$getty_arg" ]
87 # If the getty args include autologin don't override with -l
88 # and leave calling petitboot-nc to the user's init
89 if [ "$ttyarg" == "-a" ]
97 setsid -c $getty $login_arg "$@" &
100 exec $getty $login_arg "$@"
104 for f in /etc/environment /etc/locale
112 # we force local terminals to use the linux termcap definition
119 # we may have been run from udev - ensure we have a sensible PATH
122 PATH=/usr/bin:/usr/sbin:/bin:/sbin
124 PATH=/var/lib/pb-plugins/bin:$PATH
128 if $pb_config debug | grep -q enabled
130 verbose_opt=--verbose
133 # kernel messages may write over the ncurses ui - change log level to only
134 # show particularly important messages
138 trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM