3333#include "Utils.h"
3434
3535BOOLEAN mInteractive = TRUE;
36- BOOLEAN mClearScreen = FALSE ;
36+ BOOLEAN mClearScreen = TRUE ;
3737BOOLEAN mKeyPromptOnExit = FALSE;
38+ BOOLEAN mLoadConfig = FALSE;
3839BH_ON_EXIT mBhOnExit = BhOnExitExit ;
3940
4041#if false
@@ -56,9 +57,13 @@ UefiUnload (
5657 { 0x4d1fda02, 0x38c7, 0x4a6a, {0x9c, 0xc6, 0x4b, 0xcc, 0xa8, 0xb3, 0x01, 0x02} }
5758STATIC EFI_GUID gEfiOpenCoreGuid = EFI_OPEN_CORE_GUID ;
5859
59- #define EFI_APPLE_GUID \
60+ #define EFI_APPLE_BOOT_GUID \
6061 { 0x7c436110, 0xab2a, 0x4bbb, {0xa8, 0x80, 0xfe, 0x41, 0x99, 0x5c, 0x9f, 0x82} }
61- STATIC EFI_GUID gEfiAppleGuid = EFI_APPLE_GUID ;
62+ STATIC EFI_GUID gEfiAppleBootGuid = EFI_APPLE_BOOT_GUID ;
63+
64+ #define EFI_APPLE_VENDOR_GUID \
65+ { 0x4d1ede05, 0x38c7, 0x4a6a, {0x9c, 0xc6, 0x4b, 0xcc, 0xa8, 0xb3, 0x8c, 0x14} }
66+ STATIC EFI_GUID gEfiAppleVendorGuid = EFI_APPLE_VENDOR_GUID ;
6267
6368// with zero terminator
6469STATIC CHAR8 gBootArgsVal [] = "-no_compat_check" ;
@@ -72,7 +77,7 @@ DisplayAppleVar(
7277 BOOLEAN isString
7378 )
7479{
75- DisplayNvramValueWithoutGuid (Name , & gEfiAppleGuid , isString );
80+ DisplayNvramValueWithoutGuid (Name , & gEfiAppleBootGuid , isString );
7681}
7782
7883EFI_STATUS
@@ -82,7 +87,7 @@ ToggleAppleVar(
8287 UINTN PreferredSize
8388 )
8489{
85- return ToggleOrSetVar (Name , & gEfiAppleGuid , PreferredValue , PreferredSize , TRUE);
90+ return ToggleOrSetVar (Name , & gEfiAppleBootGuid , PreferredValue , PreferredSize , TRUE);
8691}
8792
8893EFI_STATUS
@@ -92,7 +97,7 @@ SetAppleVar(
9297 UINTN PreferredSize
9398 )
9499{
95- return ToggleOrSetVar (Name , & gEfiAppleGuid , PreferredValue , PreferredSize , FALSE);
100+ return ToggleOrSetVar (Name , & gEfiAppleBootGuid , PreferredValue , PreferredSize , FALSE);
96101}
97102
98103void ToggleBootArgs ()
@@ -124,18 +129,19 @@ EFI_STATUS
124129EFIAPI
125130BhMain ()
126131{
127- BOOLEAN showOCVersion = FALSE ;
132+ BOOLEAN showOCVersion = TRUE ;
128133
129134 while (TRUE) {
130135 // inter alia, we want to clear the other stuff on the hidden text screen, before switching to viewing the text...
131136 if (mClearScreen ) gST -> ConOut -> ClearScreen (gST -> ConOut );
132137
133138 SetColour (EFI_LIGHTMAGENTA );
134139 Print (L"macOS NVRAM Boot Helper\n" );
135- Print (L"0.2.8 oc-340 \n" );
140+ Print (L"0.2.9 guid \n" );
136141 SetColour (EFI_WHITE );
137- Print (L"\n" );
138142
143+ #if 0
144+ Print (L"\n" );
139145 CONST CHAR8 * AsciiPicker ;
140146 AsciiPicker = OC_BLOB_GET (& mBootHelperConfiguration .Config .Xanana );
141147 for (UINTN i = 0 ; ; i ++ ) {
@@ -144,15 +150,27 @@ BhMain ()
144150 Print (L"%c" , (CHAR16 )c );
145151 }
146152 Print (L"\n" );
153+ #endif
154+
155+ if (showOCVersion ) {
156+ Print (L"\n" );
157+ DisplayNvramValueWithoutGuid (L"opencore-version" , & gEfiOpenCoreGuid , TRUE);
158+ }
159+
160+ Print (L"\n" );
161+ DisplayNvramValueWithoutGuid (L"SSN" , & gEfiAppleVendorGuid , TRUE);
162+ DisplayNvramValueWithoutGuid (L"system-id" , & gEfiAppleVendorGuid , TRUE);
163+ DisplayNvramValueWithoutGuid (L"ROM" , & gEfiAppleVendorGuid , TRUE);
164+ DisplayNvramValueWithoutGuid (L"HW_ROM" , & gEfiAppleVendorGuid , TRUE);
165+ DisplayNvramValueWithoutGuid (L"MLB" , & gEfiAppleVendorGuid , TRUE);
166+ DisplayNvramValueWithoutGuid (L"HW_MLB" , & gEfiAppleVendorGuid , TRUE);
147167
148168#if 1
169+ Print (L"\n" );
149170 DisplayAppleVar (L"boot-args" , TRUE);
150171 DisplayAppleVar (L"csr-active-config" , FALSE);
151172 DisplayAppleVar (L"StartupMute" , TRUE);
152173#endif
153- if (showOCVersion ) {
154- DisplayNvramValueWithoutGuid (L"opencore-version" , & gEfiOpenCoreGuid , TRUE);
155- }
156174
157175 SetColour (EFI_LIGHTRED );
158176 Print (L"\nboot-[A]rgs; [B]ig Sur; [C]atalina; Startup[M]ute\n[R]eboot; [S]hutdown; [Q]uit; E[x]it; [L]ist\n" );
@@ -284,20 +302,26 @@ BhConfigAndMain (
284302{
285303 EFI_STATUS Status ;
286304
287- DEBUG ((DEBUG_INFO , "BH: BhConfigAndMain calling BhConfigLoad...\n" ));
288- Status = BhConfigLoad (
289- Storage ,
290- & mBootHelperConfiguration ,
291- mOpenCoreVaultKey
292- );
305+ if (mLoadConfig ) {
306+ DEBUG ((DEBUG_INFO , "BH: BhConfigAndMain calling BhConfigLoad...\n" ));
307+ Status = BhConfigLoad (
308+ Storage ,
309+ & mBootHelperConfiguration ,
310+ mOpenCoreVaultKey
311+ );
293312
294- if (EFI_ERROR (Status )) {
295- return Status ;
313+ if (EFI_ERROR (Status )) {
314+ return Status ;
315+ }
316+ } else {
317+ DEBUG ((DEBUG_WARN , "BH: Load config disabled\n" ));
296318 }
297319
298320 Status = BhMain ();
299321
300- BhConfigurationFree (& mBootHelperConfiguration );
322+ if (mLoadConfig ) {
323+ BhConfigurationFree (& mBootHelperConfiguration );
324+ }
301325
302326 return Status ;
303327}
0 commit comments