diff --git a/Changelog.md b/Changelog.md index a835246009167fc9b99aca28dad5ba45ffd621b9..ae11bfa43bfc617896dc4587c20ce77ccac154d4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -15,6 +15,8 @@ OpenCore Changelog - Added `PickerAttributes` option to colour picker - Added `ProtectSecureBoot` option through FwRuntimeServices - Replaced `RequireVault` and `RequireSignature` with `Vault` +- Added `BootKicker` tool to support launching Apple BootPicker +- Added BootPicker support as an external UI in OC through `PickerMode` #### v0.5.5 - Fixed CPU bus ratio calculation for Nehalem and Westmere diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 772b790aa60d007c86e57c2abe2702037bc612c4..72d58da5ba3d0aed94310358880e68e21bf40f1d 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index ad771b9f9614c5853e11168b670850ec46d325b8..c16e232e67625c33ce02c3bac4c221a4cc9c58bb 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -2110,7 +2110,7 @@ behaviour that does not go to any other sections \textbf{Failsafe}: \texttt{false}\\ \textbf{Description}: Enable \texttt{modifier hotkey} handling in boot picker. - In addition to \texttt{action hotkeys}, which are partially described in \texttt{UsePicker} + In addition to \texttt{action hotkeys}, which are partially described in \texttt{PickerMode} section and are normally handled by Apple BDS, there exist modifier keys, which are handled by operating system bootloader, namely \texttt{boot.efi}. These keys allow to change operating system behaviour by providing different boot modes. @@ -2157,16 +2157,30 @@ behaviour that does not go to any other sections automatic booting of the default boot entry. Use 0 to disable timer. \item - \texttt{UsePicker}\\ + \texttt{PickerMode}\\ \textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Failsafe}: \texttt{false}\\ - \textbf{Description}: Use OpenCore built-in boot picker for boot management. + \textbf{Description}: Choose boot picker used for boot management. - \texttt{UsePicker} set to \texttt{false} entirely disables all boot management - in OpenCore except policy enforcement. In this case a custom user interface may + Picker describes underlying boot management with an optional user interface + responsible for handling boot options. The following values are supported: + + \begin{itemize} + \tightlist + \item \texttt{Builtin} --- boot management is handled by OpenCore, a simple + text only user interface is used. + \item \texttt{External} --- an external boot management protocol is used + if available. Otherwise \texttt{Builtin} mode is used. + \item \texttt{Apple} --- Apple boot management is used if available. + Otherwise \texttt{Builtin} mode is used. + \end{itemize} + + + Upon success \texttt{External} mode will entirely disable all boot management + in OpenCore except policy enforcement. In \texttt{Apple} mode it may additionally + bypass policy enforcement. To implement \texttt{External} mode a custom user interface may utilise \href{https://github.com/acidanthera/OcSupportPkg}{OcSupportPkg} - \texttt{OcBootManagementLib} to implement a user friendly boot picker oneself. - Reference example of external graphics interface is provided in + \texttt{OcBootManagementLib}. Reference example of external graphics interface is provided in \href{https://github.com/acidanthera/OcSupportPkg/tree/master/Tests/ExternalUi}{ExternalUi} test driver. @@ -2199,10 +2213,10 @@ behaviour that does not go to any other sections \emph{Note}: Activated \texttt{KeySupport}, \texttt{AppleUsbKbDxe}, or similar driver is required for key handling to work. On many firmwares it is not possible to get all the keys function. - In addition to \texttt{OPT} OpenCore supports \texttt{Escape} key - \texttt{ShowPicker}. This key exists for firmwares with PS/2 keyboards that - fail to report held \texttt{OPT} key and require continual presses of \texttt{Escape} - key to enter the boot menu. + In addition to \texttt{OPT} OpenCore supports \texttt{Escape} key to display picker when + \texttt{ShowPicker} is disabled. This key exists for \texttt{Apple} picker mode and for + firmwares with PS/2 keyboards that fail to report held \texttt{OPT} key and require continual + presses of \texttt{Escape} key to enter the boot menu. \end{enumerate} @@ -3686,7 +3700,7 @@ build -a X64 -b RELEASE -t XCODE5 -p MdeModulePkg/MdeModulePkg.dsc \hyperref[uefiinputprops]{Input Properties} section below. \item - \texttt{Input}\\ + \texttt{Output}\\ \textbf{Type}: \texttt{plist\ dict}\\ \textbf{Failsafe}: None\\ \textbf{Description}: Apply individual settings designed for output (text and graphics) in diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 61394f78dfdf66e2d89f6e86b4d7043552c4fa4f..8df2af6a1efa46ba5e2fc4e8e802f47021b4da7b 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index 4c4eb66fbc4029c1c7c982782ecc3259c9ac821b..06d8ced296fd07495e72c5a39e356065206afdf9 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE %DIF DEL PreviousConfiguration.tex Thu Feb 6 00:43:28 2020 -%DIF ADD ../Configuration.tex Sun Feb 9 01:08:55 2020 +%DIF ADD ../Configuration.tex Sun Feb 9 14:29:44 2020 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -2394,7 +2394,7 @@ behaviour that does not go to any other sections \textbf{Failsafe}: \texttt{false}\\ \textbf{Description}: Enable \texttt{modifier hotkey} handling in boot picker. - In addition to \texttt{action hotkeys}, which are partially described in \texttt{UsePicker} + In addition to \texttt{action hotkeys}, which are partially described in \texttt{\DIFdelbegin \DIFdel{UsePicker}\DIFdelend \DIFaddbegin \DIFadd{PickerMode}\DIFaddend } section and are normally handled by Apple BDS, there exist modifier keys, which are handled by operating system bootloader, namely \texttt{boot.efi}. These keys allow to change operating system behaviour by providing different boot modes. @@ -2502,16 +2502,32 @@ behaviour that does not go to any other sections automatic booting of the default boot entry. Use 0 to disable timer. \item - \texttt{UsePicker}\\ + \texttt{\DIFdelbegin \DIFdel{UsePicker}\DIFdelend \DIFaddbegin \DIFadd{PickerMode}\DIFaddend }\\ \textbf{Type}: \texttt{plist\ boolean}\\ \textbf{Failsafe}: \texttt{false}\\ - \textbf{Description}: Use OpenCore built-in boot picker for boot management. + \textbf{Description}: \DIFdelbegin \DIFdel{Use OpenCore built-in boot picker }\DIFdelend \DIFaddbegin \DIFadd{Choose boot picker used }\DIFaddend for boot management. - \texttt{UsePicker} set to \texttt{false} entirely disables all boot management - in OpenCore except policy enforcement. In this case a custom user interface may + \DIFaddbegin \DIFadd{Picker describes underlying boot management with an optional user interface + responsible for handling boot options. The following values are supported: +} + + \begin{itemize} + \tightlist + \item \DIFaddend \texttt{\DIFdelbegin \DIFdel{UsePicker}\DIFdelend \DIFaddbegin \DIFadd{Builtin}\DIFaddend } \DIFdelbegin \DIFdel{set to }\DIFdelend \DIFaddbegin \DIFadd{--- boot management is handled by OpenCore, a simple + text only user interface is used. + }\item \DIFaddend \texttt{\DIFdelbegin \DIFdel{false}%DIFDELCMD < \MBLOCKRIGHTBRACE %%% +\DIFdel{entirely disables }\DIFdelend \DIFaddbegin \DIFadd{External}} \DIFadd{--- an external boot management protocol is used + if available. Otherwise }\texttt{\DIFadd{Builtin}} \DIFadd{mode is used. + }\item \texttt{\DIFadd{Apple}} \DIFadd{--- Apple boot management is used if available. + Otherwise }\texttt{\DIFadd{Builtin}} \DIFadd{mode is used. + }\end{itemize} + + + \DIFadd{Upon success }\texttt{\DIFadd{External}} \DIFadd{mode will entirely disable }\DIFaddend all boot management + in OpenCore except policy enforcement. In \DIFdelbegin \DIFdel{this case }\DIFdelend \DIFaddbegin \texttt{\DIFadd{Apple}} \DIFadd{mode it may additionally + bypass policy enforcement. To implement }\texttt{\DIFadd{External}} \DIFadd{mode }\DIFaddend a custom user interface may utilise \href{https://github.com/acidanthera/OcSupportPkg}{OcSupportPkg} - \texttt{OcBootManagementLib} to implement a user friendly boot picker oneself. - Reference example of external graphics interface is provided in + \texttt{OcBootManagementLib}\DIFdelbegin \DIFdel{to implement a user friendly boot picker oneself}\DIFdelend . Reference example of external graphics interface is provided in \href{https://github.com/acidanthera/OcSupportPkg/tree/master/Tests/ExternalUi}{ExternalUi} test driver. @@ -2544,10 +2560,10 @@ behaviour that does not go to any other sections \emph{Note}: Activated \texttt{KeySupport}, \texttt{AppleUsbKbDxe}, or similar driver is required for key handling to work. On many firmwares it is not possible to get all the keys function. - In addition to \texttt{OPT} OpenCore supports \texttt{Escape} key - \texttt{ShowPicker}. This key exists for firmwares with PS/2 keyboards that - fail to report held \texttt{OPT} key and require continual presses of \texttt{Escape} - key to enter the boot menu. + In addition to \texttt{OPT} OpenCore supports \texttt{Escape} key \DIFaddbegin \DIFadd{to display picker when + }\DIFaddend \texttt{ShowPicker} \DIFaddbegin \DIFadd{is disabled}\DIFaddend . This key exists for \DIFaddbegin \texttt{\DIFadd{Apple}} \DIFadd{picker mode and for + }\DIFaddend firmwares with PS/2 keyboards that fail to report held \texttt{OPT} key and require continual + presses of \texttt{Escape} key to enter the boot menu. \end{enumerate} @@ -4099,7 +4115,7 @@ build -a X64 -b RELEASE -t XCODE5 -p MdeModulePkg/MdeModulePkg.dsc \hyperref[uefiinputprops]{Input Properties} section below. \item - \DIFaddbegin \texttt{\DIFadd{Input}}\\ + \DIFaddbegin \texttt{\DIFadd{Output}}\\ \textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ dict}}\\ \textbf{\DIFadd{Failsafe}}\DIFadd{: None}\\ \textbf{\DIFadd{Description}}\DIFadd{: Apply individual settings designed for output (text and graphics) in diff --git a/Docs/Sample.plist b/Docs/Sample.plist index 4854fc474ae74fed538c23c03aa8cdc748da276a..4add3ba0e2d85c95d4fcb097c68912046c282eea 100644 --- a/Docs/Sample.plist +++ b/Docs/Sample.plist @@ -583,6 +583,8 @@ HibernateMode None + PickerMode + Builtin HideSelf PickerAttributes @@ -595,8 +597,6 @@ 0 Timeout 5 - UsePicker - Debug diff --git a/Docs/SampleFull.plist b/Docs/SampleFull.plist index d7c9d4a20fec9f949ca12c2bdcbe0b7d227e66b9..3746812fef52bbe7e15974b1cb13ba240de5e5b7 100644 --- a/Docs/SampleFull.plist +++ b/Docs/SampleFull.plist @@ -583,6 +583,8 @@ HibernateMode None + PickerMode + Builtin HideSelf PickerAttributes @@ -595,8 +597,6 @@ 0 Timeout 5 - UsePicker - Debug diff --git a/OpenCorePkg.dsc b/OpenCorePkg.dsc index 8caa0c9d4441e583de327b8f9c2d34558df4f5f5..6eb4e1c39b10767fe91e8b80bc1e38fc580ceedd 100755 --- a/OpenCorePkg.dsc +++ b/OpenCorePkg.dsc @@ -107,6 +107,7 @@ MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf OpenCorePkg/Application/Bootstrap/Bootstrap.inf OpenCorePkg/Platform/OpenCore/OpenCore.inf + OcSupportPkg/Application/BootKicker/BootKicker.inf OcSupportPkg/Application/CleanNvram/CleanNvram.inf OcSupportPkg/Application/VerifyMsrE2/VerifyMsrE2.inf OcSupportPkg/Platform/AppleUsbKbDxe/UsbKbDxe.inf diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index 45f7f75802ba1cbcbc1da7a4bc63e5bb9057ded2..18931350d63359fa592fac1df55d15a47dc038a4 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -365,17 +365,32 @@ OcMiscBoot ( EFI_STATUS Status; OC_PICKER_CONTEXT *Context; OC_PICKER_CMD PickerCommand; + OC_PICKER_MODE PickerMode; UINTN ContextSize; UINT32 Index; UINT32 EntryIndex; OC_INTERFACE_PROTOCOL *Interface; UINTN BlessOverrideSize; CHAR16 **BlessOverride; + CONST CHAR8 *AsciiPicker; + + AsciiPicker = OC_BLOB_GET (&Config->Misc.Boot.PickerMode); + + if (AsciiStrCmp (AsciiPicker, "Builtin") == 0) { + PickerMode = OcPickerModeBuiltin; + } else if (AsciiStrCmp (AsciiPicker, "External") == 0) { + PickerMode = OcPickerModeExternal; + } else if (AsciiStrCmp (AsciiPicker, "Apple") == 0) { + PickerMode = OcPickerModeApple; + } else { + DEBUG ((DEBUG_WARN, "OC: Unknown PickirMode: %a, using builtin\n", AsciiPicker)); + PickerMode = OcPickerModeBuiltin; + } // // Do not use our boot picker unless asked. // - if (!Config->Misc.Boot.UsePicker) { + if (PickerMode == OcPickerModeExternal) { DEBUG ((DEBUG_INFO, "OC: Handing off to external boot controller\n")); Status = gBS->LocateProtocol ( @@ -383,19 +398,19 @@ OcMiscBoot ( NULL, (VOID **) &Interface ); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + if (Interface->Revision != OC_INTERFACE_REVISION) { + DEBUG (( + DEBUG_INFO, + "OC: Incompatible external GUI protocol - %u vs %u\n", + Interface->Revision, + OC_INTERFACE_REVISION + )); + Interface = NULL; + } + } else { DEBUG ((DEBUG_INFO, "OC: Missing external GUI protocol - %r\n", Status)); - return; - } - - if (Interface->Revision != OC_INTERFACE_REVISION) { - DEBUG (( - DEBUG_INFO, - "OC: Incompatible external GUI protocol - %u vs %u\n", - Interface->Revision, - OC_INTERFACE_REVISION - )); - return; + Interface = NULL; } } else { Interface = NULL; @@ -470,6 +485,7 @@ OcMiscBoot ( Context->CustomRead = OcToolLoadEntry; Context->PrivilegeContext = Privilege; Context->RequestPrivilege = OcShowSimplePasswordRequest; + Context->PickerMode = PickerMode; Context->ConsoleAttributes = Config->Misc.Boot.PickerAttributes; if ((Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_VERSION_UI) != 0) { diff --git a/macbuild.tool b/macbuild.tool index fb3fa82be8f0e2048c0a0fc9911072c75e07312b..b04947b4748ce4c33cdeeedff458e1db6d8f14f2 100755 --- a/macbuild.tool +++ b/macbuild.tool @@ -29,6 +29,7 @@ package() { cp FwRuntimeServices.efi tmp/EFI/OC/Drivers/ || exit 1 cp NvmExpressDxe.efi tmp/EFI/OC/Drivers/ || exit 1 cp XhciDxe.efi tmp/EFI/OC/Drivers/ || exit 1 + cp BootKicker.efi tmp/EFI/OC/Tools/ || exit 1 cp CleanNvram.efi tmp/EFI/OC/Tools/ || exit 1 cp VerifyMsrE2.efi tmp/EFI/OC/Tools/ || exit 1 cp "${selfdir}/Docs/Configuration.pdf" tmp/Docs/ || exit 1