diff options
author | Claudio Carvalho <cclaudio@linux.vnet.ibm.com> | 2016-09-28 05:11:00 -0300 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-10 15:29:37 +1100 |
commit | d1cb3a5bbdecf2c53428d7334922da00cd47eb6c (patch) | |
tree | f08360c8cf7e8d805b236626347d53d80668035c | |
parent | 0bf902459241dbf9e9466bab05996a6361f134c0 (diff) | |
download | skiboot-d1cb3a5bbdecf2c53428d7334922da00cd47eb6c.zip skiboot-d1cb3a5bbdecf2c53428d7334922da00cd47eb6c.tar.gz skiboot-d1cb3a5bbdecf2c53428d7334922da00cd47eb6c.tar.bz2 |
external/boot_tests: add arbitrary lid option -F
There are situations where we want to flash a lid that isn't neither
BOOTKERNEL nor PAYLOAD. That's the case for CAPP, to test secure and
trusted boot patches we need to flash CAPP with different secure boot
headers.
This adds the -F option for BMC targets that can be used to flash an
arbitrary lid.
Example: '-F CAPP:cappucode.bin.sec.ecc' will flash CAPP partition with
cappucode.bin.sec.ecc
The eyecatch for each partition is defined in
https://github/open-power/pnor.git
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | external/boot-tests/bmc_support.sh | 14 | ||||
-rwxr-xr-x | external/boot-tests/boot_test.sh | 16 |
2 files changed, 27 insertions, 3 deletions
diff --git a/external/boot-tests/bmc_support.sh b/external/boot-tests/bmc_support.sh index f28c610..e28ce7f 100644 --- a/external/boot-tests/bmc_support.sh +++ b/external/boot-tests/bmc_support.sh @@ -55,7 +55,10 @@ function flash { if [ "${LID[1]}" != "" ]; then remotecp ${LID[1]} $target /tmp/bootkernel fi - + if [ "${arbitrary_lid[1]}" != "" ]; then + remotecp ${arbitrary_lid[1]} $target /tmp/$(basename ${arbitrary_lid[1]}) + fi + if [ "$?" -ne "0" ] ; then error "Couldn't copy firmware image"; fi @@ -94,6 +97,15 @@ function flash { error "An unexpected pflash error has occurred"; fi fi + + if [ ! -z "${arbitrary_lid[0]}" -a ! -z "${arbitrary_lid[1]}" ] ; then + msg "Flashing ${arbitrary_lid[0]} PNOR partition" + $SSHCMD "$PFLASH_BINARY -e -f -P ${arbitrary_lid[0]} -p /tmp/$(basename ${arbitrary_lid[1]})" + if [ "$?" -ne "0" ] ; then + error "An unexpected pflash error has occurred"; + fi + fi + } function boot_firmware { diff --git a/external/boot-tests/boot_test.sh b/external/boot-tests/boot_test.sh index 4ad869c..88b4e69 100755 --- a/external/boot-tests/boot_test.sh +++ b/external/boot-tests/boot_test.sh @@ -136,6 +136,7 @@ There are three usage modes. 3) boot_test.sh [-vdp] -b bmc -t target -P pnor boot_test.sh [-vdp] -b bmc -t target [-1 PAYLOAD] [-2 BOOTKERNEL] + boot_test.sh [-vdp] -b bmc -t target [-F eyecatcher:lid ] boot_test.sh [-vdp] -b fsp -t target [-1 lid1] [-2 lid2] [-3 lid3] Flash the given firmware before boot testing. @@ -143,7 +144,8 @@ There are three usage modes. For a BMC target, -P specifies a full PNOR. For a BMC target, -1/-2 specify the PAYLOAD and BOOTKERNEL PNOR partitions - respectively. Only the given partitions will be flashed. + respectively; -e specifies the partition name for -3. + Only the given partitions will be flashed. For an FSP target, -1/-2/-3 specify lids. Any combination of lids is acceptable. @@ -185,12 +187,14 @@ firmware_supplied=0; target="" method="" PNOR="" +arbitrary_lid[0]="" +arbitrary_lid[1]="" LID[0]="" LID[1]="" LID[2]="" keep_log_success=0 keep_log_failure=0 -while getopts "kKhvdpB1:2:3:P:t:b:" OPT; do +while getopts "kKhvdpB1:2:3:P:t:b:F:" OPT; do case "$OPT" in v) V=1; @@ -234,6 +238,14 @@ while getopts "kKhvdpB1:2:3:P:t:b:" OPT; do fi PNOR="$OPTARG" ;; + F) + firmware_supplied=1; + arbitrary_lid[0]=`echo "$OPTARG" | cut -s -f1 -d:`; + arbitrary_lid[1]=`echo "$OPTARG" | cut -s -f2 -d:`; + if [ -z "${arbitrary_lid[0]}" -o -z "${arbitrary_lid[1]}" ] ; then + error "-F must be in the format eyecatcher:lid, e.g. GARD:gard.bin"; + fi + ;; t) target=$OPTARG; ;; |