diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-19 15:03:04 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-19 15:03:04 +1000 |
commit | e9b15cbf9dfb21ed2abc0b2e4de747cb1c9a247c (patch) | |
tree | dd5085115153c14ab1eb3ddb5aaeb07bebc33c88 /external | |
parent | 2c4e9eedd427c0a29c999ffd1b4ec07f1fae7ee5 (diff) | |
download | skiboot-e9b15cbf9dfb21ed2abc0b2e4de747cb1c9a247c.zip skiboot-e9b15cbf9dfb21ed2abc0b2e4de747cb1c9a247c.tar.gz skiboot-e9b15cbf9dfb21ed2abc0b2e4de747cb1c9a247c.tar.bz2 |
Add single partition flashing for BMC platforms to boot_test.sh
Support flashing whole PNOR and/or individual partitions.
This should let you flash a known good whole PNOR and then replace
individual partitions in one command.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/boot-tests/bmc_support.sh | 37 | ||||
-rwxr-xr-x | external/boot-tests/boot_test.sh | 24 |
2 files changed, 42 insertions, 19 deletions
diff --git a/external/boot-tests/bmc_support.sh b/external/boot-tests/bmc_support.sh index cf18d69..d021cd3 100644 --- a/external/boot-tests/bmc_support.sh +++ b/external/boot-tests/bmc_support.sh @@ -33,7 +33,16 @@ function poweroff { } function flash { - remotecp $PNOR $target /tmp/image.pnor; + if [ ! -z "$PNOR" ]; then + remotecp $PNOR $target /tmp/image.pnor; + fi + if [ "${LID[0]}" != "" ]; then + remotecp ${LID[0]} $target /tmp/skiboot.lid; + fi + if [ "${LID[1]}" != "" ]; then + remotecp ${LID[1]} $target /tmp/bootkernel + fi + if [ "$?" -ne "0" ] ; then error "Couldn't copy firmware image"; fi @@ -49,11 +58,29 @@ function flash { #fi # flash it - msg "Flashing PNOR" - $SSHCMD "/usr/local/bin/pflash -E -f -p /tmp/image.pnor" - if [ "$?" -ne "0" ] ; then - error "An unexpected pflash error has occured"; + if [ ! -z "$PNOR" ]; then + msg "Flashing full PNOR" + $SSHCMD "/usr/local/bin/pflash -E -f -p /tmp/image.pnor" + if [ "$?" -ne "0" ] ; then + error "An unexpected pflash error has occured"; + fi fi + + if [ ! -z "${LID[0]}" ] ; then + msg "Flashing PAYLOAD PNOR partition" + $SSHCMD "/usr/local/bin/pflash -e -f -P PAYLOAD -p /tmp/skiboot.lid" + if [ "$?" -ne "0" ] ; then + error "An unexpected pflash error has occured"; + fi + fi + + if [ ! -z "${LID[1]}" ] ; then + msg "Flashing BOOTKERNEL PNOR partition" + $SSHCMD "/usr/local/bin/pflash -e -f -P BOOTKERNEL -p /tmp/bootkernel" + if [ "$?" -ne "0" ] ; then + error "An unexpected pflash error has occured"; + fi + fi } function boot_firmware { diff --git a/external/boot-tests/boot_test.sh b/external/boot-tests/boot_test.sh index 7927b56..b7f14e4 100755 --- a/external/boot-tests/boot_test.sh +++ b/external/boot-tests/boot_test.sh @@ -116,12 +116,12 @@ There are three usage modes. 1) boot_test.sh -h Print this help -2) boot_test.sh [-vdp] -t target -b (fsp|bmc) +2) boot_test.sh [-vdp] -t target -B -b (fsp|bmc) Boot test the target without flashing. Specify the type of machine (FSP or BMC) with the -b option. -3) boot_test.sh [-vdp] -t target -P pnor - boot_test.sh [-vdp] -t target [-1 lid1] [-2 lid2] [-3 lid3] +3) boot_test.sh [-vdp] -b bmc -t target -P pnor + boot_test.sh [-vdp] -b fsp -t target [-1 lid1] [-2 lid2] [-3 lid3] Flash the given firmware before boot testing. @@ -141,6 +141,8 @@ Common Options: -d makes the script print lots of things (set -vx). Only use this for debugging the script: it's highly likely that successful booting into Petitboot will not be detected with this option. + + -b BMC type (bmc or fsp). EOF exit 1; } @@ -165,7 +167,7 @@ PNOR="" LID[0]="" LID[1]="" LID[2]="" -while getopts "hvdpb:1:2:3:P:t:" OPT; do +while getopts "hvdpB1:2:3:P:t:b:" OPT; do case "$OPT" in v) V=1; @@ -176,8 +178,7 @@ while getopts "hvdpb:1:2:3:P:t:" OPT; do d) set -vx; ;; - b) - method=$OPTARG; + B) bootonly=1; if [ $firmware_supplied -eq 1 ]; then usage @@ -186,27 +187,22 @@ while getopts "hvdpb:1:2:3:P:t:" OPT; do p) powerdown=1; ;; + b) + method=$OPTARG; + ;; 1|2|3) firmware_supplied=1; - if [ \( $bootonly -eq 1 \) -o \( "$method" = "bmc" \) ]; then - usage; - fi if [ ! -e "$OPTARG" ] ; then error "Couldn't stat $OPTARG"; fi LID[$(expr ${OPT} - 1)]="$OPTARG" - method=fsp ;; P) firmware_supplied=1; - if [ \( $bootonly -eq 1 \) -o \( "$method" != "" \) ]; then - usage; - fi if [ ! -e "$OPTARG" ] ; then error "Couldn't stat $OPTARG"; fi PNOR="$OPTARG" - method=bmc ;; t) target=$OPTARG; |