]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-console
pb-plugin: Don't execute metadata files
[petitboot] / utils / pb-console
index d846ea7614703dd80f590f45a6f74341889dd773..c6def47a74d010a1bfd7bd7111ca57717c5df0e5 100644 (file)
@@ -9,6 +9,7 @@ shell=sh
 getty=/sbin/getty
 use_getty=0
 detach=0
 getty=/sbin/getty
 use_getty=0
 detach=0
+pb_config=pb-config
 
 usage() {
        cat >&2 <<EOF
 
 usage() {
        cat >&2 <<EOF
@@ -96,9 +97,30 @@ do
        fi
 done
 
        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
+PATH=/var/lib/pb-plugins/bin:$PATH
+export PATH
+
+verbose_opt=
+if $pb_config debug | grep -q enabled
+then
+       verbose_opt=--verbose
+fi
+
 while :
 do
 while :
 do
-       $ui
+       $ui $verbose_opt
        reset
        echo "Exiting petitboot. Type 'exit' to return."
        $shell
        reset
        echo "Exiting petitboot. Type 'exit' to return."
        $shell