mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-02-18 01:21:57 +01:00
merge conflicts
Signed-off-by: Slice <sergey.slice@gmail.com>
This commit is contained in:
commit
32675cb9d2
@ -670,6 +670,7 @@ public:
|
||||
XBool NeverDoRecovery = false;
|
||||
XBool LastBootedVolume = false;
|
||||
XStringW DefaultVolume = XStringW();
|
||||
bool BootFirstAvailable = false;
|
||||
XStringW DefaultLoader = XStringW();
|
||||
XBool DebugLog = false;
|
||||
XBool FastBoot = false;
|
||||
@ -736,6 +737,7 @@ public:
|
||||
NeverDoRecovery = other.dgetNeverDoRecovery();
|
||||
LastBootedVolume = other.dgetLastBootedVolume();
|
||||
DefaultVolume = other.dgetDefaultVolume();
|
||||
BootFirstAvailable = other.dgetBootFirstAvailable();
|
||||
DefaultLoader = other.dgetDefaultLoader();
|
||||
DebugLog = other.dgetDebugLog();
|
||||
FastBoot = other.dgetFastBoot();
|
||||
|
@ -141,7 +141,12 @@ public:
|
||||
const decltype(DefaultVolume)::ValueType& dgetDefaultVolume() const {
|
||||
if ( !DefaultVolume.isDefined() ) return DefaultVolume.nullValue;
|
||||
if ( DefaultVolume.value().isEqualIC("LastBootedVolume") ) return DefaultVolume.nullValue;
|
||||
return DefaultVolume.isDefined() ? DefaultVolume.value() : DefaultVolume.nullValue;
|
||||
if ( DefaultVolume.value().isEqualIC("FirstAvailable") ) return DefaultVolume.nullValue;
|
||||
return DefaultVolume.value();
|
||||
};
|
||||
bool dgetBootFirstAvailable() const {
|
||||
if ( !DefaultVolume.isDefined() ) return false;
|
||||
return DefaultVolume.value().isEqualIC("FirstAvailable");
|
||||
};
|
||||
const XString8& dgetDefaultLoader() const { return DefaultLoader.isDefined() ? DefaultLoader.value() : NullXString8; };
|
||||
XBool dgetDebugLog() const { return Debug.isDefined() ? Debug.value() : XBool(false); };
|
||||
|
@ -110,6 +110,14 @@ class XObjArrayNC
|
||||
template<typename IntegralType, enable_if(is_integral(IntegralType))>
|
||||
TYPE &operator[](IntegralType nIndex) { return ElementAt(nIndex); }
|
||||
|
||||
size_t indexOf(TYPE& e) const {
|
||||
size_t i;
|
||||
for ( i=0 ; i<size() ; i+=1 ) {
|
||||
if ( &ElementAt(i) == &e ) return i;
|
||||
}
|
||||
return MAX_XSIZE;
|
||||
}
|
||||
|
||||
bool operator==(const XObjArrayNC<TYPE>& other) const
|
||||
{
|
||||
if ( size() != other.size() ) return false;
|
||||
|
@ -310,7 +310,7 @@ void AddCustomLegacy(void)
|
||||
|
||||
if (Custom.settings.VolumeType != 0) {
|
||||
if (((1ull<<Volume->DiskKind) & Custom.settings.VolumeType) == 0) {
|
||||
DBG("skipped because media is ignored\n");
|
||||
DBG("skipped because media is ignored (VolumeType=%d DiskKind=%d)\n", Custom.settings.VolumeType, Volume->DiskKind);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -2406,7 +2406,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
|
||||
}
|
||||
|
||||
if (Custom.settings.VolumeType != 0 && ((1<<Volume->DiskKind) & Custom.settings.VolumeType) == 0) {
|
||||
DBG("skipped because media is ignored\n");
|
||||
DBG("skipped because media is ignored (VolumeType=%d DiskKind=%d)\n", Custom.settings.VolumeType, Volume->DiskKind);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ void AddCustomTool(void)
|
||||
|
||||
if (Custom.settings.VolumeType != 0) {
|
||||
if (((1ull<<Volume->DiskKind) & Custom.settings.VolumeType) == 0) {
|
||||
DBG("skipped because media is ignored\n");
|
||||
DBG("skipped because media is ignored (VolumeType=%d DiskKind=%d)\n", Custom.settings.VolumeType, Volume->DiskKind);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -169,6 +169,10 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align)
|
||||
// Display Clover boot volume
|
||||
if (SelfVolume->VolLabel.notEmpty() && SelfVolume->VolLabel[0] != L'#') {
|
||||
Text = SWPrintf("%ls, booted from %ls %ls", gFirmwareRevision, SelfVolume->VolLabel.wc_str(), self.getCloverDirFullPath().wc_str());
|
||||
}else{
|
||||
if ( SelfVolume->VolName.notEmpty() ) {
|
||||
Text = SWPrintf("%ls %ls%ls", gFirmwareRevision, SelfVolume->VolName.wc_str(), self.getCloverDirFullPath().wc_str());
|
||||
}
|
||||
}
|
||||
if (Text.isEmpty()) {
|
||||
Text = SWPrintf("%ls %ls", gFirmwareRevision, /*SelfVolume->VolName.wc_str(),*/ self.getCloverDirFullPath().wc_str());
|
||||
|
@ -584,16 +584,9 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume)
|
||||
Volume->DevicePathString = FileDevicePathToXStringW(Volume->DevicePath);
|
||||
}
|
||||
|
||||
#if REFIT_DEBUG > 0
|
||||
if (Volume->DevicePath != NULL) {
|
||||
DBG(" %ls\n", FileDevicePathToXStringW(Volume->DevicePath).wc_str());
|
||||
//#if REFIT_DEBUG >= 2
|
||||
// DumpHex(1, 0, GetDevicePathSize(Volume->DevicePath), Volume->DevicePath);
|
||||
//#endif
|
||||
}
|
||||
#else
|
||||
DBG("\n");
|
||||
#endif
|
||||
|
||||
Volume->ApfsFileSystemUUID = APFSPartitionUUIDExtract(Volume->DevicePath); // NullXString8 if it's not an APFS volume
|
||||
Volume->DiskKind = DISK_KIND_INTERNAL; // default
|
||||
@ -996,6 +989,10 @@ void ScanVolumes(void)
|
||||
Volume->Hidden = false; // default to not hidden
|
||||
|
||||
Status = ScanVolume(Volume);
|
||||
#ifdef JIEF_DEBUG
|
||||
DBG(" kind=%d\n", Volume->DiskKind);
|
||||
#endif
|
||||
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Volume->Index = HandleIndex;
|
||||
Volumes.AddReference(Volume, true);
|
||||
|
@ -873,11 +873,6 @@ void LOADER_ENTRY::DelegateKernelPatches()
|
||||
OC_DATA_ASSIGN_N(mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx]->Replace, kextPatch.Replace.data(), kextPatch.Replace.size());
|
||||
OC_DATA_ASSIGN_N(mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx]->ReplaceMask, kextPatch.MaskReplace.data(), kextPatch.MaskReplace.size());
|
||||
mOpenCoreConfiguration.Kernel.Patch.Values[kextPatchIdx]->Skip = (UINT32)kextPatch.Skip;
|
||||
#ifdef JIEF_DEBUG
|
||||
if ( kextPatch.Label == "algrey - cpuid_set_info - ryzen cores and logicals count - part 3 - 10.14"_XS8 ) {
|
||||
DEBUG (( DEBUG_INFO, "" ));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1159,9 +1154,11 @@ void LOADER_ENTRY::StartLoader()
|
||||
mOpenCoreConfiguration.Kernel.Scheme.FuzzyMatch = gSettings.Quirks.FuzzyMatch;
|
||||
|
||||
memset(&mOpenCoreConfiguration.Kernel.Quirks, 0, sizeof(mOpenCoreConfiguration.Kernel.Quirks));
|
||||
mOpenCoreConfiguration.Kernel.Quirks.SetApfsTrimTimeout = -1; // Jief: Slice modified OcConfigurationLib.h to set -1 by default instead of 999. I prefer the modification here to minimize commts in OC submodule. Makes it easier to upgrade submodule.
|
||||
|
||||
mOpenCoreConfiguration.Kernel.Quirks.SetApfsTrimTimeout = -1; // Jief: Slice modified OcConfigurationLib.h to set -1 by default instead of 999. I prefer the modification here to minimize commits in OC submodule. Makes it easier to upgrade submodule.
|
||||
mOpenCoreConfiguration.Kernel.Quirks.AppleCpuPmCfgLock = GlobalConfig.KPAppleIntelCPUPM || GlobalConfig.NeedPMfix ;
|
||||
mOpenCoreConfiguration.Kernel.Quirks.AppleXcpmCfgLock = GlobalConfig.KPKernelPm || GlobalConfig.NeedPMfix ;
|
||||
|
||||
mOpenCoreConfiguration.Kernel.Quirks.AppleXcpmExtraMsrs = gSettings.Quirks.OcKernelQuirks.AppleXcpmExtraMsrs;
|
||||
mOpenCoreConfiguration.Kernel.Quirks.AppleXcpmForceBoost = gSettings.Quirks.OcKernelQuirks.AppleXcpmForceBoost;
|
||||
#ifndef USE_OC_SECTION_PlatformInfo
|
||||
@ -1193,6 +1190,10 @@ void LOADER_ENTRY::StartLoader()
|
||||
pos = setKextAtPos(&kextArray, "VirtualSMC.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "FakeSMC.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "WhateverGreen.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "AppleMCEReporterDisabler.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "AppleIntelI210Ethernet.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "USBWakeFixup.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "FeatureUnlock.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "vecLib.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "IOAudioFamily.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "IOSkywalkFamily.kext"_XS8, pos);
|
||||
@ -1203,7 +1204,6 @@ void LOADER_ENTRY::StartLoader()
|
||||
pos = setKextAtPos(&kextArray, "AppleALC.kext"_XS8, pos);
|
||||
// pos = setKextAtPos(&kextArray, "IntelMausi.kext"_XS8, pos); // not needed special order?
|
||||
pos = setKextAtPos(&kextArray, "SMCProcessor.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "SMCSuperIO.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "USBPorts.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "VoodooGPIO.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "VoodooI2CServices.kext"_XS8, pos);
|
||||
@ -1220,6 +1220,8 @@ void LOADER_ENTRY::StartLoader()
|
||||
pos = setKextAtPos(&kextArray, "corecaptureElCap.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "IO80211ElCap.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "AirPortAtheros40.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "SMCProcessorAMD.kext"_XS8, pos);
|
||||
pos = setKextAtPos(&kextArray, "SMCSuperIO.kext"_XS8, pos);
|
||||
|
||||
for (size_t kextIdx = 0 ; kextIdx < kextArray.size() ; kextIdx++ ) {
|
||||
const SIDELOAD_KEXT& KextEntry = kextArray[kextIdx];
|
||||
@ -1388,7 +1390,7 @@ void LOADER_ENTRY::StartLoader()
|
||||
memset(mOpenCoreConfiguration.Kernel.Block.Values[0], 0, mOpenCoreConfiguration.Kernel.Block.ValueSize);
|
||||
mOpenCoreConfiguration.Kernel.Block.Values[0]->Enabled = 1;
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Arch, OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Scheme.KernelArch));
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Comment, "");
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Comment, "Allow IOSkywalk Downgrade");
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MaxKernel, "");
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->MinKernel, "23");
|
||||
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Block.Values[0]->Identifier, "com.apple.iokit.IOSkywalkFamily");
|
||||
@ -2519,6 +2521,8 @@ INTN FindDefaultEntry(void)
|
||||
// DBG("FindDefaultEntry ...\n");
|
||||
//DbgHeader("FindDefaultEntry");
|
||||
|
||||
if ( gSettings.Boot.BootFirstAvailable ) return 0;
|
||||
|
||||
//
|
||||
// try to detect volume set by Startup Disk or previous Clover selection
|
||||
// with broken nvram this requires emulation to be installed.
|
||||
@ -3379,7 +3383,7 @@ displayFreeMemory("Before RunMainMenu"_XS8);
|
||||
#endif
|
||||
MenuExit = MainMenu.RunMainMenu(DefaultIndex, &ChosenEntry);
|
||||
}
|
||||
// DBG("exit from MainMenu %llu\n", MenuExit); //MENU_EXIT_ENTER=(1) MENU_EXIT_DETAILS=3
|
||||
// DBG("exit from MainMenu %llu ChosenEntry=%zu\n", MenuExit, MainMenu.Entries.indexOf(*ChosenEntry)); //MENU_EXIT_ENTER=(1) MENU_EXIT_DETAILS=3
|
||||
// disable default boot - have sense only in the first run
|
||||
gSettings.Boot.Timeout = -1;
|
||||
if ((DefaultEntry != NULL) && (MenuExit == MENU_EXIT_TIMEOUT)) {
|
||||
|
Loading…
Reference in New Issue
Block a user