From patchwork Mon Oct 10 08:44:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 680260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ssv1m32Hgz9s9c for ; Mon, 10 Oct 2016 19:49:16 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ssv1m24S2zDsml for ; Mon, 10 Oct 2016 19:49:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sstwW5qXXzDsff for ; Mon, 10 Oct 2016 19:44:43 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9A8WUsI120918 for ; Mon, 10 Oct 2016 04:44:41 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2606wutg7u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Oct 2016 04:44:41 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Oct 2016 02:44:40 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Oct 2016 02:44:37 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 57A743E4003E for ; Mon, 10 Oct 2016 02:44:37 -0600 (MDT) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9A8ibgt16449824; Mon, 10 Oct 2016 01:44:37 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22F016A043; Mon, 10 Oct 2016 02:44:37 -0600 (MDT) Received: from birb.localdomain (unknown [9.81.212.138]) by b03ledav003.gho.boulder.ibm.com (Postfix) with SMTP id EDE6C6A03B; Mon, 10 Oct 2016 02:44:35 -0600 (MDT) Received: by birb.localdomain (Postfix, from userid 1000) id 920482335211; Mon, 10 Oct 2016 19:44:25 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org, cclaudio@linux.vnet.ibm.com Date: Mon, 10 Oct 2016 19:44:15 +1100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1476089061-15197-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101008-0008-0000-0000-000005C5F5CD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005885; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00766373; UDB=6.00366537; IPR=6.00542488; BA=6.00004798; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012933; XFM=3.00000011; UTC=2016-10-10 08:44:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101008-0009-0000-0000-00003C015B9C Message-Id: <1476089061-15197-35-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-10_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610100142 Subject: [Skiboot] [PATCH 34/40] external/boot_tests: add arbitrary lid option -F X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Claudio Carvalho 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 Signed-off-by: Stewart Smith --- external/boot-tests/bmc_support.sh | 14 +++++++++++++- 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; ;;