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.8400.1590657482609298337 for ; Thu, 28 May 2020 02:18:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@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 3499FD6E; Thu, 28 May 2020 02:18:02 -0700 (PDT) Received: from e123331-lin.nice.arm.com (unknown [10.37.8.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5779B3F6C4; Thu, 28 May 2020 02:18:00 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: jon@solid-run.com, Ard Biesheuvel , Laszlo Ersek , Leif Lindholm , Ray Ni , Zhichao Gao Subject: [PATCH v2 3/5] MdeModulePkg/BootManagerUiLib: show inactive boot options Date: Thu, 28 May 2020 11:17:39 +0200 Message-Id: <20200528091741.14610-4-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200528091741.14610-1-ard.biesheuvel@arm.com> References: <20200528091741.14610-1-ard.biesheuvel@arm.com> UEFI boot options may exist but have the LOAD_OPTION_ACTIVE flag cleared. This means that the boot option should not be selected by default, but it does not mean it should be omitted from the boot selection presented by the boot manager: for this purpose, another flag LOAD_OPTION_HIDDEN exists. Given that the latter flag exists solely for the purpose of omitting boot options from the boot selection menu, and LOAD_OPTION_XXX flags can be combined if desired, hiding inactive boot options as well is a mistake, and violates the intent of paragraph 3.1.3 of the UEFI specification (revision 2.8 errata A). Let's fix this by dropping the LOAD_OPTION_ACTIVE check from the code that populates the boot selection menu. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/BootManagerUiLib/BootManager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c index 13b40e11b396..4b2c4c77a124 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c @@ -535,9 +535,9 @@ UpdateBootManager ( mKeyInput++; // - // Don't display the hidden/inactive boot option + // Don't display hidden boot options, but retain inactive ones. // - if (((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || ((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) { + if ((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) { continue; } -- 2.17.1