This is a enhancement.
For now, if BootManagerMenu FFS can not be found from FV, BDS core code will 
still register a boot option for it. Then, this non-functional boot option will 
still be booted by user's request (like HotKey or Exit from shell) to cause 
additional boot time and error status code reported. Therefore, it would be 
good to return EFI_NOT_FOUND status and NULL BootOption pointer to skip 
registering and booting BootManagerMenu boot option for this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnyw...@hpe.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index d016517..74b2acc 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2,7 +2,7 @@
   Library functions which relates with booting.
 
 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -2164,9 +2164,11 @@ EfiBootManagerRefreshAllBootOption (
   The Boot Manager Menu is shown after successfully booting a boot option.
   Assume the BootManagerMenuFile is in the same FV as the module links to this 
library.
 
-  @param  BootOption    Return the boot option of the Boot Manager Menu
+  @param  BootOption    Return the boot option of the Boot Manager Menu. 
Return NULL if
+                        BootManagerMenu FFS section can not be found.
 
   @retval EFI_SUCCESS   Successfully register the Boot Manager Menu.
+  @retval EFI_NOT_FOUND BootManagerMenu FFS section can not be found.
   @retval Status        Return status of gRT->SetVariable (). BootOption still 
points
                         to the Boot Manager Menu even the Status is not 
EFI_SUCCESS.
 **/
@@ -2190,7 +2192,9 @@ BmRegisterBootManagerMenu (
              &DescriptionLength
              );
   if (EFI_ERROR (Status)) {
-    Description = NULL;
+    BootOption = NULL;
+    DEBUG ((EFI_D_ERROR, "[Bds]BootManagerMenu FFS section can not be found, 
skip to register BootManagerMenu\n"));
+    return EFI_NOT_FOUND;
   }
 
   EfiInitializeFwVolDevicepathNode (&FileNode, PcdGetPtr 
(PcdBootManagerMenuFile));
-- 
2.5.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to