25 IN OC_GLOBAL_CONFIG *Config
29 UINT32 CurrErrorCount;
48 for (Index = 0; Index <
ARRAY_SIZE (ConfigCheckers); ++Index) {
49 CurrErrorCount = ConfigCheckers[Index](Config);
51 if (CurrErrorCount != 0) {
55 DEBUG ((DEBUG_WARN,
"\n"));
56 ErrorCount += CurrErrorCount;
69 UINT8 *ConfigFileBuffer;
70 UINT32 ConfigFileSize;
71 CONST CHAR8 *ConfigFileName;
73 OC_GLOBAL_CONFIG Config;
82 PcdGet8 (PcdDebugPropertyMask) |= DEBUG_PROPERTY_DEBUG_CODE_ENABLED;
83 PcdGet32 (PcdFixedDebugPrintErrorLevel) |= DEBUG_INFO;
84 PcdGet32 (PcdDebugPrintErrorLevel) |= DEBUG_INFO;
86 DEBUG ((DEBUG_ERROR,
"\nNOTE: This version of ocvalidate is only compatible with OpenCore version %a!\n\n",
OPEN_CORE_VERSION));
92 DEBUG ((DEBUG_ERROR,
"Usage: %a <path/to/config.plist>\n\n", argv[0]));
99 ConfigFileName = argv[1];
100 ConfigFileBuffer =
UserReadFile (ConfigFileName, &ConfigFileSize);
101 if (ConfigFileBuffer == NULL) {
102 DEBUG ((DEBUG_ERROR,
"Failed to read %a\n", ConfigFileName));
115 if (EFI_ERROR (Status)) {
116 DEBUG ((DEBUG_ERROR,
"Invalid config\n"));
120 if (ErrorCount > 0) {
121 DEBUG ((DEBUG_ERROR,
"Serialisation returns %u %a!\n", ErrorCount, ErrorCount > 1 ?
"errors" :
"error"));
127 DEBUG ((DEBUG_ERROR,
"\n"));
131 FreePool (ConfigFileBuffer);
133 if (ErrorCount == 0) {
136 "Completed validating %a in %llu ms. No issues found.\n",
143 "Completed validating %a in %llu ms. Found %u %a requiring attention.\n",
147 ErrorCount > 1 ?
"issues" :
"issue"
163 OC_GLOBAL_CONFIG Config;
165 NewData = AllocatePool (
Size);
166 if (NewData != NULL) {
#define ARRAY_SIZE(Array)
DMG_SIZE_DEVICE_PATH Size
VOID OcConfigurationFree(IN OUT OC_GLOBAL_CONFIG *Config)
EFI_STATUS OcConfigurationInit(OUT OC_GLOBAL_CONFIG *Config, IN VOID *Buffer, IN UINT32 Size, IN OUT UINT32 *ErrorCount OPTIONAL)
#define OPEN_CORE_VERSION
INT64 GetCurrentTimestamp(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
UINT8 * UserReadFile(IN CONST CHAR8 *FileName, OUT UINT32 *Size)
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
UINT32 CheckConfig(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckMisc(IN OC_GLOBAL_CONFIG *Config)
UINT32(* CONFIG_CHECK)(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckNvram(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckDeviceProperties(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckACPI(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckPlatformInfo(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckKernel(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckBooter(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckUefi(IN OC_GLOBAL_CONFIG *Config)