mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcBootManagementLib: Allow launching any app via GUID
This commit is contained in:
parent
27dcb28327
commit
1f2982bf03
@ -61,7 +61,7 @@ UefiMain (
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = OcRunAppleBootPicker ();
|
||||
Status = OcRunFirmwareApplication (&gAppleBootPickerFileGuid, TRUE);
|
||||
|
||||
Pixel.Raw = 0x0;
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
|
||||
@ -1210,13 +1210,17 @@ OcDeleteVariables (
|
||||
);
|
||||
|
||||
/**
|
||||
Launch Apple BootPicker.
|
||||
Launch firmware application.
|
||||
|
||||
@param[in] ApplicationGuid Application GUID identifier in the firmware.
|
||||
@param[in] SetReason Pass enter reason (specific to Apple BootPicker).
|
||||
|
||||
@retval error code, should not return.
|
||||
**/
|
||||
EFI_STATUS
|
||||
OcRunAppleBootPicker (
|
||||
VOID
|
||||
OcRunFirmwareApplication (
|
||||
IN EFI_GUID *ApplicationGuid,
|
||||
IN BOOLEAN SetReason
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -61,7 +61,7 @@ RunShowMenu (
|
||||
|
||||
if (!BootContext->PickerContext->ApplePickerUnsupported
|
||||
&& BootContext->PickerContext->PickerMode == OcPickerModeApple) {
|
||||
Status = OcRunAppleBootPicker ();
|
||||
Status = OcRunFirmwareApplication (&gAppleBootPickerFileGuid, TRUE);
|
||||
//
|
||||
// This should not return on success.
|
||||
//
|
||||
@ -540,7 +540,7 @@ OcRunBootPicker (
|
||||
}
|
||||
|
||||
if (Context->PickerCommand == OcPickerShowPicker && Context->PickerMode == OcPickerModeApple) {
|
||||
Status = OcRunAppleBootPicker ();
|
||||
Status = OcRunFirmwareApplication (&gAppleBootPickerFileGuid, TRUE);
|
||||
DEBUG ((DEBUG_INFO, "OCB: Apple BootPicker failed - %r, fallback to builtin\n", Status));
|
||||
Context->ApplePickerUnsupported = TRUE;
|
||||
}
|
||||
@ -707,8 +707,9 @@ OcRunBootPicker (
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
OcRunAppleBootPicker (
|
||||
VOID
|
||||
OcRunFirmwareApplication (
|
||||
IN EFI_GUID *ApplicationGuid,
|
||||
IN BOOLEAN SetReason
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -716,11 +717,11 @@ OcRunAppleBootPicker (
|
||||
EFI_DEVICE_PATH_PROTOCOL *Dp;
|
||||
APPLE_PICKER_ENTRY_REASON PickerEntryReason;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "OCB: OcRunAppleBootPicker attempting to find...\n"));
|
||||
DEBUG ((DEBUG_INFO, "OCB: run fw app attempting to find %g...\n", ApplicationGuid));
|
||||
|
||||
Dp = CreateFvFileDevicePath (&gAppleBootPickerFileGuid);
|
||||
Dp = CreateFvFileDevicePath (ApplicationGuid);
|
||||
if (Dp != NULL) {
|
||||
DEBUG ((DEBUG_INFO, "OCB: OcRunAppleBootPicker attempting to load...\n"));
|
||||
DEBUG ((DEBUG_INFO, "OCB: run fw app attempting to load %g...\n", ApplicationGuid));
|
||||
NewHandle = NULL;
|
||||
Status = gBS->LoadImage (
|
||||
FALSE,
|
||||
@ -738,16 +739,24 @@ OcRunAppleBootPicker (
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
PickerEntryReason = ApplePickerEntryReasonUnknown;
|
||||
Status = gRT->SetVariable (
|
||||
APPLE_PICKER_ENTRY_REASON_VARIABLE_NAME,
|
||||
&gAppleVendorVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof (PickerEntryReason),
|
||||
&PickerEntryReason
|
||||
);
|
||||
if (SetReason) {
|
||||
PickerEntryReason = ApplePickerEntryReasonUnknown;
|
||||
Status = gRT->SetVariable (
|
||||
APPLE_PICKER_ENTRY_REASON_VARIABLE_NAME,
|
||||
&gAppleVendorVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof (PickerEntryReason),
|
||||
&PickerEntryReason
|
||||
);
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_INFO, "OCB: OcRunAppleBootPicker attempting to start with var %r...\n", Status));
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"OCB: run fw app attempting to start %g (%d) %r...\n",
|
||||
ApplicationGuid,
|
||||
SetReason,
|
||||
Status
|
||||
));
|
||||
Status = gBS->StartImage (
|
||||
NewHandle,
|
||||
NULL,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user