BaseTools/Capsule: Supports multiple payloads and drivers in capsule

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1834

1)Add arguments "--embedded-driver" to support embedded driver
in command line.
2)Add arguments "--update-image-index" to identify ImageIndex
within the device in command line.
3)Add arguments "-j JSONFILE" to support multiple payloads and
embedded drivers with JSON file.

The update is in a backwards compatible manner, so all command
line options to support single payload are still supported. But
all the options associated with multiple payloads should be
provided in a JSON file.

Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Eric Jin <eric.jin@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Jin, Eric
2019-06-26 13:55:35 +08:00
committed by Feng, Bob C
parent c54c856218
commit 104a1aa19b
3 changed files with 788 additions and 323 deletions

View File

@ -2,7 +2,7 @@
# Module that encodes and decodes a EFI_FIRMWARE_IMAGE_AUTHENTICATION with
# certificate data and payload data.
#
# Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@ -166,6 +166,18 @@ class FmpAuthHeaderClass (object):
self._Valid = True
return self.Payload
def IsSigned (self, Buffer):
if len (Buffer) < self._StructSize:
return False
(MonotonicCount, dwLength, wRevision, wCertificateType, CertType) = \
struct.unpack (
self._StructFormat,
Buffer[0:self._StructSize]
)
if CertType != self._EFI_CERT_TYPE_PKCS7_GUID.bytes_le:
return False
return True
def DumpInfo (self):
if not self._Valid:
raise ValueError