| 2077 | } |
| 2078 | |
| 2079 | EFI_STATUS |
| 2080 | GetEarlyUserSettings ( |
| 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 |
no test coverage detected