mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-29 12:35:53 +01:00
BlockSkywalk will be false by default
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
90b68db323
commit
7adb640a42
@ -690,7 +690,6 @@ void PreCleanupRSDT()
|
||||
// trim the RSDT tail before the XSDT starts
|
||||
if ((UINTN)Rsdt < (UINTN)Xsdt && (UINTN)Rsdt + Rsdt->Header.Length > (UINTN)Xsdt) {
|
||||
UINTN v = ((UINTN)Xsdt - (UINTN)Rsdt) & ~3;
|
||||
// if ( v > MAX_UINT32 ) panic("((UINTN)Xsdt - (UINTN)Rsdt) & ~3 > MAX_UINT32");
|
||||
Rsdt->Header.Length = (UINT32)v;
|
||||
DBG("Cropped Rsdt->Header.Length=%d\n", (UINT32)Rsdt->Header.Length);
|
||||
}
|
||||
|
@ -930,7 +930,7 @@ LoadNvramPlist(
|
||||
return Status;
|
||||
}
|
||||
|
||||
#define SEARCH_ONLY_EFI 0
|
||||
#define SEARCH_ONLY_EFI 1
|
||||
/** Searches all volumes for the most recent nvram.plist and loads it into gNvramDict. */
|
||||
EFI_STATUS
|
||||
LoadLatestNvramPlist()
|
||||
|
@ -135,86 +135,3 @@ F0 00 00 00 | ....
|
||||
01 | .
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
//const XString8 nullGuidAsString = "00000000-0000-0000-0000-000000000000"_XS8;
|
||||
|
||||
//class _GUID_H__asserts
|
||||
//{
|
||||
//public:
|
||||
// _GUID_H__asserts() {
|
||||
// // Jief : I know it's a panic, even in a release version. But it's about constants !
|
||||
// if ( !IsValidGuidString(nullGuidAsString) ) panic("!IsValidGuidString(nullGuidAsString)");
|
||||
// }
|
||||
//} _GUID_H__asserts_obj;
|
||||
|
||||
//constexpr const EFI_GUID nullGuid;
|
||||
|
||||
//XStringW GuidBeToXStringW(const EFI_GUID& Guid)
|
||||
//{
|
||||
// UINT8 *GuidData = (UINT8 *)&Guid;
|
||||
// XStringW Str = SWPrintf("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||
// GuidData[0], GuidData[1], GuidData[2], GuidData[3],
|
||||
// GuidData[4], GuidData[5],
|
||||
// GuidData[6], GuidData[7],
|
||||
// GuidData[8], GuidData[9], GuidData[10], GuidData[11],
|
||||
// GuidData[12], GuidData[13], GuidData[14], GuidData[15]);
|
||||
// return Str;
|
||||
//}
|
||||
//
|
||||
//XString8 GuidBeToXString8(const EFI_GUID& Guid)
|
||||
//{
|
||||
// UINT8 *GuidData = (UINT8 *)&Guid;
|
||||
// XString8 Str = SWPrintf("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||
// GuidData[0], GuidData[1], GuidData[2], GuidData[3],
|
||||
// GuidData[4], GuidData[5],
|
||||
// GuidData[6], GuidData[7],
|
||||
// GuidData[8], GuidData[9], GuidData[10], GuidData[11],
|
||||
// GuidData[12], GuidData[13], GuidData[14], GuidData[15]);
|
||||
// return Str;
|
||||
//}
|
||||
//
|
||||
//
|
||||
//XStringW GuidLEToXStringW(const EFI_GUID& Guid)
|
||||
//{
|
||||
// XStringW returnValue;
|
||||
// returnValue.SWPrintf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||
// Guid.Data1, Guid.Data2, Guid.Data3, Guid.Data4[0], Guid.Data4[1],
|
||||
// Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]);
|
||||
// return returnValue;
|
||||
//}
|
||||
//
|
||||
//XString8 GuidLEToXString8(const EFI_GUID& Guid)
|
||||
//{
|
||||
// XString8 returnValue;
|
||||
// returnValue.S8Printf("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
|
||||
// Guid.Data1, Guid.Data2, Guid.Data3, Guid.Data4[0], Guid.Data4[1],
|
||||
// Guid.Data4[2], Guid.Data4[3], Guid.Data4[4], Guid.Data4[5], Guid.Data4[6], Guid.Data4[7]);
|
||||
// return returnValue;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
//int EFI_GUID::parse_guid_error() { panic("Incorrect format for guid operator."); } // note, not constexpr
|
||||
//EFI_GUID EFI_GUID::parse_guid_error2() { panic("Incorrect format for guid operator."); } // note, not constexpr
|
||||
|
@ -155,15 +155,6 @@ const PLATFORMDATA& ApplePlatformDataArrayClass::operator [] (MacModel m)
|
||||
ApplePlatformDataArrayClass ApplePlatformDataArray;
|
||||
|
||||
|
||||
//const PLATFORMDATA& ApplePlatformDataArrayClass::operator [] (size_t idx)
|
||||
//{
|
||||
// if ( idx >= sizeof(m_ApplePlatformDataArrayClass)/sizeof(m_ApplePlatformDataArrayClass[0]) ) {
|
||||
// panic("(int)m >= sizeof(m_ApplePlatformDataArrayClass)/sizeof(m_ApplePlatformDataArrayClass[0])");
|
||||
// }
|
||||
// return m_ApplePlatformDataArrayClass[idx];
|
||||
//}
|
||||
|
||||
|
||||
// Firmware info for 10.13+
|
||||
// by Sherlocks
|
||||
uint32_t GetFwFeatures(MacModel Model)
|
||||
|
@ -315,7 +315,7 @@ public:
|
||||
XBool dgetKPPanicNoKextDump() const { return PanicNoKextDump.isDefined() ? PanicNoKextDump.value() : XBool(false); };
|
||||
XBool dget_KPAppleIntelCPUPM() const { return AppleIntelCPUPM.isDefined() ? AppleIntelCPUPM.value() : XBool(false); };
|
||||
XBool dgetKPAppleRTC() const { return AppleRTC.isDefined() ? AppleRTC.value() : XBool(true); };
|
||||
XBool dgetBlockSkywalk() const { return BlockSkywalk.isDefined() ? BlockSkywalk.value() : XBool(true); };
|
||||
XBool dgetBlockSkywalk() const { return BlockSkywalk.isDefined() ? BlockSkywalk.value() : XBool(false); };
|
||||
XBool dgetEightApple() const { return EightApple.isDefined() ? EightApple.value() : XBool(false); };
|
||||
XBool dgetKPDELLSMBIOS() const { return DellSMBIOSPatch.isDefined() ? DellSMBIOSPatch.value() : XBool(false); };
|
||||
uint32_t dgetFakeCPUID() const { return FakeCPUID.isDefined() ? FakeCPUID.value() : 0; };
|
||||
|
@ -45,12 +45,19 @@ class XArray
|
||||
void setSize(size_t l);
|
||||
|
||||
//low case functions like in std::vector
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
const TYPE& begin() const { if ( m_len == 0 ) panic("m_len == 0"); return ElementAt(0); }
|
||||
TYPE& begin() { if ( m_len == 0 ) panic("m_len == 0"); return ElementAt(0); }
|
||||
|
||||
const TYPE& end() const { if ( m_len == 0 ) panic("m_len == 0"); return ElementAt(m_len - 1); }
|
||||
TYPE& end() { if ( m_len == 0 ) panic("m_len == 0"); return ElementAt(m_len - 1); }
|
||||
#else
|
||||
const TYPE& begin() const { if ( m_len == 0 ) return 0; return ElementAt(0); }
|
||||
TYPE& begin() { if ( m_len == 0 ) return 0; return ElementAt(0); }
|
||||
|
||||
const TYPE& end() const { if ( m_len == 0 ) return 0; return ElementAt(m_len - 1); }
|
||||
TYPE& end() { if ( m_len == 0 ) return 0; return ElementAt(m_len - 1); }
|
||||
#endif
|
||||
|
||||
size_t insert(const TYPE newElement, size_t pos, size_t count = 1) { return Insert(newElement, pos, count); }
|
||||
|
||||
|
@ -57,10 +57,18 @@ protected:
|
||||
template<typename IntegralType, enable_if(is_integral(IntegralType))>
|
||||
void stealValueFrom(T* p, IntegralType count, IntegralType allocatedSize) {
|
||||
if ( count < 0 ) {
|
||||
#ifdef JIEF_DEBUG
|
||||
panic("XBuffer::stealValueFrom : count < 0. System halted\n");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
if ( allocatedSize < count ) {
|
||||
#ifdef JIEF_DEBUG
|
||||
panic("XBuffer::stealValueFrom : allocatedSize < count. System halted\n");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
if( _WData ) free(_WData);
|
||||
m_allocatedSize = allocatedSize;
|
||||
|
@ -111,11 +111,9 @@ public:
|
||||
|
||||
virtual XBool isTheNextTag(XmlLiteParser* xmlLiteParser) override { return xmlLiteParser->nextTagIsOpeningTag("dict"); }
|
||||
|
||||
// virtual XmlAbstractType& parseValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors, const XmlParserPosition &keyPos, const char *keyValue, size_t keyValueLength, XBool* keyFound);
|
||||
virtual XmlValueType* parseKeyAndValueFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors);
|
||||
virtual XBool parseFromXmlLite(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, XBool generateErrors) override;
|
||||
|
||||
// virtual XBool validate(XmlLiteParser* xmlLiteParser, const XString8& xmlPath, const XmlParserPosition& keyPos, XBool generateErrors) override;
|
||||
};
|
||||
|
||||
|
||||
@ -163,25 +161,15 @@ if ( xmlPath.startWithOrEqualToIC("/Devices/Properties"_XS8) ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// const char* keyValue;
|
||||
// size_t keyValueLength;
|
||||
// XString8 xmlSubPath;
|
||||
|
||||
size_t n = 0;
|
||||
|
||||
while ( !xmlLiteParser->nextTagIsClosingTag("dict") )
|
||||
{
|
||||
// RETURN_IF_FALSE( xmlLiteParser->getKeyTagValue(&keyValue, &keyValueLength, &keyPos, true) );
|
||||
// xmlSubPath = xmlPath;
|
||||
// xmlSubPath.S8Catf("/%.*s", (int)keyValueLength, keyValue);
|
||||
//
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
XmlParserPosition valuePos = xmlLiteParser->getPosition();
|
||||
(void)valuePos;
|
||||
#endif
|
||||
// XBool keyFound;
|
||||
// XmlAbstractType& xmlAbstractType = parseValueFromXmlLite(xmlLiteParser, xmlSubPath, generateErrors, keyPos, keyValue, keyValueLength, &keyFound);
|
||||
|
||||
XmlParserPosition keyPos = xmlLiteParser->getPosition();
|
||||
|
||||
XString8 xmlSubPath = xmlPath;
|
||||
@ -223,42 +211,6 @@ XmlParserPosition valuePos = xmlLiteParser->getPosition();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
//template <class _Tp> struct _XmlRepeatingDict_has_ValueType { typedef void Typp; };
|
||||
//
|
||||
//template<class XmlValueType, typename T = void>
|
||||
//class XmlRepeatingDict : public _XmlRepeatingDict<XmlValueType, XmlValueType>
|
||||
//{
|
||||
// using super = _XmlRepeatingDict<XmlValueType, XmlValueType>;
|
||||
//
|
||||
// virtual void addValue(XmlValueType* xmlValueType) {
|
||||
// super::arrayValue().AddReference(xmlValueType, true);
|
||||
// }
|
||||
//};
|
||||
//
|
||||
//template<class XmlValueType>
|
||||
//class XmlRepeatingDict<XmlValueType, typename _XmlRepeatingDict_has_ValueType<typename XmlValueType::ValueType>::Typp> : public _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>
|
||||
//{
|
||||
// using super = _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>;
|
||||
//
|
||||
// virtual void addValue(XmlValueType* xmlValueType) {
|
||||
// super::arrayValue().AddCopy(xmlValueType->value());
|
||||
// delete xmlValueType; // TODO improve to avoid memory allocation. At least use stealValueFrom
|
||||
// }
|
||||
//};
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class _Tp> _Tp&& __declval(int);
|
||||
template <class _Tp> _Tp __declval(long);
|
||||
|
||||
@ -290,17 +242,6 @@ class XmlRepeatingDict : public _XmlRepeatingDict<typename XmlAddKeyType::keyTyp
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
//template<class XmkKeyType, class XmlValueType, typename T = void, typename U = void>
|
||||
//class XmlRepeatingDict : public _XmlRepeatingDict<XmkKeyType, XmlValueType, XmlValueType>
|
||||
//{
|
||||
//// using super = _XmlRepeatingDict<XmlValueType, XmlValueType>;
|
||||
////public:
|
||||
//// virtual void addValue(XmlValueType* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
//// super::valueArray.AddReference(xmlValueType, true);
|
||||
//// }
|
||||
//};
|
||||
|
||||
template<class XmkKeyType, class XmlValueType>
|
||||
class XmlRepeatingDict<XmlAddKey<XmkKeyType, XmlValueType>> : public _XmlRepeatingDict<XmkKeyType, XmlAddKey<XmkKeyType, XmlValueType>, XmlAddKey<XmkKeyType, XmlValueType>>
|
||||
{
|
||||
@ -312,125 +253,4 @@ class XmlRepeatingDict<XmlAddKey<XmkKeyType, XmlValueType>> : public _XmlRepeati
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
//template<class XmlValueType>
|
||||
//class XmlRepeatingDict<XmlValueType,
|
||||
// typename __xmldict__declare_void<typename XmlValueType::ValueType>::Typp
|
||||
// >
|
||||
// : public _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>
|
||||
//{
|
||||
// using super = _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>;
|
||||
//// decltype(declval<XmlValueType>().setKey()) a;
|
||||
//
|
||||
// virtual void addValue(XmlValueType* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
// super::valueArray.AddCopy(xmlValueType->value(), true);
|
||||
// delete xmlValueType;
|
||||
// }
|
||||
//};
|
||||
//
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//template<class XmlClass>
|
||||
//class XmlAddKey<XmlClass, typename __xmldict__declare_void<typename XmlClass::ValueType>::Typp> : public XmlClass
|
||||
//{
|
||||
// using super = XmlClass;
|
||||
// private:
|
||||
// XString8 m_key;
|
||||
//// using ValueType = MyXmlAddKey<XmlClass>;
|
||||
//
|
||||
// public:
|
||||
// virtual void setKey(const char* keyValue, size_t keyValueLength) {
|
||||
// m_key.strncpy(keyValue, keyValueLength);
|
||||
// }
|
||||
// const XString8& key() const { return m_key; }
|
||||
// const typename XmlClass::ValueType& value() const { return super::value(); }
|
||||
//
|
||||
//// template<class OtherXStringArrayClass>
|
||||
//// XBool operator ==(const OtherXStringArrayClass &aXStrings) const { return super::operator ==(aXStrings); }
|
||||
//// template<class OtherXStringArrayClass>
|
||||
//// XBool operator !=(const OtherXStringArrayClass &aXStrings) const { return super::operator !=(aXStrings); }
|
||||
//
|
||||
//};
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//template<class XmlValueType, typename T = void, typename U = void>
|
||||
//class XmlRepeatingDict : public _XmlRepeatingDict<XmlValueType, XmlValueType>
|
||||
//{
|
||||
// using super = _XmlRepeatingDict<XmlValueType, XmlValueType>;
|
||||
//public:
|
||||
// virtual void addValue(XmlValueType* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
// super::arrayValue().AddReference(xmlValueType, true);
|
||||
// }
|
||||
//};
|
||||
//
|
||||
//template<class XmlValueType>
|
||||
//class XmlRepeatingDict<XmlValueType,
|
||||
// typename __xmldict__declare_void<typename XmlValueType::ValueType>::Typp
|
||||
// >
|
||||
// : public _XmlRepeatingDict<XmlAddKey<XmlValueType>, XmlAddKey<XmlValueType>>
|
||||
//{
|
||||
// using super = _XmlRepeatingDict<XmlAddKey<XmlValueType>, XmlAddKey<XmlValueType>>;
|
||||
//// decltype(declval<XmlValueType>().setKey()) a;
|
||||
//
|
||||
// virtual void addValue(XmlAddKey<XmlValueType>* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
//// super::arrayValue().AddCopy(xmlValueType->value());
|
||||
//// delete xmlValueType; // TODO improve to avoid memory allocation. At least use stealValueFrom
|
||||
// xmlValueType->setKey(keyValue, keyLength);
|
||||
// super::valueArray.AddReference(xmlValueType, true);
|
||||
// }
|
||||
//};
|
||||
//
|
||||
////
|
||||
////template<class XmlValueType>
|
||||
////class XmlRepeatingDict<XmlAddKey<XmlValueType>>
|
||||
//// : public _XmlRepeatingDict<XmlAddKey<XmlValueType>, XmlAddKey<XmlValueType>>
|
||||
////{
|
||||
//// using super = _XmlRepeatingDict<XmlAddKey<XmlValueType>, XmlAddKey<XmlValueType>>;
|
||||
////public:
|
||||
////
|
||||
////// decltype(declval<XmlValueType>().setKey()) a;
|
||||
//// XString8Array keyArray = XString8Array();
|
||||
////
|
||||
//// virtual void addValue(XmlAddKey<XmlValueType>* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
//// xmlValueType->setKey(keyValue, keyLength);
|
||||
//// super::valueArray.AddReference(xmlValueType, true);
|
||||
//// }
|
||||
////};
|
||||
////
|
||||
////
|
||||
//
|
||||
//
|
||||
//
|
||||
////
|
||||
////
|
||||
////template<class XmlValueType>
|
||||
////class XmlRepeatingDict<XmlValueType,
|
||||
//// typename __xmldict__declare_void<typename XmlValueType::ValueType>::Typp,
|
||||
//// typename __xmldict__declare_void<decltype(XmlValueType().setKey(declval<const char*>(), declval<size_t>()))>::Typp
|
||||
//// >
|
||||
//// : public _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>
|
||||
////{
|
||||
//// using super = _XmlRepeatingDict<XmlValueType, typename XmlValueType::ValueType>;
|
||||
////public:
|
||||
////
|
||||
////// decltype(declval<XmlValueType>().setKey()) a;
|
||||
//// XString8Array keyArray = XString8Array();
|
||||
////
|
||||
//// virtual void addValue(XmlValueType* xmlValueType, const char* keyValue, size_t keyLength) {
|
||||
////// super::arrayValue().AddCopy(xmlValueType->value());
|
||||
////// keyArray.Add();
|
||||
//// delete xmlValueType; // TODO improve to avoid memory allocation. At least use stealValueFrom
|
||||
//// }
|
||||
////};
|
||||
////
|
||||
//
|
||||
|
||||
|
||||
#endif /* XmlLiteCompositeTypes_h */
|
||||
|
@ -83,11 +83,7 @@ char XmlLiteParser::getchar()
|
||||
|
||||
char XmlLiteParser::moveForward()
|
||||
{
|
||||
// if ( getchar() == 0 ) {
|
||||
if ( currentPos.p >= p_end ) {
|
||||
if ( currentPos.p > p_end ) {
|
||||
panic("BUG in xmlLiteParser. Went past the end.");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if ( getchar() == '\n' ) {
|
||||
@ -231,7 +227,6 @@ XBool XmlLiteParser::getNextTag(const char** tag, size_t* length, XBool* isOpeni
|
||||
}
|
||||
*length = size_t(currentPos.p - *tag);
|
||||
moveForward();
|
||||
// moveForwardUntilSignificant();
|
||||
return true;
|
||||
}else
|
||||
if ( getchar() == '/' ) {
|
||||
@ -252,7 +247,6 @@ XBool XmlLiteParser::getNextTag(const char** tag, size_t* length, XBool* isOpeni
|
||||
return false;
|
||||
}
|
||||
moveForward();
|
||||
// moveForwardUntilSignificant();
|
||||
*isOpeningTag = false;
|
||||
*isClosingTag = true;
|
||||
return true;
|
||||
|
@ -2271,35 +2271,14 @@ STATIC void AddCustomSubEntry(REFIT_VOLUME *Volume,
|
||||
IN const XStringW& DefaultEntrySettings,
|
||||
IN REFIT_MENU_SCREEN *SubMenu)
|
||||
{
|
||||
// UINTN VolumeIndex;
|
||||
// REFIT_VOLUME *Volume;
|
||||
// REFIT_DIR_ITER SIter;
|
||||
// REFIT_DIR_ITER *Iter = &SIter;
|
||||
// CHAR16 PartUUID[40];
|
||||
// XStringW CustomPath = _CustomPath;
|
||||
|
||||
if ( CustomPath.isEmpty() ) panic("BUG : CustomPath is empty");
|
||||
if ( SubMenu == NULL ) panic("BUG : this must be a sub entry");
|
||||
|
||||
// if (FindCustomPath && (Custom.settings.Type != OSTYPE_LINEFI) && (Custom.settings.Type != OSTYPE_LIN)) {
|
||||
//// DBG("Custom %lsentry %llu skipped because it didn't have a ", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
//// if (Custom.Type == 0) {
|
||||
//// DBG("Type.\n");
|
||||
//// } else {
|
||||
//// DBG("Path.\n");
|
||||
//// }
|
||||
// return;
|
||||
// }
|
||||
if ( CustomPath.isEmpty() ) return;
|
||||
if ( SubMenu == NULL ) return;
|
||||
|
||||
if ( Custom.settings.Disabled ) {
|
||||
// DBG("Custom %lsentry %llu skipped because it is disabled.\n", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom.settings.Flags, OSFLAG_HIDDEN)) {
|
||||
// DBG("Custom %lsentry %llu skipped because it is hidden.\n", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
// return;
|
||||
// }
|
||||
|
||||
#if 0 //if someone want to debug this
|
||||
DBG("Custom %lsentry %llu ", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
@ -2343,51 +2322,11 @@ STATIC void AddCustomSubEntry(REFIT_VOLUME *Volume,
|
||||
parentType, newCustomFlags, 0, {0,0,0,0}, 0, NullXImage,
|
||||
/*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, true);
|
||||
if (Entry != NULL) {
|
||||
// if ( Custom.settings.Settings.notEmpty() ) DBG("Custom settings: %ls.plist will %s be applied\n", Custom.settings.Settings.wc_str(), Custom.settings.CommonSettings?"not":"");
|
||||
// if (!Custom.settings.CommonSettings) {
|
||||
// Entry->Settings = DefaultEntrySettings;
|
||||
// }
|
||||
if (OSFLAG_ISUNSET(newCustomFlags, OSFLAG_NODEFAULTMENU)) {
|
||||
Entry->AddDefaultMenu();
|
||||
// } else if (Custom.SubEntries.notEmpty()) {
|
||||
// UINTN CustomSubIndex = 0;
|
||||
// // Add subscreen
|
||||
// REFIT_MENU_SCREEN *SubScreen = new REFIT_MENU_SCREEN;
|
||||
// SubScreen->Title.SWPrintf("Boot Options for %ls on %ls", (Custom.settings.Title.notEmpty()) ? Custom.settings.Title.wc_str() : CustomPath.wc_str(), Entry->DisplayedVolName.wc_str());
|
||||
// SubScreen->TitleImage = Entry->Image;
|
||||
// SubScreen->ID = Custom.settings.Type + 20;
|
||||
// SubScreen->GetAnime();
|
||||
// VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20);
|
||||
// SubScreen->AddMenuInfoLine_f("Volume size: %lldMb", VolumeSize);
|
||||
// SubScreen->AddMenuInfoLine_f("%ls", FileDevicePathToXStringW(Entry->DevicePath).wc_str());
|
||||
// if (Guid) {
|
||||
// SubScreen->AddMenuInfoLine_f("UUID: %s", Guid.toXString8().c_str());
|
||||
// }
|
||||
// SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.ConcatAll(" "_XS8).c_str());
|
||||
// DBG("Create sub entries\n");
|
||||
// for (size_t CustomSubEntryIndex = 0 ; CustomSubEntryIndex < Custom.SubEntries.size() ; ++CustomSubEntryIndex ) {
|
||||
// const CUSTOM_LOADER_SUBENTRY& CustomSubEntry = Custom.SubEntries[CustomSubEntryIndex];
|
||||
// if ( CustomSubEntry.settings.Settings.isEmpty() ) {
|
||||
// AddCustomSubEntry(Volume, CustomSubIndex++, CustomSubEntry.settings.Path.notEmpty() ? CustomSubEntry.settings.Path : CustomPath, CustomSubEntry, Custom.settings.Settings, SubScreen);
|
||||
// }else{
|
||||
// AddCustomSubEntry(Volume, CustomSubIndex++, CustomSubEntry.settings.Path.notEmpty() ? CustomSubEntry.settings.Path : CustomPath, CustomSubEntry, CustomSubEntry.settings.Settings, SubScreen);
|
||||
// }
|
||||
// }
|
||||
// SubScreen->AddMenuEntry(&MenuEntryReturn, true);
|
||||
// Entry->SubScreen = SubScreen;
|
||||
}
|
||||
SubMenu->AddMenuEntry(Entry, true);
|
||||
// Entry->Hidden = Custom.settings.Hidden;
|
||||
// if ( Custom.settings.Hidden ) DBG(" hiding entry because Custom.settings.Hidden\n");
|
||||
}
|
||||
// } while (FindCustomPath && Custom.settings.Type == OSTYPE_LINEFI && Custom.settings.KernelScan == KERNEL_SCAN_ALL); // repeat loop only for kernel scanning
|
||||
|
||||
// // Close the kernel boot directory
|
||||
// if (FindCustomPath && Custom.settings.Type == OSTYPE_LINEFI) {
|
||||
// DirIterClose(Iter);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
STATIC void AddCustomEntry(IN UINTN CustomIndex,
|
||||
@ -2421,10 +2360,6 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom.settings.Flags, OSFLAG_HIDDEN)) {
|
||||
// DBG("Custom %lsentry %llu skipped because it is hidden.\n", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
// return;
|
||||
// }
|
||||
|
||||
#if 0 //if someone want to debug this
|
||||
DBG("Custom %lsentry %llu ", IsSubEntry ? L"sub " : L"", CustomIndex);
|
||||
@ -2733,19 +2668,12 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
|
||||
DBG("Create sub entries\n");
|
||||
for (size_t CustomSubEntryIndex = 0 ; CustomSubEntryIndex < Custom.SubEntries.size() ; ++CustomSubEntryIndex ) {
|
||||
const CUSTOM_LOADER_SUBENTRY& CustomSubEntry = Custom.SubEntries[CustomSubEntryIndex];
|
||||
// if ( CustomSubEntry.settings.Settings.isEmpty() ) {
|
||||
AddCustomSubEntry(Volume, CustomSubIndex++, Custom.settings.Path.notEmpty() ? Custom.settings.Path : CustomPath, Custom.settings.Type, CustomSubEntry, Custom.settings.Settings, SubScreen);
|
||||
// }else{
|
||||
// AddCustomSubEntry(Volume, CustomSubIndex++, CustomSubEntry.settings.Path.notEmpty() ? CustomSubEntry.settings.Path : CustomPath, CustomSubEntry, CustomSubEntry.settings.Settings, SubScreen);
|
||||
// }
|
||||
AddCustomSubEntry(Volume, CustomSubIndex++, Custom.settings.Path.notEmpty() ? Custom.settings.Path : CustomPath, Custom.settings.Type, CustomSubEntry, Custom.settings.Settings, SubScreen);
|
||||
}
|
||||
SubScreen->AddMenuEntry(&MenuEntryReturn, true);
|
||||
Entry->SubScreen = SubScreen;
|
||||
}
|
||||
// if (IsSubEntry)
|
||||
// SubMenu->AddMenuEntry(Entry, true);
|
||||
// else
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
|
||||
Entry->Hidden = Custom.settings.Hidden;
|
||||
if ( Custom.settings.Hidden ) DBG(" hiding entry because Custom.settings.Hidden\n");
|
||||
|
Loading…
Reference in New Issue
Block a user