]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-console
lib: Move ipmi_bootdev enum to types.h
[petitboot] / utils / pb-console
index 81be2183ca8c2e1f4bef273c0ecbfbda4fc16d62..36b9c034e51af0eeaae7b54a03b5ed323798d5dc 100644 (file)
@@ -9,6 +9,7 @@ shell=sh
 getty=/sbin/getty
 use_getty=0
 detach=0
+pb_config=pb-config
 
 usage() {
        cat >&2 <<EOF
@@ -82,14 +83,44 @@ then
        if [ "$detach" = 1 ]
        then
                $getty -l $0 "$@" &
+               exit
        else
                exec $getty -l $0 "$@"
        fi
 fi
 
+for f in /etc/environment /etc/locale
+do
+       if [ -e "$f" ]
+       then
+               export $(cat "$f")
+       fi
+done
+
+# we force local terminals to use the linux termcap definition
+case "$(tty)" in
+/dev/tty[0-9]*)
+       export TERM=linux
+       ;;
+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
+export PATH
+
+verbose_opt=
+if $pb_config debug | grep -q enabled
+then
+       verbose_opt=--verbose
+fi
+
 while :
 do
-       $ui
+       $ui $verbose_opt
+       reset
        echo "Exiting petitboot. Type 'exit' to return."
        $shell
 done