}
STATIC
-VOID
+UINT16
PlatformRegisterFvBootOption (
CONST EFI_GUID *FileGuid,
CHAR16 *Description,
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ UINT16 OptionNumber;
Status = gBS->HandleProtocol (
gImageHandle,
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
ASSERT_EFI_ERROR (Status);
}
+ OptionNumber = NewOption.OptionNumber;
EfiBootManagerFreeLoadOption (&NewOption);
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
+ return OptionNumber;
}
ASSERT_EFI_ERROR (Status);
//
- // Map F2 and ESC to Boot Manager Menu
+ // Map UP and ESC to Boot Manager Menu or SimpleInitGUI
//
UP.ScanCode = SCAN_UP;
UP.UnicodeChar = CHAR_NULL;
Esc.UnicodeChar = CHAR_NULL;
Status = EfiBootManagerGetBootManagerMenu (&BootOption);
ASSERT_EFI_ERROR (Status);
+ #ifdef ENABLE_SIMPLE_INIT
+ //
+ // Register Simple Init GUI APP
+ //
+ UINT16 OptionSimpleInit = PlatformRegisterFvBootOption (
+ &gSimpleInitFileGuid, L"Simple Init", LOAD_OPTION_ACTIVE
+ );
+ Status = EfiBootManagerAddKeyOptionVariable (
+ NULL, (UINT16) OptionSimpleInit, 0, &UP, NULL
+ );
+ #else
Status = EfiBootManagerAddKeyOptionVariable (
NULL, (UINT16) BootOption.OptionNumber, 0, &UP, NULL
);
+ #endif
ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);
Status = EfiBootManagerAddKeyOptionVariable (
NULL, (UINT16) BootOption.OptionNumber, 0, &Esc, NULL
Print (VERSION_STRING_PREFIX L"%s\n",
PcdGetPtr (PcdFirmwareVersionString));
}
- Print (L"Press a any side button for for boot options");
+ #ifdef ENABLE_SIMPLE_INIT
+ Print (L"Press a any side button for SimpleInitGUI");
+ #else
+ Print (L"Press a any side button for Boot Options");
+ #endif
} else if (FirmwareVerLength > 0) {
Status = gBS->HandleProtocol (gST->ConsoleOutHandle,
&gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
//
EfiBootManagerRefreshAllBootOption ();
- #ifdef ENABLE_SIMPLE_INIT
- //
- // Register Simple Init GUI APP
- //
- PlatformRegisterFvBootOption (
- &gSimpleInitFileGuid, L"Simple Init", LOAD_OPTION_ACTIVE
- );
- #endif
-
//
// Register UEFI Shell
//
Status = BootLogoUpdateProgress (
White.Pixel,
Black.Pixel,
- L"Press a any side button for for boot options",
+ #ifdef ENABLE_SIMPLE_INIT
+ L"Press a any side button for SimpleInitGUI",
+ #else
+ L"Press a any side button for Boot Options",
+ #endif
White.Pixel,
(Timeout - TimeoutRemain) * 100 / Timeout,
0