MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetEarlyUserSettings

Function GetEarlyUserSettings

rEFIt_UEFI/Platform/Settings.cpp:2079–2894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2077}
2078
2079EFI_STATUS
2080GetEarlyUserSettings (
2081 IN EFI_FILE *RootDir,
2082 const TagDict* CfgDict
2083 )
2084{
2085 EFI_STATUS Status = EFI_SUCCESS;
2086// const TagDict* Dict;
2087// const TagDict* Dict2;
2088// const TagDict* DictPointer;
2089// const TagStruct* Prop;
2090// const TagArray* arrayProp;
2091 VOID *Value = NULL;
2092 BOOLEAN SpecialBootMode = FALSE;
2093
2094 {
2095 UINTN Size = 0;
2096 //read aptiofixflag from nvram for special boot
2097 Status = GetVariable2(L"aptiofixflag", &gEfiAppleBootGuid, &Value, &Size);
2098 if (!EFI_ERROR(Status)) {
2099 SpecialBootMode = TRUE;
2100 FreePool(Value);
2101 }
2102 }
2103
2104 gSettings.KextPatchesAllowed = TRUE;
2105 gSettings.KernelAndKextPatches.KPAppleRTC = TRUE;
2106 gSettings.KernelAndKextPatches.KPDELLSMBIOS = FALSE; // default is false
2107 gSettings.KernelPatchesAllowed = TRUE;
2108
2109 if (CfgDict != NULL) {
2110 //DBG("Loading early settings\n");
2111 DbgHeader("GetEarlyUserSettings");
2112
2113 const TagDict* BootDict = CfgDict->dictPropertyForKey("Boot");
2114 if (BootDict != NULL) {
2115 const TagStruct* Prop = BootDict->propertyForKey("Timeout");
2116 if (Prop != NULL) {
2117 GlobalConfig.Timeout = (INT32)GetPropertyAsInteger(Prop, GlobalConfig.Timeout);
2118 DBG("timeout set to %lld\n", GlobalConfig.Timeout);
2119 }
2120
2121 Prop = BootDict->propertyForKey("SkipHibernateTimeout");
2122 gSettings.SkipHibernateTimeout = IsPropertyNotNullAndTrue(Prop);
2123
2124 //DisableCloverHotkeys
2125 Prop = BootDict->propertyForKey("DisableCloverHotkeys");
2126 gSettings.DisableCloverHotkeys = IsPropertyNotNullAndTrue(Prop);
2127
2128 Prop = BootDict->propertyForKey("Arguments");
2129 if (Prop != NULL && (Prop->isString()) && Prop->getString()->stringValue().notEmpty()) {
2130 gSettings.BootArgs = Prop->getString()->stringValue();
2131 }
2132
2133 // defaults if "DefaultVolume" is not present or is empty
2134 gSettings.LastBootedVolume = FALSE;
2135 // gSettings.DefaultVolume = NULL;
2136

Callers 1

RefitMainFunction · 0.85

Calls 15

GetVariable2Function · 0.85
DbgHeaderFunction · 0.85
GetPropertyAsIntegerFunction · 0.85
IsPropertyNotNullAndTrueFunction · 0.85
SWPrintfFunction · 0.85
CustomBootModeToStrFunction · 0.85
GetPropertyFloatFunction · 0.85
FillinKextPatchesFunction · 0.85
FillinCustomEntryFunction · 0.85
AddCustomLoaderEntryFunction · 0.85
FillingCustomLegacyFunction · 0.85

Tested by

no test coverage detected