From patchwork Fri Jul 8 10:31:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 71669 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp376230qgy; Fri, 8 Jul 2016 03:32:05 -0700 (PDT) X-Received: by 10.66.62.168 with SMTP id z8mr8201894par.152.1467973925458; Fri, 08 Jul 2016 03:32:05 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id lp2si4901827pab.145.2016.07.08.03.32.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jul 2016 03:32:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 98A191A1F78; Fri, 8 Jul 2016 03:32:46 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3FF141A1F74 for ; Fri, 8 Jul 2016 03:32:45 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD2737F340; Fri, 8 Jul 2016 10:32:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-46.phx2.redhat.com [10.3.116.46]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u68AW0Ew024274; Fri, 8 Jul 2016 06:32:01 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 8 Jul 2016 12:31:53 +0200 Message-Id: <1467973913-23523-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 08 Jul 2016 10:32:02 +0000 (UTC) Subject: [edk2] [PATCH] ArmVirtPkg/PlatformBootManagerLib: Postpone the shell registration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Gary Lin , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This patch ports Gary's OvmfPkg commit 14b2ebc30c8b to ArmVirtPkg. Turns out Gary's argument in 14b2ebc30c8b is not only valid for Xen. The same situation arises with QEMU if: - the user specifies no boot order via fw_cfg at all (so QemuBootOrderLib won't touch the boot order), and - the varstore file has just been created from the varstore template. In this case the user is dropped to the UEFI shell (because the shell is registered earlier than all the auto-generated options), which is likely not what the user wants. Cc: Ard Biesheuvel Cc: Gary Lin --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 198d0602b3c0..eaafe7ff57ea 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -424,12 +424,6 @@ PlatformRegisterOptionsAndKeys ( NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL ); ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED); - // - // Register UEFI Shell - // - PlatformRegisterFvBootOption ( - PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE - ); } @@ -558,6 +552,14 @@ PlatformBootManagerAfterConsole ( // the QEMU configuration. // EfiBootManagerRefreshAllBootOption (); + + // + // Register UEFI Shell + // + PlatformRegisterFvBootOption ( + PcdGetPtr (PcdShellFile), L"EFI Internal Shell", LOAD_OPTION_ACTIVE + ); + SetBootOrderFromQemu (); }