diff options
Diffstat (limited to 'external/boot-tests')
-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; |