diff --git a/Utilities/ocvalidate/README.md b/Utilities/ocvalidate/README.md index 0c22484555d2206acb6bb20ca291ce9a8a833321..2788eafd11a98ac685bccfa340e0c177dfa3ec1c 100644 --- a/Utilities/ocvalidate/README.md +++ b/Utilities/ocvalidate/README.md @@ -111,6 +111,7 @@ Utility to validate whether a `config.plist` matches requirements and convention - When `AudioSupport` is enabled, AudioDevice cannot be empty and must be a valid path. #### Quirks - When `RequestBootVarRouting` is enabled, `OpenRuntime.efi` should be loaded in `UEFI->Drivers`. +- `ResizeGpuBars` must be set to an integer value between `-1` or `19`. #### Drivers - When `OpenUsbKbDxe.efi` is in use, `KeySupport` in `UEFI->Input` should never be enabled altogether. - When `Ps2KeyboardDxe.efi` is in use, `KeySupport` in `UEFI->Input` should always be enabled altogether. diff --git a/Utilities/ocvalidate/ValidateBooter.c b/Utilities/ocvalidate/ValidateBooter.c index 4cd49fd5d7fbfc0d7281da4d1ac94d963186bfc5..232c8ed6006344865759f7488c3387cf6ac1ed8b 100644 --- a/Utilities/ocvalidate/ValidateBooter.c +++ b/Utilities/ocvalidate/ValidateBooter.c @@ -153,6 +153,7 @@ CheckBooterQuirks ( BOOLEAN IsDisableVariableWriteEnabled; BOOLEAN IsEnableWriteUnprotectorEnabled; BOOLEAN HasOpenRuntimeEfiDriver; + INT8 ResizeAppleGpuBars; ErrorCount = 0; UserBooter = &Config->Booter; @@ -164,6 +165,7 @@ CheckBooterQuirks ( IsEnableWriteUnprotectorEnabled = UserBooter->Quirks.EnableWriteUnprotector; HasOpenRuntimeEfiDriver = FALSE; MaxSlide = UserBooter->Quirks.ProvideMaxSlide; + ResizeAppleGpuBars = UserBooter->Quirks.ResizeAppleGpuBars; for (Index = 0; Index < UserUefi->Drivers.Count; ++Index) { DriverEntry = UserUefi->Drivers.Values[Index]; @@ -208,13 +210,13 @@ CheckBooterQuirks ( } } - if (UserBooter->Quirks.ResizeAppleGpuBars > 10) { + if (ResizeAppleGpuBars > 10) { DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is unsupported by macOS!\n", UserBooter->Quirks.ResizeAppleGpuBars)); ++ErrorCount; - } else if (UserBooter->Quirks.ResizeAppleGpuBars > 8) { + } else if (ResizeAppleGpuBars > 8) { DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is unstable with macOS sleep-wake!\n", UserBooter->Quirks.ResizeAppleGpuBars)); ++ErrorCount; - } else if (UserBooter->Quirks.ResizeAppleGpuBars > 0) { + } else if (ResizeAppleGpuBars > 0) { DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is not useful for macOS!\n", UserBooter->Quirks.ResizeAppleGpuBars)); ++ErrorCount; } diff --git a/Utilities/ocvalidate/ValidateUEFI.c b/Utilities/ocvalidate/ValidateUEFI.c index f0b261bbacd980da389afff4636b4fad507380a9..fadfbbfd53e90568122fa2fb68d7c181f4a89225 100644 --- a/Utilities/ocvalidate/ValidateUEFI.c +++ b/Utilities/ocvalidate/ValidateUEFI.c @@ -528,7 +528,20 @@ CheckUEFIQuirks ( IN OC_GLOBAL_CONFIG *Config ) { - return 0; + UINT32 ErrorCount; + OC_UEFI_CONFIG *UserUefi; + INT8 ResizeGpuBars; + + ErrorCount = 0; + UserUefi = &Config->Uefi; + ResizeGpuBars = UserUefi->Quirks.ResizeGpuBars; + + if (ResizeGpuBars < -1 || ResizeGpuBars > 19) { + DEBUG ((DEBUG_WARN, "UEFI->Quirks->ResizeGpuBars is borked (Can only be between -1 and 19)!\n")); + ++ErrorCount; + } + + return ErrorCount; } STATIC