From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.26409.1661956420718975261 for ; Wed, 31 Aug 2022 07:33:41 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: vincent.stehle@arm.com) 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 39D3EED1; Wed, 31 Aug 2022 07:33:46 -0700 (PDT) Received: from localhost.localdomain (X72Y076X74.nice.arm.com [10.34.129.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A1FFD3F71A; Wed, 31 Aug 2022 07:33:39 -0700 (PDT) From: =?UTF-8?B?VmluY2VudCBTdGVobMOp?= To: devel@edk2.groups.io Cc: =?UTF-8?q?Vincent=20Stehl=C3=A9?= Subject: [PATCH] MdeModulePkg/CapsuleApp: support on-disk with undefined BootOrder Date: Wed, 31 Aug 2022 16:33:30 +0200 Message-Id: <0ab665d26ac83c9c566ede2cff2f0cfa03456907.1661955539.git.vincent.stehle@arm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D4038 When BootOrder is not defined, CapsuleApp.efi will not find a file system to store the capsule for on-disk update because GetUpdateFileSystem() will fail. BootOrder is an EFI Global Variable, which default state is firmware vendor specific. It is possible for BootOrder to not be defined as mentioned in the UEFI Specification in chapter 3.4.3, "Boot Option Variables Default Boot Behavior". Relax the check to allow that case. Signed-off-by: Vincent Stehl=C3=A9 --- Hi, This has passed CI with pull request https://github.com/tianocore/edk2/pull= /3263. Best regards, Vincent. MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c b/MdeModul= ePkg/Application/CapsuleApp/CapsuleOnDisk.c index 5ce5a50f7b..f04de00f65 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c @@ -456,10 +456,7 @@ GetUpdateFileSystem ( // 2. Get EFI system partition form boot options.=0D //=0D BootOptionBuffer =3D EfiBootManagerGetLoadOptions (&BootOptionCount, Loa= dOptionTypeBoot);=0D - if ((BootOptionBuffer =3D=3D NULL) ||=0D - ((BootOptionCount =3D=3D 0) && (Map =3D=3D NULL))=0D - )=0D - {=0D + if ((BootOptionBuffer !=3D NULL) && (BootOptionCount =3D=3D 0) && (Map = =3D=3D NULL)) {=0D return EFI_NOT_FOUND;=0D }=0D =0D --=20 2.35.1