diff options
author | Geoff Levand <geoff@infradead.org> | 2009-08-18 21:48:38 +0000 |
---|---|---|
committer | Geoff Levand <geoff@infradead.org> | 2009-08-18 21:48:38 +0000 |
commit | 25780bc555b3f7da767db94f66ffb569c3f1cb77 (patch) | |
tree | df4afea3619f251713680e31d9538849e50f70a7 /target/linux/ps3/petitboot/base-files/sbin | |
parent | 3f063c39b8fc802e318ed0b7cc53694f7f419fd3 (diff) | |
download | master-187ad058-25780bc555b3f7da767db94f66ffb569c3f1cb77.tar.gz master-187ad058-25780bc555b3f7da767db94f66ffb569c3f1cb77.tar.bz2 master-187ad058-25780bc555b3f7da767db94f66ffb569c3f1cb77.zip |
ps3: Updates for ps3-bl-option
Update the ps3 bootloader helper script ps3-bl-option.
o Add new option --set-bootloader-timeout.
o Use generic name 'bootloader'.
o General format cleanup.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17300 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ps3/petitboot/base-files/sbin')
-rw-r--r-- | target/linux/ps3/petitboot/base-files/sbin/ps3-bl-option | 98 |
1 files changed, 52 insertions, 46 deletions
diff --git a/target/linux/ps3/petitboot/base-files/sbin/ps3-bl-option b/target/linux/ps3/petitboot/base-files/sbin/ps3-bl-option index 8eea93d979..972c00ae13 100644 --- a/target/linux/ps3/petitboot/base-files/sbin/ps3-bl-option +++ b/target/linux/ps3/petitboot/base-files/sbin/ps3-bl-option @@ -18,44 +18,43 @@ # usage() { - echo "" >&2 - echo "SYNOPSIS" >&2 - echo " bl-option [OPTION]" >&2 - echo "" >&2 - echo "DESCRIPTION" >&2 - echo " Get and set PS3 bootloader options in flash." >&2 - echo "" >&2 - echo "OPTIONS" >&2 - echo " -m, --get-video-mode" >&2 - echo " Get the bootloader video mode." >&2 - echo "" >&2 - echo " -M, --set-video-mode value" >&2 - echo " Set the bootloader video mode." >&2 - echo "" >&2 - echo " -p, --get-petitboot-default" >&2 - echo " Get the default Petitboot menu item." >&2 - echo "" >&2 - echo " -P, --set-petitboot-default value" >&2 - echo " Set the default Petitboot menu item." >&2 - echo "" >&2 - echo " -t, --get-telnet-enabled" >&2 - echo " Get the telnet enabled flag." >&2 - echo "" >&2 - echo " -T, --set-telnet-enabled value" >&2 - echo " Set the telnet enabled flag." >&2 - echo "" >&2 - echo " -h, --help" >&2 - echo " Print a help message." >&2 - echo "" >&2 - echo "SEE ALSO" >&2 - echo " ps3-flash-util(8)" >&2 - echo "" >&2 - exit 1 + echo -n " +SYNOPSIS + ps3-bl-option [OPTION] +DESCRIPTION + Get and set PS3 bootloader options in flash. +OPTIONS + -m, --get-video-mode + Get the bootloader video mode. + -M, --set-video-mode value + Set the bootloader video mode. + -o, --get-bootloader-timeout + Get the bootloader timeout in seconds. + -O, --set-bootloader-timeout value + Set the bootloader timeout in seconds. + -p, --get-bootloader-default + Get the default bootloader menu item. + -P, --set-bootloader-default value + Set the default bootloader menu item. + -t, --get-telnet-enabled + Get the telnet enabled flag. + -T, --set-telnet-enabled value + Set the telnet enabled flag. + -h, --help + Print a help message. +SEE ALSO + ps3-flash-util(8) +" } -if [ "$#" -eq 0 ] ; then +bad_arg() { echo "ERROR: bad arg" >&2; usage + exit 1 +} + +if [ "$#" -eq 0 ] ; then + bad_arg fi get_flag() { @@ -74,40 +73,47 @@ set_flag() { } # owners -petitboot="3" +bootloader="3" # keys -menu="1" +item="1" video="2" flags="3" +timeout="4" # flags telnet="1" case "$1" in -m | --get-video-mode) - ps3-flash-util --db-print ${petitboot} ${video} + ps3-flash-util --db-print ${bootloader} ${video} ;; -M | --set-video-mode) - ps3-flash-util --db-write-half ${petitboot} ${video} $2 + ps3-flash-util --db-write-half ${bootloader} ${video} $2 + ;; + -o | --get-bootloader-timeout) + ps3-flash-util --db-print ${bootloader} ${timeout} ;; - -p | --get-petitboot-default) - ps3-flash-util --db-print ${petitboot} ${menu} + -O | --set-bootloader-timeout) + ps3-flash-util --db-write-half ${bootloader} ${timeout} $2 ;; - -P | --set-petitboot-default) - ps3-flash-util --db-write-word ${petitboot} ${menu} $2 + -p | --get-bootloader-default) + ps3-flash-util --db-print ${bootloader} ${item} + ;; + -P | --set-bootloader-default) + ps3-flash-util --db-write-word ${bootloader} ${item} $2 ;; -t | --get-telnet-enabled) - get_flag ${petitboot} ${flags} ${telnet} + get_flag ${bootloader} ${flags} ${telnet} ;; -T | --set-telnet-enabled) - set_flag ${petitboot} ${flags} ${telnet} $2 + set_flag ${bootloader} ${flags} ${telnet} $2 ;; -h | --help) usage + exit 0 ;; *) - echo "ERROR: bad arg $1" >&2; - usage + bad_arg ;; esac |