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.web12.53826.1590509661696860915 for ; Tue, 26 May 2020 09:14:21 -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 4829430E; Tue, 26 May 2020 09:14:21 -0700 (PDT) Received: from e123331-lin.nice.arm.com (unknown [10.37.8.89]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C9A03F52E; Tue, 26 May 2020 09:14:13 -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 0/5] ArmPkg/PlatformBootManagerLib: play nice without ConnectAll() Date: Tue, 26 May 2020 18:13:54 +0200 Message-Id: <20200526161359.4810-1-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 Currently, Armpkg's PlatformBootManagerLib connects all controller to their drivers recursively, even if the active boot option does not require it. There are some historical reasons for this, some of which are being addressed in separate patches. This series addresses the way ArmPkg's PlatformBootManagerLib implementation deals with the UEFI Shell and the UiApp: currently, the shell is always added as an ordinary boot option, which will be started if no other boot options can be started, or if it is the first one in the boot order. Once we remove the ConnectAll() call from PlatformBootManagerLib, those shells will be launched without any block or other devices connected, which may confuse novice users. So before doing so, let's make the handling a bit more sane: - add a 's' hotkey that enters the UEFI shell regardless of its priority in the BootOrder - this shell will be entered with no devices connected after patch #4 - enter the UiApp as a last resort if no boot options can be started - make the UEFI Shell boot option hidden, so it is not started by default (only by hotkey or BootNext) - remove the ConnectAll() call from PlatformBootManagerLib - finally, add a plugin library for UiApp to expose the UEFI Shell via an ordinary main menu option (this works around the fact that patch #3 will result in the UEFI Shell disappearing from the Boot Manager list). Entering the shell this way will resemble the old situation, given that UiApp connects all devices and refreshes all boot options etc at launch. Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Ray Ni Cc: Zhichao Gao Ard Biesheuvel (5): ArmPkg/PlatformBootManagerLib: register 's' as UEFI Shell hotkey ArmPkg/PlatformBootManagerLib: fall back to the UiApp on boot failure ArmPkg/PlatformBootManagerLib: hide UEFI Shell as a regular boot option ArmPkg/PlatformBootManagerLib: don't connect all devices on each boot ShellPkg: add BootManager library to add UEFI Shell menu option .../ShellBootManagerLib.inf | 45 +++ .../ShellBootManagerLib/ShellBootManagerLib.h | 44 +++ .../PlatformBootManagerLib/PlatformBm.c | 37 ++- .../ShellBootManagerLib/ShellBootManagerLib.c | 258 ++++++++++++++++++ .../ShellBootManagerLib/ShellBmStrings.uni | 17 ++ .../ShellBootManagerLib/ShellBmVfr.Vfr | 37 +++ 6 files changed, 425 insertions(+), 13 deletions(-) create mode 100644 ShellPkg/Library/ShellBootManagerLib/ShellBootManagerLib.inf create mode 100644 ShellPkg/Library/ShellBootManagerLib/ShellBootManagerLib.h create mode 100644 ShellPkg/Library/ShellBootManagerLib/ShellBootManagerLib.c create mode 100644 ShellPkg/Library/ShellBootManagerLib/ShellBmStrings.uni create mode 100644 ShellPkg/Library/ShellBootManagerLib/ShellBmVfr.Vfr -- 2.17.1