提交 17c0c3df 编写于 作者: P PMheart

ocvalidate: AudioSupport = YES should require non-empty AudioDevice (and valid device path)

上级 9e9c2c52
......@@ -84,6 +84,8 @@ Utility to validate whether a `config.plist` matches requirements and convention
### UEFI
#### APFS
- When `EnableJumpstart` is enabled, `ScanPolicy` in `Misc->Security` should have `OC_SCAN_ALLOW_FS_APFS` (bit 8) set, together with `OC_SCAN_FILE_SYSTEM_LOCK` (bit 0) set. Or `ScanPolicy` should be `0` (failsafe value).
#### Audio
- 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`.
#### Drivers
......
......@@ -150,15 +150,22 @@ CheckUEFIAudio (
{
UINT32 ErrorCount;
OC_UEFI_CONFIG *UserUefi;
BOOLEAN IsAudioSupportEnabled;
CONST CHAR8 *AsciiAudioDevicePath;
ErrorCount = 0;
UserUefi = &Config->Uefi;
AsciiAudioDevicePath = OC_BLOB_GET (&UserUefi->Audio.AudioDevice);
if (AsciiAudioDevicePath[0] != '\0' && !AsciiDevicePathIsLegal (AsciiAudioDevicePath)) {
DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevice is borked! Please check the information above!\n"));
++ErrorCount;
IsAudioSupportEnabled = UserUefi->Audio.AudioSupport;
AsciiAudioDevicePath = OC_BLOB_GET (&UserUefi->Audio.AudioDevice);
if (IsAudioSupportEnabled) {
if (AsciiAudioDevicePath[0] == '\0') {
DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevicePath cannot be empty when AudioSupport is enabled!\n"));
++ErrorCount;
} else if (!AsciiDevicePathIsLegal (AsciiAudioDevicePath)) {
DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevice is borked! Please check the information above!\n"));
++ErrorCount;
}
}
return ErrorCount;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册