[Skiboot] [PATCH 12/12] external/boot_tests: Add the remove lid option -r

Claudio Carvalho cclaudio at linux.vnet.ibm.com
Thu Aug 11 16:30:20 AEST 2016


Usually, BMC systems doesn't have too much space for storage.

This adds the -r option for BMC targets. With -r the lid is
removed from BMC just after it is flashed.

Signed-off-by: Claudio Carvalho <cclaudio at linux.vnet.ibm.com>
---
 external/boot-tests/bmc_support.sh | 13 ++++++++++++-
 external/boot-tests/boot_test.sh   | 16 ++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/external/boot-tests/bmc_support.sh b/external/boot-tests/bmc_support.sh
index 8f5d44c..a13bec8 100644
--- a/external/boot-tests/bmc_support.sh
+++ b/external/boot-tests/bmc_support.sh
@@ -79,6 +79,9 @@ function flash {
 		$SSHCMD "$PFLASH_BINARY -E -f -p /tmp/image.pnor"
 		if [ "$?" -ne "0" ] ; then
 			error "An unexpected pflash error has occurred";
+		elif [ $removelid -eq 1 ] ; then
+			msg "Removing /tpm/image.pnor"
+			$SSHCMD "rm -f /tmp/image.pnor"
 		fi
 	fi
 
@@ -87,6 +90,9 @@ function flash {
 		$SSHCMD "$PFLASH_BINARY -e -f -P PAYLOAD -p /tmp/skiboot.lid"
 		if [ "$?" -ne "0" ] ; then
                         error "An unexpected pflash error has occurred";
+		elif [ $removelid -eq 1 ] ; then
+			msg "Removing /tpm/skiboot.lid"
+			$SSHCMD "rm -f /tmp/skiboot.lid"
                 fi
 	fi
 
@@ -95,15 +101,20 @@ function flash {
                 $SSHCMD "$PFLASH_BINARY -e -f -P BOOTKERNEL -p /tmp/bootkernel"
                 if [ "$?" -ne "0" ] ; then
                         error "An unexpected pflash error has occurred";
+		elif [ $removelid -eq 1 ] ; then
+			msg "Removing /tmp/bootkernel"
+			$SSHCMD "rm -f /tmp/bootkernel"
                 fi
         fi
 
 	if [ ! -z "${LID[2]}" -a ! -z "$partition" ] ; then
 		msg "Flashing $partition PNOR partition"
-		msg "$SSHCMD $PFLASH_BINARY -e -f -P $partition -p /tmp/$(basename ${LID[2]})"
 		$SSHCMD "$PFLASH_BINARY -e -f -P $partition -p /tmp/$(basename ${LID[2]})"
                 if [ "$?" -ne "0" ] ; then
                         error "An unexpected pflash error has occurred";
+		elif [ $removelid -eq 1 ] ; then
+			msg "Removing /tmp/$(basename ${LID[2]})"
+			$SSHCMD "rm -f /tmp/$(basename ${LID[2]})"
 		fi
 	fi
 
diff --git a/external/boot-tests/boot_test.sh b/external/boot-tests/boot_test.sh
index d20aea8..e622ae9 100755
--- a/external/boot-tests/boot_test.sh
+++ b/external/boot-tests/boot_test.sh
@@ -136,9 +136,9 @@ There are three usage modes.
      Boot test the target without flashing. Specify the type of machine
      (FSP or BMC) with the -b option.
 
-3) boot_test.sh [-vdp] -b bmc -t target -P pnor [-f]
-   boot_test.sh [-vdp] -b bmc -t target [-1 PAYLOAD] [-2 BOOTKERNEL] [-f]
-   boot_test.sh [-vdp] -b bmc -t target [-3 lid3 -e eyecatch] [-f]
+3) boot_test.sh [-vdp] -b bmc -t target -P pnor [-fr]
+   boot_test.sh [-vdp] -b bmc -t target [-1 PAYLOAD] [-2 BOOTKERNEL] [-fr]
+   boot_test.sh [-vdp] -b bmc -t target [-3 lid3 -e eyecatch] [-fr]
    boot_test.sh [-vdp] -b fsp -t target [-1 lid1] [-2 lid2] [-3 lid3]
 
      Flash the given firmware before boot testing.
@@ -165,6 +165,8 @@ Common Options:
 
   -f flash only. Will not boot the machine.
 
+  -r removes the lid from BMC just after it is flashed.
+
   -b BMC type (bmc or fsp).
 
   -k keep logs on failure.
@@ -187,6 +189,7 @@ done
 V=0;
 bootonly=0;
 flashonly=0;
+removelid=0;
 powerdown=0;
 firmware_supplied=0;
 target=""
@@ -198,7 +201,7 @@ LID[1]=""
 LID[2]=""
 keep_log_success=0
 keep_log_failure=0
-while getopts "kKhvdpB1:2:3:P:t:b:e:f" OPT; do
+while getopts "kKhvdpB1:2:3:P:t:b:e:fr" OPT; do
     case "$OPT" in
 	v)
 	    V=1;
@@ -228,6 +231,11 @@ while getopts "kKhvdpB1:2:3:P:t:b:e:f" OPT; do
 		    error "Firmware not supplied."
 	    fi
 	    ;;
+	r)  removelid=1;
+	    if [ $firmware_supplied -eq 0 ] ; then
+		    error "Firmware not supplied."
+	    fi
+	    ;;
 	p)
 	    powerdown=1;
 	    ;;
-- 
1.9.1



More information about the Skiboot mailing list