ocvalidate: Add checks for PlayChime
@@ -152,12 +152,14 @@ CheckUEFIAudio (
OC_UEFI_CONFIG *UserUefi;
BOOLEAN IsAudioSupportEnabled;
CONST CHAR8 *AsciiAudioDevicePath;
+ CONST CHAR8 *AsciiPlayChime;
ErrorCount = 0;
UserUefi = &Config->Uefi;
IsAudioSupportEnabled = UserUefi->Audio.AudioSupport;
AsciiAudioDevicePath = OC_BLOB_GET (&UserUefi->Audio.AudioDevice);
+ AsciiPlayChime = OC_BLOB_GET (&UserUefi->Audio.PlayChime);
if (IsAudioSupportEnabled) {
if (AsciiAudioDevicePath[0] == '\0') {
DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevicePath cannot be empty when AudioSupport is enabled!\n"));
@@ -166,6 +168,16 @@ CheckUEFIAudio (
DEBUG ((DEBUG_WARN, "UEFI->Audio->AudioDevice is borked! Please check the information above!\n"));
++ErrorCount;
}
+
+ if (AsciiPlayChime[0] == '\0') {
+ DEBUG ((DEBUG_WARN, "UEFI->Audio->PlayChime cannot be empty when AudioSupport is enabled!\n"));
+ ++ErrorCount;
+ } else if (AsciiStrCmp (AsciiPlayChime, "Auto") != 0
+ && AsciiStrCmp (AsciiPlayChime, "Enabled") != 0
+ && AsciiStrCmp (AsciiPlayChime, "Disabled") != 0) {
+ DEBUG ((DEBUG_WARN, "UEFI->Audio->PlayChime is borked (Can only be Auto, Enabled, or Disabled)!\n"));
+ ++ErrorCount;
+ }
}
return ErrorCount;
