From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.8291.1590593149974939877 for ; Wed, 27 May 2020 08:25:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XlVx4jN0; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590593149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QrQYlymTG4+e4bA+M7T7xA5/hW9TTkZXBTqV/j6DFC8=; b=XlVx4jN09eOk4A9yAoQSGS9099wSnbGdI6dFZJR2+EeS7yhilItDxpOUFMb5jiVs/ZJgwv ZUmQe86PcKkz07x9x4sc7I5ZhTz8thXbVw5aIAHt/YL81bMbjVl8yP+92c0iwzEsuGBWCX gE2nOxxFGsHyfg+VQUUH9iNlFLigPM4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-anVuDAVDNyyZ1byspKNV_Q-1; Wed, 27 May 2020 11:25:46 -0400 X-MC-Unique: anVuDAVDNyyZ1byspKNV_Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 969401005512; Wed, 27 May 2020 15:25:44 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-77.ams2.redhat.com [10.36.113.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id C24CB5D9E5; Wed, 27 May 2020 15:25:43 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 2/5] ArmPkg/PlatformBootManagerLib: fall back to the UiApp on boot failure To: devel@edk2.groups.io, ard.biesheuvel@arm.com Cc: jon@solid-run.com References: <20200526161359.4810-1-ard.biesheuvel@arm.com> <20200526161359.4810-3-ard.biesheuvel@arm.com> From: "Laszlo Ersek" Message-ID: Date: Wed, 27 May 2020 17:25:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200526161359.4810-3-ard.biesheuvel@arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/26/20 18:13, Ard Biesheuvel wrote: > 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); > + } > } > Reviewed-by: Laszlo Ersek