From nobody Sat Feb 7 08:58:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+40261+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40261+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557376280; cv=none; d=zoho.com; s=zohoarc; b=ffvvDzSTmQx7eRxFZqFe+3eJ/9c6t9Ar4FwOoFtdimiLLFxOYwqGixcDJ6Prem1KGeqbQwtTaVXBH4oyBMVzqABBGaSL2haUNSDWNEz2vQzuEjJM4+8l8pS4/zqbclvjogDxiOAbsPshzQu1V2lVfqSpVAR61drwR9NmzgGTYKo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557376280; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=FEYXi6sg75zfUmgj8HSgSmRV8FbwkYnD3VHc0f17ZfM=; b=nvw39BVE1fK1vaIDVoORKpYiLR59UBtXbqU2e9CaJECJK1iaT2LPe7N963Qv4AsaZAObdqPyvdbQISYnT+/L3pWVba11JnA5yrPjedd0B7Rv1fsoosLKzxUMCUOBDM3YblPZ3XDxMhppyQFYlto2syhiKHFo9kXs5heVSfXu2OE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40261+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1557376280557600.0893908609315; Wed, 8 May 2019 21:31:20 -0700 (PDT) Return-Path: X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Wed, 08 May 2019 21:31:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2019 21:31:17 -0700 X-ExtLoop1: 1 X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 08 May 2019 21:31:17 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Zailiang Sun , Yi Qian Subject: [edk2-devel] [Patch 15/16] Vlv2TbltDevicePkg/Capsule: Add Linux/LVFS generation scripts Date: Wed, 8 May 2019 21:31:10 -0700 Message-Id: <20190509043111.15272-16-michael.d.kinney@intel.com> In-Reply-To: <20190509043111.15272-1-michael.d.kinney@intel.com> References: <20190509043111.15272-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1557376280; bh=SHRyPUXg+tiwHW4JDEV+rKpoq6wcjO1PY/7rERB/fgk=; h=Cc:Date:From:Reply-To:Subject:To; b=eW+VWFnRjIv5gZW95Tvl9xJP+V0Aq2dl6Rqqf9LcNhqx9cYye3Wl0rnsZp3kvRm31rT jHLPwnBK0xIT0FXhZpgr1a6JNyulyH6p8YNEO/7QOACJF7Fxc7JeKTwlLdy89/FRN+oEP ZhhobO2QXJ+LUMHIK9jNUmMSTm92sFtC27U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add batch scripts to generate the LVFS compatible capsule update driver. Add DSC/FDF files to build capsules and invoke post build shell scripts for Linux build environments. Make versions consistent. Cc: Zailiang Sun Cc: Yi Qian Signed-off-by: Michael D Kinney Reviewed-by: Zailiang Sun --- .../Capsule/GenerateCapsule/GenCapsuleAll.bat | 12 +- .../Capsule/GenerateCapsule/GenCapsuleAll.sh | 28 ++++ .../GenerateCapsule/GenCapsuleMinnowMax.bat | 4 +- .../GenerateCapsule/GenCapsuleMinnowMax.sh | 65 ++++++++ .../GenCapsuleMinnowMaxRelease.bat | 4 +- .../GenCapsuleMinnowMaxRelease.sh | 65 ++++++++ .../GenerateCapsule/GenCapsuleSampleColor.sh | 70 +++++++++ .../Feature/Capsule/GenerateCapsule/Lvfs.ddf | 14 ++ .../LvfsGenCapsuleMinnowMax.bat | 139 +++++++++++++++++ .../LvfsGenCapsuleMinnowMaxRelease.bat | 139 +++++++++++++++++ .../LvfsGenCapsuleSampleColor.bat | 145 ++++++++++++++++++ .../GenerateCapsule/template.metainfo.xml | 27 ++++ Vlv2TbltDevicePkg/PlatformCapsuleGcc.dsc | 38 +++++ 13 files changed, 743 insertions(+), 7 deletions(-) create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCa= psuleAll.sh create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCa= psuleMinnowMax.sh create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCa= psuleMinnowMaxRelease.sh create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCa= psuleSampleColor.sh create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.= ddf create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsG= enCapsuleMinnowMax.bat create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsG= enCapsuleMinnowMaxRelease.bat create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsG= enCapsuleSampleColor.bat create mode 100644 Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/templ= ate.metainfo.xml create mode 100644 Vlv2TbltDevicePkg/PlatformCapsuleGcc.dsc diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAl= l.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat index 187797e284..8f589565fa 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat @@ -24,6 +24,12 @@ copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x= 86\X64\CapsuleApp.efi %W =20 call GenCapsuleMinnowMax.bat call GenCapsuleMinnowMaxRelease.bat -call GenCapsuleSampleColor.bat Blue 149DA854-7D19-4FAA-A91E-862EA1324BE6 -call GenCapsuleSampleColor.bat Green 79179BFD-704D-4C90-9E02-0AB8D968C18A -call GenCapsuleSampleColor.bat Red 72E2945A-00DA-448E-9AA7-075AD840F9D4 +call GenCapsuleSampleColor.bat Blue 149da854-7d19-4faa-a91e-862ea1324be6 +call GenCapsuleSampleColor.bat Green 79179bfd-704d-4c90-9e02-0ab8d968c18a +call GenCapsuleSampleColor.bat Red 72e2945a-00da-448e-9aa7-075ad840f9d4 + +call LvfsGenCapsuleMinnowMax.bat +call LvfsGenCapsuleMinnowMaxRelease.bat +call LvfsGenCapsuleSampleColor.bat Blue 149da854-7d19-4faa-a91e-862ea1324= be6 +call LvfsGenCapsuleSampleColor.bat Green 79179bfd-704d-4c90-9e02-0ab8d968c= 18a +call LvfsGenCapsuleSampleColor.bat Red 72e2945a-00da-448e-9aa7-075ad840f= 9d4 diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAl= l.sh b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh new file mode 100644 index 0000000000..040024553a --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh @@ -0,0 +1,28 @@ +# @file +# Linux script file to generate UEFI capsules for system firmware and +# firmware for sample devices +# +# Copyright (c) 2018, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +cd $(dirname $0) + +rm -R $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules +mkdir $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules +mkdir $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/SampleDevelopment +mkdir $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert +mkdir $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/DEBUG_GCC49/X64/CapsuleApp.efi $WORK= SPACE/Build/Vlv2TbltDevicePkg/Capsules/SampleDevelopment/CapsuleApp.efi +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/RELEASE_GCC49/X64/CapsuleApp.efi $WO= RKSPACE/Build/Vlv2TbltDevicePkg/Capsules/SampleDevelopment/CapsuleAppReleas= e.efi +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/DEBUG_GCC49/X64/CapsuleApp.efi $WORK= SPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert/CapsuleApp.efi +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/RELEASE_GCC49/X64/CapsuleApp.efi $WO= RKSPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert/CapsuleAppRelease.efi +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/DEBUG_GCC49/X64/CapsuleApp.efi $WORK= SPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert/CapsuleApp.efi +cp $WORKSPACE/Build/Vlv2TbltDevicePkg/RELEASE_GCC49/X64/CapsuleApp.efi $WO= RKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert/CapsuleAppRelease.efi + +. GenCapsuleMinnowMax.sh +. GenCapsuleMinnowMaxRelease.sh +. GenCapsuleSampleColor.sh Blue 149DA854-7D19-4FAA-A91E-862EA1324BE6 +. GenCapsuleSampleColor.sh Green 79179BFD-704D-4C90-9E02-0AB8D968C18A +. GenCapsuleSampleColor.sh Red 72E2945A-00DA-448E-9AA7-075AD840F9D4 diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMi= nnowMax.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleM= innowMax.bat index 50ebb160ee..6e4afd201e 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= .bat +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= .bat @@ -11,8 +11,8 @@ setlocal set FMP_CAPSULE_VENDOR=3DIntel set FMP_CAPSULE_GUID=3D4096267B-DA0A-42EB-B5EB-FEF31D207CB4 set FMP_CAPSULE_FILE=3DMinnowMax.cap -set FMP_CAPSULE_VERSION=3D0x00000009 -set FMP_CAPSULE_STRING=3D0.0.0.9 +set FMP_CAPSULE_VERSION=3D0x0000000C +set FMP_CAPSULE_STRING=3D0.0.0.12 set FMP_CAPSULE_NAME=3D"Intel MinnowMax DEBUG UEFI %FMP_CAPSULE_STRING%" set FMP_CAPSULE_LSV=3D0x00000000 set FMP_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMi= nnowMax.sh b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMi= nnowMax.sh new file mode 100644 index 0000000000..4fb963c93c --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= .sh @@ -0,0 +1,65 @@ +# @file +# Linux script file to generate UEFI capsules for system firmware +# +# Copyright (c) 2018, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +FMP_CAPSULE_VENDOR=3DIntel +FMP_CAPSULE_GUID=3D4096267B-DA0A-42EB-B5EB-FEF31D207CB4 +FMP_CAPSULE_FILE=3DMinnowMax.cap +FMP_CAPSULE_VERSION=3D0x0000000C +FMP_CAPSULE_STRING=3D0.0.0.12 +FMP_CAPSULE_NAME=3D"Intel MinnowMax DEBUG UEFI $FMP_CAPSULE_STRING" +FMP_CAPSULE_LSV=3D0x00000000 +FMP_CAPSULE_PAYLOAD=3D$WORKSPACE/Build/Vlv2TbltDevicePkg/DEBUG_GCC49/FV/Vl= v.ROM + +if [ ! -e "$FMP_CAPSULE_PAYLOAD" ] ; then + return +fi + +if [ -e NewCert.pem ]; then + # + # Sign capsule using OpenSSL with a new certificate + # + GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3DNewCert.pem \ + --other-public-cert=3DNewSub.pub.pem \ + --trusted-public-cert=3DNewRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + + cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert + + rm $FMP_CAPSULE_FILE +fi + +# +# Sign capsule using OpenSSL with EDK II Test Certificate +# +GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestCert.pem \ + --other-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/= TestSub.pub.pem \ + --trusted-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + +cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert + +rm $FMP_CAPSULE_FILE + diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMi= nnowMaxRelease.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenC= apsuleMinnowMaxRelease.bat index 9d08c86717..43c609e4b2 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= Release.bat +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= Release.bat @@ -11,8 +11,8 @@ setlocal set FMP_CAPSULE_VENDOR=3DIntel set FMP_CAPSULE_GUID=3D4096267B-DA0A-42EB-B5EB-FEF31D207CB4 set FMP_CAPSULE_FILE=3DMinnowMaxRelease.cap -set FMP_CAPSULE_VERSION=3D0x00000009 -set FMP_CAPSULE_STRING=3D0.0.0.9 +set FMP_CAPSULE_VERSION=3D0x0000000C +set FMP_CAPSULE_STRING=3D0.0.0.12 set FMP_CAPSULE_NAME=3D"Intel MinnowMax RELEASE UEFI %FMP_CAPSULE_STRING%" set FMP_CAPSULE_LSV=3D0x00000000 set FMP_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMi= nnowMaxRelease.sh b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCa= psuleMinnowMaxRelease.sh new file mode 100644 index 0000000000..29d46dad1e --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax= Release.sh @@ -0,0 +1,65 @@ +# @file +# Linux script file to generate UEFI capsules for system firmware +# +# Copyright (c) 2018, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +FMP_CAPSULE_VENDOR=3DIntel +FMP_CAPSULE_GUID=3D4096267B-DA0A-42EB-B5EB-FEF31D207CB4 +FMP_CAPSULE_FILE=3DMinnowMaxRelease.cap +FMP_CAPSULE_VERSION=3D0x0000000C +FMP_CAPSULE_STRING=3D0.0.0.12 +FMP_CAPSULE_NAME=3D"Intel MinnowMax RELEASE UEFI $FMP_CAPSULE_STRING" +FMP_CAPSULE_LSV=3D0x00000000 +FMP_CAPSULE_PAYLOAD=3D$WORKSPACE/Build/Vlv2TbltDevicePkg/RELEASE_GCC49/FV/= Vlv.ROM + +if [ ! -e "$FMP_CAPSULE_PAYLOAD" ] ; then + return +fi + +if [ -e NewCert.pem ]; then + # + # Sign capsule using OpenSSL with a new certificate + # + GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3DNewCert.pem \ + --other-public-cert=3DNewSub.pub.pem \ + --trusted-public-cert=3DNewRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + + cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert + + rm $FMP_CAPSULE_FILE +fi + +# +# Sign capsule using OpenSSL with EDK II Test Certificate +# +GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestCert.pem \ + --other-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/= TestSub.pub.pem \ + --trusted-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + +cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert + +rm $FMP_CAPSULE_FILE + diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSa= mpleColor.sh b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsule= SampleColor.sh new file mode 100644 index 0000000000..a1c6f28cde --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleCol= or.sh @@ -0,0 +1,70 @@ +# @file +# Linux script file to generate UEFI capsules for a sample device +# +# Copyright (c) 2018, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +COLOR=3D$1 + +FMP_CAPSULE_VENDOR=3DIntel +FMP_CAPSULE_GUID=3D$2 +FMP_CAPSULE_FILE=3D$COLOR.cap +FMP_CAPSULE_VERSION=3D0x00000010 +FMP_CAPSULE_STRING=3D0.0.0.16 +FMP_CAPSULE_NAME=3D"$COLOR Progress Bar $FMP_CAPSULE_STRING" +FMP_CAPSULE_LSV=3D0x00000000 +FMP_CAPSULE_PAYLOAD=3DPayload.bin + +echo "$COLOR Progress Bar" > $FMP_CAPSULE_PAYLOAD + +if [ ! -e "$FMP_CAPSULE_PAYLOAD" ] ; then + return +fi + +if [ -e NewCert.pem ]; then + # + # Sign capsule using OpenSSL with a new certificate + # + GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3DNewCert.pem \ + --other-public-cert=3DNewSub.pub.pem \ + --trusted-public-cert=3DNewRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + + cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/NewCert + + rm $FMP_CAPSULE_FILE +fi + +# +# Sign capsule using OpenSSL with EDK II Test Certificate +# +GenerateCapsule \ + --encode \ + -v \ + --guid $FMP_CAPSULE_GUID \ + --fw-version $FMP_CAPSULE_VERSION \ + --lsv $FMP_CAPSULE_LSV \ + --capflag PersistAcrossReset \ + --capflag InitiateReset \ + --signer-private-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestCert.pem \ + --other-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/= TestSub.pub.pem \ + --trusted-public-cert=3D$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sig= n/TestRoot.pub.pem \ + -o $FMP_CAPSULE_FILE \ + $FMP_CAPSULE_PAYLOAD + +cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert + +rm $FMP_CAPSULE_FILE + +rm $FMP_CAPSULE_PAYLOAD diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf b/V= lv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf new file mode 100644 index 0000000000..f2c925a6dd --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf @@ -0,0 +1,14 @@ +.OPTION EXPLICIT ; Generate errors on variable typos + +.Set CabinetNameTemplate=3Dfirmware.cab ; The name of the file +.set DiskDirectoryTemplate=3DCDROM ; All cabinets go in a single directory +.Set Cabinet=3Don ; +.Set Compress=3Don ; +.Set DiskDirectory1=3D. +.Set MaxDiskSize=3D99999744 ; multiple of 512 + +;*** Files to zip ; +; +firmware.bin +firmware.metainfo.xml +;*** diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsu= leMinnowMax.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGen= CapsuleMinnowMax.bat new file mode 100644 index 0000000000..dd8274a1cc --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinno= wMax.bat @@ -0,0 +1,139 @@ +@REM @file +@REM Windows batch file to generate UEFI capsules for system firmware +@REM +@REM Copyright (c) 2018, Intel Corporation. All rights reserved.
+@REM +@REM SPDX-License-Identifier: BSD-2-Clause-Patent +@REM + +@echo off +setlocal + +set FMP_CAPSULE_VENDOR=3DIntel +set FMP_CAPSULE_GUID=3D4096267b-da0a-42eb-b5eb-fef31d207cb4 +set FMP_CAPSULE_BASE_NAME=3DMinnowMax +set FMP_CAPSULE_FILE=3D%FMP_CAPSULE_BASE_NAME%.cap +set FMP_CAPSULE_VERSION=3D0x0000000C +set FMP_CAPSULE_VERSION_DECIMAL=3D12 +set FMP_CAPSULE_STRING=3D0.0.0.12 +set FMP_CAPSULE_NAME=3D"Intel %FMP_CAPSULE_BASE_NAME% DEBUG UEFI %FMP_CAPS= ULE_STRING%" +set FMP_CAPSULE_LSV=3D0x00000000 +set FMP_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx +set FMP_CAPSULE_PAYLOAD=3D%WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015= x86\FV\Vlv.ROM +set WINDOWS_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx + +if not exist "%FMP_CAPSULE_PAYLOAD%" exit /b + +if exist "%FMP_CAPSULE_KEY%" ( + REM + REM Sign capsule using signtool + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signing-tool-path=3D"c:\Program Files (x86)\Windows Kits\8.1\bin\x86= " ^ + --pfx-file %FMP_CAPSULE_KEY% ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\Sam= pleDevelopment + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +if exist "NewCert.pem" ( + REM + REM Sign capsule using OpenSSL with a new certificate + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3DNewCert.pem ^ + --other-public-cert=3DNewSub.pub.pem ^ + --trusted-public-cert=3DNewRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\New= Cert + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +REM +REM Sign capsule using OpenSSL with EDK II Test Certificate +REM +call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestCert.pem ^ + --other-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign= \TestSub.pub.pem ^ + --trusted-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + +copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestC= ert + +copy %FMP_CAPSULE_FILE% firmware.bin +copy template.metainfo.xml firmware.metainfo.xml +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GUID= ', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BASE= _NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encodin= g ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERS= ION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.= xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRI= NG', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCI= I" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DATE= ', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" +makecab /f Lvfs.ddf +copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\%F= MP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + +erase firmware.cab +erase setup.inf +erase setup.rpt + +erase firmware.metainfo.xml +erase firmware.bin +erase %FMP_CAPSULE_FILE% diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsu= leMinnowMaxRelease.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/= LvfsGenCapsuleMinnowMaxRelease.bat new file mode 100644 index 0000000000..2b68a98f98 --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinno= wMaxRelease.bat @@ -0,0 +1,139 @@ +@REM @file +@REM Windows batch file to generate UEFI capsules for system firmware +@REM +@REM Copyright (c) 2018, Intel Corporation. All rights reserved.
+@REM +@REM SPDX-License-Identifier: BSD-2-Clause-Patent +@REM + +@echo off +setlocal + +set FMP_CAPSULE_VENDOR=3DIntel +set FMP_CAPSULE_GUID=3D4096267b-da0a-42eb-b5eb-fef31d207cb4 +set FMP_CAPSULE_BASE_NAME=3DMinnowMaxRelease +set FMP_CAPSULE_FILE=3D%FMP_CAPSULE_BASE_NAME%.cap +set FMP_CAPSULE_VERSION=3D0x0000000C +set FMP_CAPSULE_VERSION_DECIMAL=3D12 +set FMP_CAPSULE_STRING=3D0.0.0.12 +set FMP_CAPSULE_NAME=3D"Intel %FMP_CAPSULE_BASE_NAME% RELEASE UEFI %FMP_CA= PSULE_STRING%" +set FMP_CAPSULE_LSV=3D0x00000000 +set FMP_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx +set FMP_CAPSULE_PAYLOAD=3D%WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS20= 15x86\FV\Vlv.ROM +set WINDOWS_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx + +if not exist "%FMP_CAPSULE_PAYLOAD%" exit /b + +if exist "%FMP_CAPSULE_KEY%" ( + REM + REM Sign capsule using signtool + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signing-tool-path=3D"c:\Program Files (x86)\Windows Kits\8.1\bin\x86= " ^ + --pfx-file %FMP_CAPSULE_KEY% ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\Sam= pleDevelopment + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +if exist "NewCert.pem" ( + REM + REM Sign capsule using OpenSSL with a new certificate + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3DNewCert.pem ^ + --other-public-cert=3DNewSub.pub.pem ^ + --trusted-public-cert=3DNewRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\New= Cert + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +REM +REM Sign capsule using OpenSSL with EDK II Test Certificate +REM +call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestCert.pem ^ + --other-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign= \TestSub.pub.pem ^ + --trusted-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + +copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestC= ert + +copy %FMP_CAPSULE_FILE% firmware.bin +copy template.metainfo.xml firmware.metainfo.xml +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GUID= ', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BASE= _NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encodin= g ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERS= ION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.= xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRI= NG', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCI= I" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DATE= ', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" +makecab /f Lvfs.ddf +copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\%F= MP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + +erase firmware.cab +erase setup.inf +erase setup.rpt + +erase firmware.metainfo.xml +erase firmware.bin +erase %FMP_CAPSULE_FILE% diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsu= leSampleColor.bat b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsG= enCapsuleSampleColor.bat new file mode 100644 index 0000000000..1dbbe7341d --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleSampl= eColor.bat @@ -0,0 +1,145 @@ +@REM @file +@REM Windows batch file to generate UEFI capsules for a sample device +@REM +@REM Copyright (c) 2018, Intel Corporation. All rights reserved.
+@REM +@REM SPDX-License-Identifier: BSD-2-Clause-Patent +@REM + +@echo off +setlocal + +set COLOR=3D%1 + +set FMP_CAPSULE_VENDOR=3DIntel +set FMP_CAPSULE_GUID=3D%2 +set FMP_CAPSULE_BASE_NAME=3D%COLOR% +set FMP_CAPSULE_FILE=3D%FMP_CAPSULE_BASE_NAME%.cap +set FMP_CAPSULE_VERSION=3D0x00000010 +set FMP_CAPSULE_VERSION_DECIMAL=3D16 +set FMP_CAPSULE_STRING=3D0.0.0.16 +set FMP_CAPSULE_NAME=3D"%FMP_CAPSULE_BASE_NAME% Progress Bar %FMP_CAPSULE_= STRING%" +set FMP_CAPSULE_LSV=3D0x00000000 +set FMP_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx +set FMP_CAPSULE_PAYLOAD=3DPayload.bin +set WINDOWS_CAPSULE_KEY=3DSAMPLE_DEVELOPMENT.pfx + +echo "%COLOR% Progress Bar" > %FMP_CAPSULE_PAYLOAD% + +if not exist "%FMP_CAPSULE_PAYLOAD%" exit + +if exist "%FMP_CAPSULE_KEY%" ( + REM + REM Sign capsule using signtool + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signing-tool-path=3D"c:\Program Files (x86)\Windows Kits\8.1\bin\x86= " ^ + --pfx-file %FMP_CAPSULE_KEY% ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\Sam= pleDevelopment + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +if exist "NewCert.pem" ( + REM + REM Sign capsule using OpenSSL with a new certificate + REM + call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3DNewCert.pem ^ + --other-public-cert=3DNewSub.pub.pem ^ + --trusted-public-cert=3DNewRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + + copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\New= Cert + + copy %FMP_CAPSULE_FILE% firmware.bin + copy template.metainfo.xml firmware.metainfo.xml + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GU= ID', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BA= SE_NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encod= ing ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VE= RSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainf= o.xml -encoding ASCII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_ST= RING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding AS= CII" + powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DA= TE', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" + makecab /f Lvfs.ddf + copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\= %FMP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + + erase firmware.cab + erase setup.inf + erase setup.rpt + + erase firmware.metainfo.xml + erase firmware.bin + erase %FMP_CAPSULE_FILE% +) + +REM +REM Sign capsule using OpenSSL with EDK II Test Certificate +REM +call GenerateCapsule ^ + --encode ^ + -v ^ + --guid %FMP_CAPSULE_GUID% ^ + --fw-version %FMP_CAPSULE_VERSION% ^ + --lsv %FMP_CAPSULE_LSV% ^ + --capflag PersistAcrossReset ^ + --capflag InitiateReset ^ + --signer-private-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestCert.pem ^ + --other-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign= \TestSub.pub.pem ^ + --trusted-public-cert=3D%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Si= gn\TestRoot.pub.pem ^ + -o %FMP_CAPSULE_FILE% ^ + %FMP_CAPSULE_PAYLOAD% + +copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestC= ert + +copy %FMP_CAPSULE_FILE% firmware.bin +copy template.metainfo.xml firmware.metainfo.xml +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_GUID= ', '%FMP_CAPSULE_GUID%' | Out-File firmware.metainfo.xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_BASE= _NAME', '%FMP_CAPSULE_BASE_NAME%' | Out-File firmware.metainfo.xml -encodin= g ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERS= ION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.= xml -encoding ASCII" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRI= NG', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCI= I" +powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_DATE= ', '%date%' | Out-File firmware.metainfo.xml -encoding ASCII" +makecab /f Lvfs.ddf +copy firmware.cab %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\%F= MP_CAPSULE_BASE_NAME%-%FMP_CAPSULE_STRING%.cab + +erase firmware.cab +erase setup.inf +erase setup.rpt + +erase firmware.metainfo.xml +erase firmware.bin +erase %FMP_CAPSULE_FILE% + +erase %FMP_CAPSULE_PAYLOAD% diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.met= ainfo.xml b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.meta= info.xml new file mode 100644 index 0000000000..5d550c1f48 --- /dev/null +++ b/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.metainfo.x= ml @@ -0,0 +1,27 @@ + + + com.intel.FMP_CAPSULE_BASE_NAME.firmware + FMP_CAPSULE_BASE_NAME + System firmware for the FMP_CAPSULE_BASE_NAME + + Description of System firmware for the FMP_CAPSULE_BASE_NAME + + + FMP_CAPSULE_GUID + + http://www.tianocore.org + CC0-1.0 + BSD + Tianocore + + + + Build FMP_CAPSULE_STRING + + + + + + + + diff --git a/Vlv2TbltDevicePkg/PlatformCapsuleGcc.dsc b/Vlv2TbltDevicePkg/P= latformCapsuleGcc.dsc new file mode 100644 index 0000000000..1856ac349b --- /dev/null +++ b/Vlv2TbltDevicePkg/PlatformCapsuleGcc.dsc @@ -0,0 +1,38 @@ +#/** @file +# Platform capsule description. +# +# Copyright (c) 2016, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + PLATFORM_NAME =3D Vlv2TbltDevicePkg + PLATFORM_GUID =3D EE87F258-6ECC-4415-B1D8-23771BEE26E7 + PLATFORM_VERSION =3D 0.1 + FLASH_DEFINITION =3D Vlv2TbltDevicePkg/PlatformCapsuleGcc.= fdf + OUTPUT_DIRECTORY =3D Build/Vlv2TbltDevicePkg + SUPPORTED_ARCHITECTURES =3D IA32|X64 + BUILD_TARGETS =3D DEBUG|RELEASE + SKUID_IDENTIFIER =3D DEFAULT + POSTBUILD =3D Vlv2TbltDevicePkg/Feature/Capsule/Gen= erateCapsule/GenCapsuleAll.sh + +##########################################################################= ######################### +# +# Components Section - list of the modules and components that will be pro= cessed by compilation +# tools and the EDK II tools to generate PE32/PE32+/C= off image files. +# +# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed +# into firmware volume images. This section is just a list of module= s to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary f= iles into firmware +# volume images, whose concept is beyond UEFI and is described in PI= specification. +# Binary modules do not need to be listed in this section, as they s= hould be +# specified in the FDF file. For example: Shell binary, FAT binary (= Fat.efi), +# Logo (Logo.bmp), and etc. +# There may also be modules listed in this section that are not requ= ired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be +# generated for it, but the binary will not be put into any firmware= volume. +# +##########################################################################= ######################### --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#40261): https://edk2.groups.io/g/devel/message/40261 Mute This Topic: https://groups.io/mt/31551784/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-