Convert all the BAT/sh files used to generate capsules to OS independent Python script.
Cc: Zailiang Sun <zailiang....@intel.com> Cc: Yi Qian <yi.q...@intel.com> Cc: Gary Lin <g...@suse.com> Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com> --- .../Capsule/GenerateCapsule/GenCapsuleAll.bat | 35 -- .../Capsule/GenerateCapsule/GenCapsuleAll.py | 397 ++++++++++++++++++ .../Capsule/GenerateCapsule/GenCapsuleAll.sh | 33 -- .../GenerateCapsule/GenCapsuleMinnowMax.bat | 131 ------ .../GenerateCapsule/GenCapsuleMinnowMax.sh | 59 --- .../GenCapsuleMinnowMaxRelease.bat | 131 ------ .../GenCapsuleMinnowMaxRelease.sh | 64 --- .../GenerateCapsule/GenCapsuleSampleColor.bat | 137 ------ .../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/PlatformCapsuleIA32.dsc | 2 +- .../Vlv2TbltDevicePkg/PlatformCapsuleX64.dsc | 2 +- 16 files changed, 399 insertions(+), 1126 deletions(-) delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat create mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py delete mode 100755 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.sh delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.sh delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.sh delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMax.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMaxRelease.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleSampleColor.bat delete mode 100644 Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.metainfo.xml diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat deleted file mode 100644 index 8f589565fa..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat +++ /dev/null @@ -1,35 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for system firmware and -@REM firmware for sample devices -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal -cd /d %~dp0 - -rmdir /s /q %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 -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\SampleDevelopment\CapsuleApp.efi -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\SampleDevelopment\CapsuleAppRelease.efi -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert\CapsuleApp.efi -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert\CapsuleAppRelease.efi -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\CapsuleApp.efi -copy %WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x86\X64\CapsuleApp.efi %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\CapsuleAppRelease.efi - -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 LvfsGenCapsuleMinnowMax.bat -call LvfsGenCapsuleMinnowMaxRelease.bat -call LvfsGenCapsuleSampleColor.bat Blue 149da854-7d19-4faa-a91e-862ea1324be6 -call LvfsGenCapsuleSampleColor.bat Green 79179bfd-704d-4c90-9e02-0ab8d968c18a -call LvfsGenCapsuleSampleColor.bat Red 72e2945a-00da-448e-9aa7-075ad840f9d4 diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py new file mode 100644 index 0000000000..b2fd65a6c6 --- /dev/null +++ b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py @@ -0,0 +1,397 @@ +## @file +# Generate capsules for Vlv2TbltDevicePkg +# openssl must be install and in path +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +''' +GenCapsuleAll +''' + +import os +import sys +import argparse +import subprocess +import glob +import shutil +import struct +import datetime + +# +# Globals for help information +# +__prog__ = 'GenCapsuleAll' +__copyright__ = 'Copyright (c) 2019, Intel Corporation. All rights reserved.' +__description__ = 'Generate Vlv2Tbl2DevicePkg capsules.\n' + +# +# Globals +# +gWorkspace = '' +gBaseToolsPath = '' +gArgs = None + +def LogAlways(Message): + sys.stdout.write (__prog__ + ': ' + Message + '\n') + sys.stdout.flush() + +def Log(Message): + global gArgs + if not gArgs.Verbose: + return + sys.stdout.write (__prog__ + ': ' + Message + '\n') + sys.stdout.flush() + +def Error(Message, ExitValue=1): + sys.stderr.write (__prog__ + ': ERROR: ' + Message + '\n') + sys.exit (ExitValue) + +def RelativePath(target): + global gWorkspace + Log('RelativePath' + target) + return os.path.relpath (target, gWorkspace) + +def NormalizePath(target): + if isinstance(target, tuple): + return os.path.normpath (os.path.join (*target)) + else: + return os.path.normpath (target) + +def RemoveFile(target): + target = NormalizePath(target) + if not target or target == os.pathsep: + Error ('RemoveFile() invalid target') + if os.path.exists(target): + os.remove (target) + Log ('remove %s' % (RelativePath (target))) + +def RemoveDirectory(target): + target = NormalizePath(target) + if not target or target == os.pathsep: + Error ('RemoveDirectory() invalid target') + if os.path.exists(target): + Log ('rmdir %s' % (RelativePath (target))) + shutil.rmtree(target) + +def CreateDirectory(target): + target = NormalizePath(target) + if not os.path.exists(target): + Log ('mkdir %s' % (RelativePath (target))) + os.makedirs (target) + +def Copy(src, dst): + src = NormalizePath(src) + dst = NormalizePath(dst) + for File in glob.glob(src): + Log ('copy %s -> %s' % (RelativePath (File), RelativePath (dst))) + shutil.copy (File, dst) + +GenerateCapsuleCommand = ''' +GenerateCapsule +--encode +--guid {FMP_CAPSULE_GUID} +--fw-version {FMP_CAPSULE_VERSION} +--lsv {FMP_CAPSULE_LSV} +--capflag PersistAcrossReset +--capflag InitiateReset +--signer-private-cert={BASE_TOOLS_PATH}/Source/Python/Pkcs7Sign/TestCert.pem +--other-public-cert={BASE_TOOLS_PATH}/Source/Python/Pkcs7Sign/TestSub.pub.pem +--trusted-public-cert={BASE_TOOLS_PATH}/Source/Python/Pkcs7Sign/TestRoot.pub.pem +-o {FMP_CAPSULE_FILE} +{FMP_CAPSULE_PAYLOAD} +''' +MetaInfoXmlTemplate = ''' +<?xml version="1.0" encoding="UTF-8"?> +<component type="firmware"> + <id>com.intel.FMP_CAPSULE_BASE_NAME.firmware</id> + <name>FMP_CAPSULE_BASE_NAME</name> + <summary>System firmware for the FMP_CAPSULE_BASE_NAME</summary> + <description> + Description of System firmware for the FMP_CAPSULE_BASE_NAME + </description> + <provides> + <firmware type="flashed">FMP_CAPSULE_GUID</firmware> + </provides> + <url type="homepage">http://www.tianocore.org</url> + <metadata_license>CC0-1.0</metadata_license> + <project_license>BSD</project_license> + <developer_name>Tianocore</developer_name> + <releases> + <release version="FMP_CAPSULE_VERSION_DECIMAL" date="FMP_CAPSULE_DATE"> + <description> + Build FMP_CAPSULE_STRING + </description> + </release> + </releases> + <!-- most OEMs do not need to do this... --> + <custom> + <value key="LVFS::InhibitDownload"/> + </custom> +</component> +''' + +LvfsDdfTemplate = ''' +.OPTION EXPLICIT ; Generate errors on variable typos + +.Set CabinetNameTemplate=firmware.cab ; The name of the file +.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory +.Set Cabinet=on ; +.Set Compress=on ; +.Set DiskDirectory1=. +.Set MaxDiskSize=99999744 ; multiple of 512 + +;*** Files to zip ; +; +firmware.bin +firmware.metainfo.xml +;*** +''' + +def GenCapsuleDevice (BaseName, PayloadFileName, Guid, Version, Lsv, CapsulesPath, CapsulesSubDir): + global gBaseToolsPath + LogAlways ('Generate Capsule: {0} {1:08x} {2:08x} {3}'.format (Guid, Version, Lsv, PayloadFileName)) + + VersionString = '.'.join([str(ord(x)) for x in struct.pack('>I', Version).decode()]) + + FmpCapsuleFile = NormalizePath ((CapsulesPath, CapsulesSubDir, BaseName + '.' + VersionString + '.cap')) + Command = GenerateCapsuleCommand.format ( + FMP_CAPSULE_GUID = Guid, + FMP_CAPSULE_VERSION = Version, + FMP_CAPSULE_LSV = Lsv, + BASE_TOOLS_PATH = gBaseToolsPath, + FMP_CAPSULE_FILE = FmpCapsuleFile, + FMP_CAPSULE_PAYLOAD = PayloadFileName + ) + Command = ' '.join(Command.splitlines()).strip() + if gArgs.Verbose: + Command = Command + ' -v' + + Log (Command) + + Process = subprocess.Popen(Command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + ProcessOutput = Process.communicate() + + if Process.returncode == 0: + Log (ProcessOutput[0].decode()) + else: + LogAlways (Command) + LogAlways (ProcessOutput[0].decode()) + Error ('GenerateCapsule returned an error') + + Copy (PayloadFileName, (CapsulesPath, 'firmware.bin')) + MetaInfoXml = MetaInfoXmlTemplate + MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_GUID', Guid) + MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_BASE_NAME', BaseName) + MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_VERSION_DECIMAL', str(Version)) + MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_STRING', VersionString) + MetaInfoXml = MetaInfoXml.replace ('FMP_CAPSULE_DATE', str(datetime.date.today())) + f = open (NormalizePath ((CapsulesPath, 'firmware.metainfo.xml')), 'w') + f.write(MetaInfoXml) + f.close() + + f = open (NormalizePath ((CapsulesPath, 'Lvfs.ddf')), 'w') + f.write(LvfsDdfTemplate) + f.close() + + if sys.platform == "win32": + Command = 'makecab /f ' + NormalizePath ((CapsulesPath, 'Lvfs.ddf')) + else: + Command = 'gcab --create firmware.cab firmware.bin firmware.metainfo.xml' + Log (Command) + + Process = subprocess.Popen(Command, cwd=CapsulesPath, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + ProcessOutput = Process.communicate() + + if Process.returncode == 0: + Log (ProcessOutput[0].decode()) + else: + LogAlways (Command) + LogAlways (ProcessOutput[0].decode()) + Error ('GenerateCapsule returned an error') + + FmpCabinetFile = NormalizePath ((CapsulesPath, CapsulesSubDir, BaseName + '.' + VersionString + '.cab')) + + Copy ((CapsulesPath, 'firmware.cab'), FmpCabinetFile) + + RemoveFile ((CapsulesPath, 'firmware.cab')) + RemoveFile ((CapsulesPath, 'setup.inf')) + RemoveFile ((CapsulesPath, 'setup.rpt')) + RemoveFile ((CapsulesPath, 'Lvfs.ddf')) + RemoveFile ((CapsulesPath, 'firmware.metainfo.xml')) + RemoveFile ((CapsulesPath, 'firmware.bin')) + +def GenCapsuleSampleDevice (SampleDeviceName, Guid, Version, Lsv, CapsulesPath, CapsulesSubDir): + BinaryPayload = SampleDeviceName.encode() + bytearray(0x18 - len (SampleDeviceName.encode())) + BinaryPayload = BinaryPayload + struct.pack('<I', Version) + BinaryPayload = BinaryPayload + struct.pack('<I', Lsv) + + PayloadFileName = NormalizePath ((CapsulesPath, SampleDeviceName + '.bin')) + f = open (PayloadFileName, 'wb') + f.write(BinaryPayload) + f.close() + + GenCapsuleDevice(SampleDeviceName, PayloadFileName, Guid, Version, Lsv, CapsulesPath, CapsulesSubDir) + + RemoveFile (PayloadFileName) + +if __name__ == '__main__': + # + # Create command line argument parser object + # + parser = argparse.ArgumentParser ( + prog = __prog__, + description = __description__ + __copyright__, + conflict_handler = 'resolve' + ) + parser.add_argument ( + '-a', '--arch', dest = 'Arch', nargs = '+', action = 'append', + required = True, + help = '''ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, + which overrides target.txt's TARGET_ARCH definition. To + specify more archs, please repeat this option.''' + ) + parser.add_argument ( + '-t', '--tagname', dest = 'ToolChain', required = True, + help = '''Using the Tool Chain Tagname to build the platform, + overriding target.txt's TOOL_CHAIN_TAG definition.''' + ) + parser.add_argument ( + '-p', '--platform', dest = 'PlatformFile', required = True, + help = '''Build the platform specified by the DSC file name argument, + overriding target.txt's ACTIVE_PLATFORM definition.''' + ) + parser.add_argument ( + '-b', '--buildtarget', dest = 'BuildTarget', required = True, + help = '''Using the TARGET to build the platform, overriding + target.txt's TARGET definition.''' + ) + parser.add_argument ( + '--conf=', dest = 'ConfDirectory', required = True, + help = '''Specify the customized Conf directory.''' + ) + parser.add_argument ( + '-D', '--define', dest = 'Define', nargs='*', action = 'append', + help = '''Macro: "Name [= Value]".''' + ) + parser.add_argument ( + '-v', '--verbose', dest = 'Verbose', action = 'store_true', + help = '''Turn on verbose output with informational messages printed''' + ) + parser.add_argument ( + '--package', dest = 'Package', nargs = '*', action = 'append', + help = '''The directory name of a package of tests to copy''' + ) + + # + # Parse command line arguments + # + gArgs, remaining = parser.parse_known_args() + gArgs.BuildType = 'all' + for BuildType in ['all', 'fds', 'genc', 'genmake', 'clean', 'cleanall', 'modules', 'libraries', 'run']: + if BuildType in remaining: + gArgs.BuildType = BuildType + remaining.remove(BuildType) + break + gArgs.Remaining = ' '.join(remaining) + + # + # Get WORKSPACE environment variable + # + try: + gWorkspace = os.environ['WORKSPACE'] + except: + Error ('WORKSPACE environment variable not set') + + # + # Get PACKAGES_PATH and generate prioritized list of paths + # + PathList = [gWorkspace] + try: + PathList += os.environ['PACKAGES_PATH'].split(os.pathsep) + except: + pass + + # + # Determine full path to BaseTools + # + for Path in PathList: + if os.path.exists (os.path.join (Path, 'BaseTools')): + gBaseToolsPath = os.path.join (Path, 'BaseTools') + break + + # + # Parse OUTPUT_DIRECTORY from DSC file + # + for Path in PathList: + if os.path.exists (os.path.join (Path, gArgs.PlatformFile)): + Dsc = open (os.path.join (Path, gArgs.PlatformFile), 'r').readlines() + break + for Line in Dsc: + if Line.strip().startswith('OUTPUT_DIRECTORY'): + OutputDirectory = Line.strip().split('=')[1].strip() + break + + # + # Determine full paths to EDK II build directory, EDK II build output + # directory and the CPU arch of the UEFI phase. + # + CommandDir = os.path.dirname(sys.argv[0]) + EdkiiBuildDir = os.path.join (gWorkspace, OutputDirectory) + EdkiiBuildOutput = os.path.join (EdkiiBuildDir, gArgs.BuildTarget + '_' + gArgs.ToolChain) + UefiArch = gArgs.Arch[0][0] + if len (gArgs.Arch) > 1: + if ['X64'] in gArgs.Arch: + UefiArch = 'X64' + + CapsulesPath = NormalizePath((EdkiiBuildDir, 'Capsules')) + + CapsulesSubDir = 'TestCert' + '_' + UefiArch + '_' + gArgs.BuildTarget + '_' + gArgs.ToolChain + + # + # Create output directories + # + try: + CreateDirectory ((CapsulesPath)) + except: + pass + try: + CreateDirectory ((CapsulesPath, CapsulesSubDir)) + except: + pass + + # + # Copy CapsuleApp + # + Copy ((EdkiiBuildOutput, UefiArch, 'CapsuleApp.efi'), (CapsulesPath, CapsulesSubDir)) + + # + # Generate capsules for the Red Sample Device + # + GenCapsuleSampleDevice('Red','72E2945A-00DA-448E-9AA7-075AD840F9D4',0x00000010,0x00000000, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Red','72E2945A-00DA-448E-9AA7-075AD840F9D4',0x00000011,0x00000000, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Red','72E2945A-00DA-448E-9AA7-075AD840F9D4',0x00000012,0x00000000, CapsulesPath, CapsulesSubDir) + + # + # Generate capsules for the Green Sample Device + # + GenCapsuleSampleDevice('Green','79179BFD-704D-4C90-9E02-0AB8D968C18A',0x00000020,0x00000020, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Green','79179BFD-704D-4C90-9E02-0AB8D968C18A',0x00000021,0x00000020, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Green','79179BFD-704D-4C90-9E02-0AB8D968C18A',0x00000022,0x00000020, CapsulesPath, CapsulesSubDir) + + # + # Generate capsules for the Blue Sample Device + # + GenCapsuleSampleDevice('Blue','149DA854-7D19-4FAA-A91E-862EA1324BE6',0x00000010,0x00000000, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Blue','149DA854-7D19-4FAA-A91E-862EA1324BE6',0x00000011,0x00000000, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Blue','149DA854-7D19-4FAA-A91E-862EA1324BE6',0x00000012,0x00000012, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Blue','149DA854-7D19-4FAA-A91E-862EA1324BE6',0x00000013,0x00000012, CapsulesPath, CapsulesSubDir) + GenCapsuleSampleDevice('Blue','149DA854-7D19-4FAA-A91E-862EA1324BE6',0x00000014,0x00000012, CapsulesPath, CapsulesSubDir) + + # + # Generate capsules for Minnow Max Firmware Updates + # + RomFileName = os.path.join (EdkiiBuildOutput, 'FV', 'VLV.fd') + GenCapsuleDevice('MinnowMax', RomFileName,'4096267B-DA0A-42EB-B5EB-FEF31D207CB4',0x0000000C,0x00000000, CapsulesPath, CapsulesSubDir) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh deleted file mode 100755 index 7b77b50c3f..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh +++ /dev/null @@ -1,33 +0,0 @@ -# @file -# Linux script file to generate UEFI capsules for system firmware and -# firmware for sample devices -# -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -cd $(dirname $0) - -EFI_DIR=$WORKSPACE/Build/Vlv2TbltDevicePkg/${TARGET}_${TOOL_CHAIN_TAG}/X64/ -CAP_DIR=$WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules -SCRIPT_DIR=$WORKSPACE/edk2-platforms/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule - -rm -rf $CAP_DIR -mkdir -p $CAP_DIR/SampleDevelopment -mkdir -p $CAP_DIR/NewCert -mkdir -p $CAP_DIR/TestCert -if [ "$TARGET" == "DEBUG" ]; then - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/SampleDevelopment/CapsuleApp.efi - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/NewCert/CapsuleApp.efi - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/TestCert/CapsuleApp.efi - . $SCRIPT_DIR/GenCapsuleMinnowMax.sh -else - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/SampleDevelopment/CapsuleAppRelease.efi - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/NewCert/CapsuleAppRelease.efi - cp $EFI_DIR/CapsuleApp.efi $CAP_DIR/TestCert/CapsuleAppRelease.efi - . $SCRIPT_DIR/GenCapsuleMinnowMaxRelease.sh -fi -. $SCRIPT_DIR/GenCapsuleSampleColor.sh Blue 149DA854-7D19-4FAA-A91E-862EA1324BE6 -. $SCRIPT_DIR/GenCapsuleSampleColor.sh Green 79179BFD-704D-4C90-9E02-0AB8D968C18A -. $SCRIPT_DIR/GenCapsuleSampleColor.sh Red 72E2945A-00DA-448E-9AA7-075AD840F9D4 diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.bat deleted file mode 100644 index 6e4afd201e..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.bat +++ /dev/null @@ -1,131 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for system firmware -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=4096267B-DA0A-42EB-B5EB-FEF31D207CB4 -set FMP_CAPSULE_FILE=MinnowMax.cap -set FMP_CAPSULE_VERSION=0x0000000C -set FMP_CAPSULE_STRING=0.0.0.12 -set FMP_CAPSULE_NAME="Intel MinnowMax DEBUG UEFI %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=%WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015x86\FV\Vlv.ROM -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\SampleDevelopment\MinnowMaxWindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert\MinnowMaxWindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\MinnowMaxWindowsCapsule - rmdir /s /q WindowsCapsule -) - -erase %FMP_CAPSULE_FILE% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.sh b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.sh deleted file mode 100644 index 114c4a3477..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMax.sh +++ /dev/null @@ -1,59 +0,0 @@ -# @file -# Linux script file to generate UEFI capsules for system firmware -# -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -FMP_CAPSULE_VENDOR=Intel -FMP_CAPSULE_GUID=4096267B-DA0A-42EB-B5EB-FEF31D207CB4 -FMP_CAPSULE_FILE=MinnowMax.cap -FMP_CAPSULE_VERSION=0x0000000C -FMP_CAPSULE_STRING=0.0.0.12 -FMP_CAPSULE_NAME="Intel MinnowMax DEBUG UEFI $FMP_CAPSULE_STRING" -FMP_CAPSULE_LSV=0x00000000 -FMP_CAPSULE_PAYLOAD=$WORKSPACE/Build/Vlv2TbltDevicePkg/DEBUG_${TOOL_CHAIN_TAG}/FV/Vlv.ROM -FMP_CAPSULE_DIR=$WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/ - -PKCS7SIGN_DIR=$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/ - -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=NewCert.pem \ - --other-public-cert=NewSub.pub.pem \ - --trusted-public-cert=NewRoot.pub.pem \ - -o $FMP_CAPSULE_DIR/NewCert/$FMP_CAPSULE_FILE \ - $FMP_CAPSULE_PAYLOAD -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=$PKCS7SIGN_DIR/TestCert.pem \ - --other-public-cert=$PKCS7SIGN_DIR/TestSub.pub.pem \ - --trusted-public-cert=$PKCS7SIGN_DIR/TestRoot.pub.pem \ - -o $FMP_CAPSULE_DIR/TestCert/$FMP_CAPSULE_FILE \ - $FMP_CAPSULE_PAYLOAD diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.bat deleted file mode 100644 index 43c609e4b2..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.bat +++ /dev/null @@ -1,131 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for system firmware -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=4096267B-DA0A-42EB-B5EB-FEF31D207CB4 -set FMP_CAPSULE_FILE=MinnowMaxRelease.cap -set FMP_CAPSULE_VERSION=0x0000000C -set FMP_CAPSULE_STRING=0.0.0.12 -set FMP_CAPSULE_NAME="Intel MinnowMax RELEASE UEFI %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=%WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x86\FV\Vlv.ROM -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\SampleDevelopment\MinnowMaxReleaseWindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert\MinnowMaxReleaseWindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\MinnowMaxReleaseWindowsCapsule - rmdir /s /q WindowsCapsule -) - -erase %FMP_CAPSULE_FILE% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.sh b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.sh deleted file mode 100644 index d2619786e8..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleMinnowMaxRelease.sh +++ /dev/null @@ -1,64 +0,0 @@ -# @file -# Linux script file to generate UEFI capsules for system firmware -# -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -FMP_CAPSULE_VENDOR=Intel -FMP_CAPSULE_GUID=4096267B-DA0A-42EB-B5EB-FEF31D207CB4 -FMP_CAPSULE_FILE=MinnowMaxRelease.cap -FMP_CAPSULE_VERSION=0x0000000C -FMP_CAPSULE_STRING=0.0.0.12 -FMP_CAPSULE_NAME="Intel MinnowMax RELEASE UEFI $FMP_CAPSULE_STRING" -FMP_CAPSULE_LSV=0x00000000 -FMP_CAPSULE_PAYLOAD=$WORKSPACE/Build/Vlv2TbltDevicePkg/RELEASE_${TOOL_CHAIN_TAG}/FV/Vlv.ROM -FMP_CAPSULE_DIR=$WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/ - -PKCS7SIGN_DIR=$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/ - -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=NewCert.pem \ - --other-public-cert=NewSub.pub.pem \ - --trusted-public-cert=NewRoot.pub.pem \ - -o $FMP_CAPSULE_DIR/NewCert/$FMP_CAPSULE_FILE \ - $FMP_CAPSULE_PAYLOAD -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=$PKCS7SIGN_DIR/TestCert.pem \ - --other-public-cert=$PKCS7SIGN_DIR/TestSub.pub.pem \ - --trusted-public-cert=$PKCS7SIGN_DIR/TestRoot.pub.pem \ - -o $FMP_CAPSULE_DIR/TestCert/$FMP_CAPSULE_FILE \ - $FMP_CAPSULE_PAYLOAD - -cp $FMP_CAPSULE_FILE $WORKSPACE/Build/Vlv2TbltDevicePkg/Capsules/TestCert - -rm $FMP_CAPSULE_FILE - diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.bat deleted file mode 100644 index 3e9f94c530..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.bat +++ /dev/null @@ -1,137 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for a sample device -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set COLOR=%1 - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=%2 -set FMP_CAPSULE_FILE=%COLOR%.cap -set FMP_CAPSULE_VERSION=0x00000010 -set FMP_CAPSULE_STRING=0.0.0.16 -set FMP_CAPSULE_NAME="%COLOR% Progress Bar %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=Payload.bin -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\SampleDevelopment\%COLOR%WindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert\%COLOR%WindowsCapsule - rmdir /s /q WindowsCapsule - ) - 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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -if exist "%WINDOWS_CAPSULE_KEY%" ( - CreateWindowsCapsule.py ^ - UEFI ^ - %FMP_CAPSULE_STRING% ^ - %FMP_CAPSULE_GUID% ^ - %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_VERSION% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_VENDOR% ^ - %FMP_CAPSULE_NAME% %WINDOWS_CAPSULE_KEY% - - xcopy /s/e/v/i/y WindowsCapsule %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert\%COLOR%WindowsCapsule - rmdir /s /q WindowsCapsule -) - -erase %FMP_CAPSULE_FILE% - -erase %FMP_CAPSULE_PAYLOAD% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.sh b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.sh deleted file mode 100644 index a1c6f28cde..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleSampleColor.sh +++ /dev/null @@ -1,70 +0,0 @@ -# @file -# Linux script file to generate UEFI capsules for a sample device -# -# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -COLOR=$1 - -FMP_CAPSULE_VENDOR=Intel -FMP_CAPSULE_GUID=$2 -FMP_CAPSULE_FILE=$COLOR.cap -FMP_CAPSULE_VERSION=0x00000010 -FMP_CAPSULE_STRING=0.0.0.16 -FMP_CAPSULE_NAME="$COLOR Progress Bar $FMP_CAPSULE_STRING" -FMP_CAPSULE_LSV=0x00000000 -FMP_CAPSULE_PAYLOAD=Payload.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=NewCert.pem \ - --other-public-cert=NewSub.pub.pem \ - --trusted-public-cert=NewRoot.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=$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/TestCert.pem \ - --other-public-cert=$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/TestSub.pub.pem \ - --trusted-public-cert=$WORKSPACE/edk2/BaseTools/Source/Python/Pkcs7Sign/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/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf deleted file mode 100644 index f2c925a6dd..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/Lvfs.ddf +++ /dev/null @@ -1,14 +0,0 @@ -.OPTION EXPLICIT ; Generate errors on variable typos - -.Set CabinetNameTemplate=firmware.cab ; The name of the file -.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory -.Set Cabinet=on ; -.Set Compress=on ; -.Set DiskDirectory1=. -.Set MaxDiskSize=99999744 ; multiple of 512 - -;*** Files to zip ; -; -firmware.bin -firmware.metainfo.xml -;*** diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMax.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMax.bat deleted file mode 100644 index dd8274a1cc..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMax.bat +++ /dev/null @@ -1,139 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for system firmware -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=4096267b-da0a-42eb-b5eb-fef31d207cb4 -set FMP_CAPSULE_BASE_NAME=MinnowMax -set FMP_CAPSULE_FILE=%FMP_CAPSULE_BASE_NAME%.cap -set FMP_CAPSULE_VERSION=0x0000000C -set FMP_CAPSULE_VERSION_DECIMAL=12 -set FMP_CAPSULE_STRING=0.0.0.12 -set FMP_CAPSULE_NAME="Intel %FMP_CAPSULE_BASE_NAME% DEBUG UEFI %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=%WORKSPACE%\Build\Vlv2TbltDevicePkg\DEBUG_VS2015x86\FV\Vlv.ROM -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -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 -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" -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\%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% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMaxRelease.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMaxRelease.bat deleted file mode 100644 index 2b68a98f98..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleMinnowMaxRelease.bat +++ /dev/null @@ -1,139 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for system firmware -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=4096267b-da0a-42eb-b5eb-fef31d207cb4 -set FMP_CAPSULE_BASE_NAME=MinnowMaxRelease -set FMP_CAPSULE_FILE=%FMP_CAPSULE_BASE_NAME%.cap -set FMP_CAPSULE_VERSION=0x0000000C -set FMP_CAPSULE_VERSION_DECIMAL=12 -set FMP_CAPSULE_STRING=0.0.0.12 -set FMP_CAPSULE_NAME="Intel %FMP_CAPSULE_BASE_NAME% RELEASE UEFI %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=%WORKSPACE%\Build\Vlv2TbltDevicePkg\RELEASE_VS2015x86\FV\Vlv.ROM -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -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 -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" -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\%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% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleSampleColor.bat b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleSampleColor.bat deleted file mode 100644 index 1dbbe7341d..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/LvfsGenCapsuleSampleColor.bat +++ /dev/null @@ -1,145 +0,0 @@ -@REM @file -@REM Windows batch file to generate UEFI capsules for a sample device -@REM -@REM Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> -@REM -@REM SPDX-License-Identifier: BSD-2-Clause-Patent -@REM - -@echo off -setlocal - -set COLOR=%1 - -set FMP_CAPSULE_VENDOR=Intel -set FMP_CAPSULE_GUID=%2 -set FMP_CAPSULE_BASE_NAME=%COLOR% -set FMP_CAPSULE_FILE=%FMP_CAPSULE_BASE_NAME%.cap -set FMP_CAPSULE_VERSION=0x00000010 -set FMP_CAPSULE_VERSION_DECIMAL=16 -set FMP_CAPSULE_STRING=0.0.0.16 -set FMP_CAPSULE_NAME="%FMP_CAPSULE_BASE_NAME% Progress Bar %FMP_CAPSULE_STRING%" -set FMP_CAPSULE_LSV=0x00000000 -set FMP_CAPSULE_KEY=SAMPLE_DEVELOPMENT.pfx -set FMP_CAPSULE_PAYLOAD=Payload.bin -set WINDOWS_CAPSULE_KEY=SAMPLE_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="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\SampleDevelopment - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=NewCert.pem ^ - --other-public-cert=NewSub.pub.pem ^ - --trusted-public-cert=NewRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - - copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\NewCert - - 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 -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" - powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" - 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\%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=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestCert.pem ^ - --other-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestSub.pub.pem ^ - --trusted-public-cert=%WORKSPACE%\edk2\BaseTools\Source\Python\Pkcs7Sign\TestRoot.pub.pem ^ - -o %FMP_CAPSULE_FILE% ^ - %FMP_CAPSULE_PAYLOAD% - -copy %FMP_CAPSULE_FILE% %WORKSPACE%\Build\Vlv2TbltDevicePkg\Capsules\TestCert - -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 -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_VERSION_DECIMAL', '%FMP_CAPSULE_VERSION_DECIMAL%' | Out-File firmware.metainfo.xml -encoding ASCII" -powershell -Command "(gc firmware.metainfo.xml) -replace 'FMP_CAPSULE_STRING', '%FMP_CAPSULE_STRING%' | Out-File firmware.metainfo.xml -encoding ASCII" -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\%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% - -erase %FMP_CAPSULE_PAYLOAD% diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.metainfo.xml b/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.metainfo.xml deleted file mode 100644 index 5d550c1f48..0000000000 --- a/Platform/Intel/Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/template.metainfo.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<component type="firmware"> - <id>com.intel.FMP_CAPSULE_BASE_NAME.firmware</id> - <name>FMP_CAPSULE_BASE_NAME</name> - <summary>System firmware for the FMP_CAPSULE_BASE_NAME</summary> - <description> - Description of System firmware for the FMP_CAPSULE_BASE_NAME - </description> - <provides> - <firmware type="flashed">FMP_CAPSULE_GUID</firmware> - </provides> - <url type="homepage">http://www.tianocore.org</url> - <metadata_license>CC0-1.0</metadata_license> - <project_license>BSD</project_license> - <developer_name>Tianocore</developer_name> - <releases> - <release version="FMP_CAPSULE_VERSION_DECIMAL" date="FMP_CAPSULE_DATE"> - <description> - Build FMP_CAPSULE_STRING - </description> - </release> - </releases> - <!-- most OEMs do not need to do this... --> - <custom> - <value key="LVFS::InhibitDownload"/> - </custom> -</component> diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleIA32.dsc b/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleIA32.dsc index bcac59f00a..246347b8fa 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleIA32.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleIA32.dsc @@ -17,7 +17,7 @@ [Defines] SUPPORTED_ARCHITECTURES = IA32|X64 BUILD_TARGETS = DEBUG|RELEASE SKUID_IDENTIFIER = DEFAULT - POSTBUILD = Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.sh + POSTBUILD = python Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py ################################################################################################### # diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleX64.dsc b/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleX64.dsc index 11d50666c0..68bde30f83 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleX64.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformCapsuleX64.dsc @@ -17,7 +17,7 @@ [Defines] SUPPORTED_ARCHITECTURES = IA32|X64 BUILD_TARGETS = DEBUG|RELEASE SKUID_IDENTIFIER = DEFAULT - POSTBUILD = Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.bat + POSTBUILD = python Vlv2TbltDevicePkg/Feature/Capsule/GenerateCapsule/GenCapsuleAll.py ################################################################################################### # -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43983): https://edk2.groups.io/g/devel/message/43983 Mute This Topic: https://groups.io/mt/32520524/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-