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.53824.1590509660006877711 for ; Tue, 26 May 2020 09:14:20 -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 A556755D; Tue, 26 May 2020 09:14:19 -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 64D143F7C3; Tue, 26 May 2020 09:14:17 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: jon@solid-run.com, Ard Biesheuvel Subject: [PATCH 2/5] ArmPkg/PlatformBootManagerLib: fall back to the UiApp on boot failure Date: Tue, 26 May 2020 18:13:56 +0200 Message-Id: <20200526161359.4810-3-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526161359.4810-1-ard.biesheuvel@arm.com> References: <20200526161359.4810-1-ard.biesheuvel@arm.com> As a last resort, drop into the UiApp application when no active boot options could be started. Doing so will connect all devices, and so it will allow the user to enter the Boot Manager submenu and pick a network or removable disk option. With the right UiApp library added in, the UiApp also gives access to the UEFI Shell. Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index 23c925bbdb9c..f91f7cd09ca1 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -830,5 +830,19 @@ PlatformBootManagerUnableToBoot ( VOID ) { - return; + EFI_STATUS Status; + EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; + + // + // BootManagerMenu doesn't contain the correct information when return status + // is EFI_NOT_FOUND. + // + Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu); + if (EFI_ERROR (Status)) { + return; + } + + for (;;) { + EfiBootManagerBoot (&BootManagerMenu); + } } -- 2.17.1