From nobody Mon Feb 9 16:06:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+74272+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74272+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1618832420; cv=none; d=zohomail.com; s=zohoarc; b=NTIlhBpiA9hoL0uCUYc01PYtZNyT2grtyC9YLK7tPfPl4dtey7ueJOnh3k5zT3LjGul03cZM+iGdNfDEBM9KGvhtK2eX346BFGDrbx5dwSwbykK0oXmZ8c4ZxahIwBWnYRyhQlM8cD2sPNFEnFWeTd2ip/TeAMMpuxQzodaca2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618832420; h=Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=g9YGjJz9VlBTI5GD47ollI228+U4mmMdfvAD0zqnjjg=; b=Jhv+/+Qt/8N4BiDXSSOPQofNWXxOvP33yPEjBDPkTagRvlbLC5vUH5rB5zNnGXOwW+UoVbN0XesMJQaEqVC2P9vULAdmFSz2zWnp8Zfx4hrXR6l4E5nKmj+/g4tV5yIro8n26pITJWpVhShU995rSA0stLQ9+hilsm7BqBdowZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74272+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1618832420844760.5956315149843; Mon, 19 Apr 2021 04:40:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0GaoYY1788612xkdLM4gaR2c; Mon, 19 Apr 2021 04:40:19 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.7618.1618832418539645427 for ; Mon, 19 Apr 2021 04:40:18 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CB04ED1; Mon, 19 Apr 2021 04:40:17 -0700 (PDT) X-Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6CABF3F792; Mon, 19 Apr 2021 04:40:15 -0700 (PDT) From: "Sughosh Ganu" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen , Sughosh Ganu Subject: [edk2-devel] [PATCH] BaseTools: GenerateCapsule.py: Add support for version 3 of FMP Image Header structure Date: Mon, 19 Apr 2021 17:10:04 +0530 Message-Id: <20210419114004.16505-1-sughosh.ganu@linaro.org> Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,sughosh.ganu@linaro.org X-Gm-Message-State: DHMOUsXpLi79kXmp9zc4l0tTx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1618832419; bh=RjgUzEIRzk9WgGYbxUmyUinb26fPR9SF2v+gUPwMj1A=; h=Cc:Date:From:Reply-To:Subject:To; b=EEaQfIyv94NcHs42NmztETMEjEQjcP8cdfRQblEwkJLdma2/lJSFfubE5o9V3JT32ee Drvf/pbVE+JODoQsQ1yIAHkiqDi8vC0Vcod9xIYdPE1c+t9Iu+45M46w+tVj6WDMX455s IY3UrgaEPytNquLpVLJTCRjbKfjX0pOVJOo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add support for the ImageCapsuleSupport field, introduced in version 3 of the EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER structure. This structure member is used to indicate if the corresponding payload has support for authentication and dependency. Signed-off-by: Sughosh Ganu Reviewed-by: Bob Feng --- .../Source/Python/Capsule/GenerateCapsule.py | 5 +++- .../Common/Uefi/Capsule/FmpCapsuleHeader.py | 26 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools= /Source/Python/Capsule/GenerateCapsule.py index a8de988253..6419a2ac6f 100644 --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py @@ -561,6 +561,7 @@ if __name__ =3D=3D '__main__': print ('GenerateCapsule: error:' + str(Msg)) sys.exit (1) for SinglePayloadDescriptor in PayloadDescriptorList: + ImageCapsuleSupport =3D 0x0000000000000000 Result =3D SinglePayloadDescriptor.Payload try: FmpPayloadHeader.FwVersion =3D SinglePayloadD= escriptor.FwVersion @@ -575,6 +576,7 @@ if __name__ =3D=3D '__main__': if SinglePayloadDescriptor.UseDependency: CapsuleDependency.Payload =3D Result CapsuleDependency.DepexExp =3D SinglePayloadDescriptor.Dep= exExp + ImageCapsuleSupport |=3D 0x0000000000000002 Result =3D CapsuleDependency.Encode () if args.Verbose: CapsuleDependency.DumpInfo () @@ -607,13 +609,14 @@ if __name__ =3D=3D '__main__': FmpAuthHeader.MonotonicCount =3D SinglePayloadDescript= or.MonotonicCount FmpAuthHeader.CertData =3D CertData FmpAuthHeader.Payload =3D Result + ImageCapsuleSupport |=3D 0x0000000000000001 Result =3D FmpAuthHeader.Encode () if args.Verbose: FmpAuthHeader.DumpInfo () except: print ('GenerateCapsule: error: can not encode FMP Aut= h Header') sys.exit (1) - FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Res= ult, HardwareInstance =3D SinglePayloadDescriptor.HardwareInstance, UpdateI= mageIndex =3D SinglePayloadDescriptor.UpdateImageIndex) + FmpCapsuleHeader.AddPayload (SinglePayloadDescriptor.Guid, Res= ult, ImageCapsuleSupport, HardwareInstance =3D SinglePayloadDescriptor.Hard= wareInstance, UpdateImageIndex =3D SinglePayloadDescriptor.UpdateImageIndex) try: for EmbeddedDriver in EmbeddedDriverDescriptorList: FmpCapsuleHeader.AddEmbeddedDriver(EmbeddedDriver) diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.p= y b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py index 91d24919c4..a2a5cf0db8 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py @@ -47,14 +47,19 @@ class FmpCapsuleImageHeaderClass (object): # /// therefore can be modified without changing the Auth data. # /// # UINT64 UpdateHardwareInstance; + # + # /// + # /// Bits which indicate authentication and depex information for t= he image that follows this structure + # /// + # UINT64 ImageCapsuleSupport # } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER; # - # #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0= x00000002 + # #define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0= x00000003 =20 - _StructFormat =3D '=3D len (self._FmpCapsuleImageHeaderList): @@ -198,13 +207,14 @@ class FmpCapsuleHeaderClass (object): self._ItemOffsetList.append (Offset) Offset =3D Offset + len (EmbeddedDriver) Index =3D 1 - for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance= , UpdateImageIndex) in self._PayloadList: + for (UpdateImageTypeId, Payload, ImageCapsuleSupport, VendorCodeBy= tes, HardwareInstance, UpdateImageIndex) in self._PayloadList: FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass () FmpCapsuleImageHeader.UpdateImageTypeId =3D UpdateImageTy= peId FmpCapsuleImageHeader.UpdateImageIndex =3D UpdateImageIn= dex FmpCapsuleImageHeader.Payload =3D Payload FmpCapsuleImageHeader.VendorCodeBytes =3D VendorCodeByt= es FmpCapsuleImageHeader.UpdateHardwareInstance =3D HardwareInsta= nce + FmpCapsuleImageHeader.ImageCapsuleSupport =3D ImageCapsuleS= upport FmpCapsuleImage =3D FmpCapsuleImageHeader.Encode () FmpCapsuleData =3D FmpCapsuleData + FmpCapsuleImage =20 --=20 2.17.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 (#74272): https://edk2.groups.io/g/devel/message/74272 Mute This Topic: https://groups.io/mt/82206170/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-