mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
ocvalidate: Add checks for LoadEarly
closes https://github.com/acidanthera/bugtracker/issues/2099
This commit is contained in:
parent
bd002bbc26
commit
ae1d0746b7
@ -1421,7 +1421,7 @@
|
||||
<key>Enabled</key>
|
||||
<false/>
|
||||
<key>LoadEarly</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>Path</key>
|
||||
<string>OpenVariableRuntimeDxe.efi</string>
|
||||
</dict>
|
||||
|
||||
@ -1789,7 +1789,7 @@
|
||||
<key>Enabled</key>
|
||||
<false/>
|
||||
<key>LoadEarly</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>Path</key>
|
||||
<string>OpenVariableRuntimeDxe.efi</string>
|
||||
</dict>
|
||||
|
||||
@ -125,6 +125,8 @@ Utility to validate whether a `config.plist` matches requirements and convention
|
||||
- `OpenUsbKbDxe.efi` and `Ps2KeyboardDxe.efi` should never co-exist.
|
||||
- When HFS+ filesystem driver or `AudioDxe.efi` is in use, `ConnectDrivers` should be enabled altogether.
|
||||
- When `OpenCanopy.efi` is in use, `PickerMode` in `Misc->Boot` should be set to `External`.
|
||||
- When `OpenVariableRuntimeDxe.efi` is in use, its `LoadEarly` option must be set to `TRUE`.
|
||||
- When `OpenVariableRuntimeDxe.efi` is NOT in use, `LoadEarly` for any driver must be set to `FALSE`.
|
||||
#### Input
|
||||
- KeySupportMode: Only `Auto`, `V1`, `V2`, or `AMI` are accepted.
|
||||
- When `PointerSupport` is enabled, the value of `PointerSupportMode` should only be `ASUS`.
|
||||
|
||||
@ -296,6 +296,7 @@ CheckUefiDrivers (
|
||||
{
|
||||
UINT32 ErrorCount;
|
||||
UINT32 Index;
|
||||
UINT32 Index2;
|
||||
OC_UEFI_DRIVER_ENTRY *DriverEntry;
|
||||
CONST CHAR8 *Comment;
|
||||
CONST CHAR8 *Driver;
|
||||
@ -312,18 +313,20 @@ CheckUefiDrivers (
|
||||
BOOLEAN IsRequestBootVarRoutingEnabled;
|
||||
BOOLEAN IsKeySupportEnabled;
|
||||
BOOLEAN IsConnectDriversEnabled;
|
||||
BOOLEAN HasOpenVariableRuntimeDxeEfiDriver;
|
||||
|
||||
ErrorCount = 0;
|
||||
|
||||
HasOpenRuntimeEfiDriver = FALSE;
|
||||
HasOpenUsbKbDxeEfiDriver = FALSE;
|
||||
IndexOpenUsbKbDxeEfiDriver = 0;
|
||||
HasPs2KeyboardDxeEfiDriver = FALSE;
|
||||
IndexPs2KeyboardDxeEfiDriver = 0;
|
||||
HasHfsEfiDriver = FALSE;
|
||||
IndexHfsEfiDriver = 0;
|
||||
HasAudioDxeEfiDriver = FALSE;
|
||||
IndexAudioDxeEfiDriver = 0;
|
||||
HasOpenRuntimeEfiDriver = FALSE;
|
||||
HasOpenUsbKbDxeEfiDriver = FALSE;
|
||||
IndexOpenUsbKbDxeEfiDriver = 0;
|
||||
HasPs2KeyboardDxeEfiDriver = FALSE;
|
||||
IndexPs2KeyboardDxeEfiDriver = 0;
|
||||
HasHfsEfiDriver = FALSE;
|
||||
IndexHfsEfiDriver = 0;
|
||||
HasAudioDxeEfiDriver = FALSE;
|
||||
IndexAudioDxeEfiDriver = 0;
|
||||
HasOpenVariableRuntimeDxeEfiDriver = FALSE;
|
||||
for (Index = 0; Index < Config->Uefi.Drivers.Count; ++Index) {
|
||||
DriverEntry = Config->Uefi.Drivers.Values[Index];
|
||||
Comment = OC_BLOB_GET (&DriverEntry->Comment);
|
||||
@ -388,6 +391,29 @@ CheckUefiDrivers (
|
||||
HasAudioDxeEfiDriver = TRUE;
|
||||
IndexAudioDxeEfiDriver = Index;
|
||||
}
|
||||
|
||||
if (AsciiStrCmp (Driver, "OpenVariableRuntimeDxe.efi") == 0) {
|
||||
HasOpenVariableRuntimeDxeEfiDriver = TRUE;
|
||||
|
||||
if (!DriverEntry->LoadEarly) {
|
||||
DEBUG ((DEBUG_WARN, "OpenVariableRuntimeDxe at UEFI->Drivers[%u] must have LoadEarly set to TRUE!\n", Index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// LoadEarly should only be TRUE when OpenVariableRuntimeDxe is used.
|
||||
//
|
||||
if (!HasOpenVariableRuntimeDxeEfiDriver) {
|
||||
for (Index2 = 0; Index2 < Config->Uefi.Drivers.Count; ++Index2) {
|
||||
DriverEntry = Config->Uefi.Drivers.Values[Index2];
|
||||
Driver = OC_BLOB_GET (&DriverEntry->Path);
|
||||
|
||||
if (AsciiStrCmp (Driver, "OpenVariableRuntimeDxe.efi") != 0 && DriverEntry->LoadEarly) {
|
||||
DEBUG ((DEBUG_WARN, "%a at UEFI->Drivers[%u] should have LoadEarly set to FALSE when OpenVariableRuntimeDxe is NOT used!\n", Driver, Index2));
|
||||
++ErrorCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user