mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcBootManagementLib: Let pickers use common function in OcBootManagementLib
This commit is contained in:
parent
a9d6c595bb
commit
50a856d2ad
@ -392,6 +392,19 @@ EFI_STATUS
|
||||
IN OC_PRIVILEGE_LEVEL Level
|
||||
);
|
||||
|
||||
/**
|
||||
Display entries onscreen.
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *OC_SHOW_MENU) (
|
||||
IN OC_PICKER_CONTEXT *Context,
|
||||
IN OC_BOOT_ENTRY *BootEntries,
|
||||
IN UINTN Count,
|
||||
IN UINTN DefaultEntry,
|
||||
OUT OC_BOOT_ENTRY **ChosenBootEntry
|
||||
);
|
||||
|
||||
/**
|
||||
Picker behaviour action.
|
||||
**/
|
||||
@ -449,6 +462,10 @@ struct OC_PICKER_CONTEXT_ {
|
||||
//
|
||||
EFI_HANDLE ExcludeHandle;
|
||||
//
|
||||
// Entry display routine.
|
||||
//
|
||||
OC_SHOW_MENU ShowMenu;
|
||||
//
|
||||
// Privilege escalation requesting routine.
|
||||
//
|
||||
OC_REQ_PRIVILEGE RequestPrivilege;
|
||||
@ -656,6 +673,7 @@ OcShowSimplePasswordRequest (
|
||||
@retval EFI_ABORTED When the user chose to by pressing Esc or 0.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
OcShowSimpleBootMenu (
|
||||
IN OC_PICKER_CONTEXT *Context,
|
||||
IN OC_BOOT_ENTRY *BootEntries,
|
||||
@ -761,7 +779,7 @@ OcWaitForAppleKeyIndex (
|
||||
@retval does not return unless a fatal error happened.
|
||||
**/
|
||||
EFI_STATUS
|
||||
OcRunSimpleBootPicker (
|
||||
OcRunBootPicker (
|
||||
IN OC_PICKER_CONTEXT *Context
|
||||
);
|
||||
|
||||
|
||||
@ -24,32 +24,6 @@
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
|
||||
#define OC_MENU_BOOT_MENU L"OpenCore Boot Menu"
|
||||
#define OC_MENU_RESET_NVRAM_ENTRY L"Reset NVRAM"
|
||||
#define OC_MENU_UEFI_SHELL_ENTRY L"UEFI Shell"
|
||||
#define OC_MENU_PASSWORD_REQUEST L"Password: "
|
||||
#define OC_MENU_PASSWORD_RETRY_LIMIT L"Password retry limit exceeded."
|
||||
#define OC_MENU_CHOOSE_OS L"Choose the Operating System: "
|
||||
#define OC_MENU_SHOW_AUXILIARY L"Show Auxiliary"
|
||||
#define OC_MENU_RELOADING L"Reloading"
|
||||
#define OC_MENU_TIMEOUT L"Timeout"
|
||||
#define OC_MENU_OK L"OK"
|
||||
#define OC_MENU_DISK_IMAGE L" (dmg)"
|
||||
#define OC_MENU_EXTERNAL L" (external)"
|
||||
|
||||
#define OC_VOICE_OVER_IDLE_TIMEOUT_MS 700 ///< Experimental, less is problematic.
|
||||
|
||||
#define OC_VOICE_OVER_SIGNAL_NORMAL_MS 200 ///< From boot.efi, constant.
|
||||
#define OC_VOICE_OVER_SILENCE_NORMAL_MS 150 ///< From boot.efi, constant.
|
||||
#define OC_VOICE_OVER_SIGNALS_NORMAL 1 ///< Username prompt or any input for boot.efi
|
||||
#define OC_VOICE_OVER_SIGNALS_PASSWORD 2 ///< Password prompt for boot.efi
|
||||
#define OC_VOICE_OVER_SIGNALS_PASSWORD_OK 3 ///< Password correct for boot.efi
|
||||
|
||||
#define OC_VOICE_OVER_SIGNAL_ERROR_MS 1000
|
||||
#define OC_VOICE_OVER_SILENCE_ERROR_MS 150
|
||||
#define OC_VOICE_OVER_SIGNALS_ERROR 1 ///< Password verification error or boot failure.
|
||||
#define OC_VOICE_OVER_SIGNALS_HWERROR 3 ///< Hardware error
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
OC_APPLE_DISK_IMAGE_CONTEXT *DmgContext;
|
||||
|
||||
@ -613,7 +613,7 @@ OcShowSimplePasswordRequest (
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
OcRunSimpleBootPicker (
|
||||
OcRunBootPicker (
|
||||
IN OC_PICKER_CONTEXT *Context
|
||||
)
|
||||
{
|
||||
@ -716,7 +716,7 @@ OcRunSimpleBootPicker (
|
||||
ForbidApple = TRUE;
|
||||
}
|
||||
|
||||
Status = OcShowSimpleBootMenu (
|
||||
Status = Context->ShowMenu (
|
||||
Context,
|
||||
Entries,
|
||||
EntryCount,
|
||||
|
||||
@ -38,7 +38,7 @@ ExternalGuiRun (
|
||||
// however, a more advanced user interface should reimplement
|
||||
// OcRunSimpleBootPicker logic.
|
||||
//
|
||||
return OcRunSimpleBootPicker (Picker);
|
||||
return OcRunBootPicker (Picker);
|
||||
}
|
||||
|
||||
STATIC
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user