]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Bds: Do not boot to UI again when BootNext points to UI
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 21 Jun 2016 05:04:31 +0000 (13:04 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 23 Jun 2016 07:18:09 +0000 (15:18 +0800)
Per UEFI spec the successful returning of boot option triggers boot
to UI. But when the BootNext just points to UI, it causes confusing.
So the patch avoids booting to UI again when the BootNext points to
UI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
MdeModulePkg/Universal/BdsDxe/BdsEntry.c

index 3734ff954da292d000ad1020a72baf39d2b80485..741ddc302bbcb2c87cdcdc5617ac76744f91285a 100644 (file)
@@ -6,7 +6,7 @@
   to enter BDS phase.\r
 \r
 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -923,9 +923,10 @@ BdsEntry (
       if (!EFI_ERROR (Status)) {\r
         EfiBootManagerBoot (&LoadOption);\r
         EfiBootManagerFreeLoadOption (&LoadOption);\r
-        if (LoadOption.Status == EFI_SUCCESS) {\r
+        if ((LoadOption.Status == EFI_SUCCESS) && (LoadOption.OptionNumber != BootManagerMenu.OptionNumber)) {\r
           //\r
           // Boot to Boot Manager Menu upon EFI_SUCCESS\r
+          // Exception: Do not boot again when the BootNext points to Boot Manager Menu.\r
           //\r
           EfiBootManagerBoot (&BootManagerMenu);\r
         }\r