mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-09-21 02:51:04 +02:00
Do not display config info messages at launch.
This commit is contained in:
parent
ab67345877
commit
e036b3d54b
@ -1 +1 @@
|
||||
Subproject commit 19492cb6eb33f045ef4401abaaa89f48db9634ca
|
||||
Subproject commit daae4a2c806f50cf3697ebf092ace044d3128e45
|
@ -58,6 +58,7 @@ extern "C" int main(int argc, const char * argv[])
|
||||
path = "config-nowarning-noerror.plist";
|
||||
path = "config-test2.plist";
|
||||
path = "/JiefLand/5.Devel/Clover/user config/mifjpn/2021-10-22/config.plist";
|
||||
path = "/Volumes/CL_EFI_VMDK/EFI/CLOVER/config.plist";
|
||||
//path = "/Volumes/CL_EFI_VMDK/EFI/CLOVER/smbios.plist";
|
||||
#endif
|
||||
|
||||
@ -105,6 +106,7 @@ extern "C" int main(int argc, const char * argv[])
|
||||
printf("%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
b = false;
|
||||
}else{
|
||||
printf("%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
// One day, create a command line option to display info messages.
|
||||
}
|
||||
}
|
||||
|
@ -1150,7 +1150,7 @@ XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& v
|
||||
{
|
||||
return compareBiosVersion(version1, version2) <= 0;
|
||||
}
|
||||
XBool isBiosVersionEquel(const XString8& version1, const XString8& version2)
|
||||
XBool is2ndBiosVersionEqual(const XString8& version1, const XString8& version2)
|
||||
{
|
||||
return compareBiosVersion(version1, version2) == 0;
|
||||
}
|
||||
|
@ -626,7 +626,7 @@ void getRPlt(MacModel Model, UINT32 CPUModel, XBool isMobile, char RPlt[8]);
|
||||
|
||||
int compareBiosVersion(const XString8& version1, const XString8& version2);
|
||||
XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2);
|
||||
XBool isBiosVersionEquel(const XString8& version1, const XString8& version2);
|
||||
XBool is2ndBiosVersionEqual(const XString8& version1, const XString8& version2);
|
||||
|
||||
int compareReleaseDate(const XString8& date1, const XString8& date2);
|
||||
|
||||
|
@ -525,15 +525,17 @@ EFI_STATUS LoadPlist(const XStringW& ConfName, C* plist)
|
||||
|
||||
XmlLiteParser xmlLiteParser;
|
||||
XBool parsingOk = plist->parse((const CHAR8*)ConfigPtr, Size, ""_XS8, &xmlLiteParser);
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() ) {
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() > 1 ) {
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 0 ) {
|
||||
if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 1 ) {
|
||||
DebugLog(2, "There are problems in plist '%ls'\n", configPlistPath.wc_str());
|
||||
}else{
|
||||
DebugLog(2, "There is a problem in plist '%ls'\n", configPlistPath.wc_str());
|
||||
}
|
||||
for ( size_t idx = 0 ; idx < xmlLiteParser.getXmlParserMessageArray().size() ; idx++ ) {
|
||||
const XmlParserMessage& xmlMsg = xmlLiteParser.getXmlParserMessageArray()[idx];
|
||||
DebugLog(2, "%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
if ( xmlMsg.type != XmlParserMessageType::info ) {
|
||||
DebugLog(2, "%s\n", xmlMsg.getFormattedMsg().c_str());
|
||||
}
|
||||
}
|
||||
DebugLog(2, "Use CloverConfigPlistValidator or look in the log\n");
|
||||
}
|
||||
@ -542,7 +544,7 @@ EFI_STATUS LoadPlist(const XStringW& ConfName, C* plist)
|
||||
Status = EFI_LOAD_ERROR;
|
||||
}
|
||||
|
||||
if ( !parsingOk || xmlLiteParser.getXmlParserMessageArray().size() > 0 ) gBS->Stall(3000000); // 3 seconds delay
|
||||
if ( !parsingOk || xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 0 ) gBS->Stall(3000000); // 3 seconds delay
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -509,13 +509,17 @@ public:
|
||||
if ( !is2ndBiosVersionGreaterThan1st(ApplePlatformDataArray[getModel()].firmwareVersion, BiosVersion.value()) ) {
|
||||
xmlLiteParser->addWarning(generateErrors, S8Printf("BiosVersion '%s' is before than default ('%s') -> ignored. Dict '%s:%d'.", BiosVersion.value().c_str(), ApplePlatformDataArray[getModel()].firmwareVersion.c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
BiosVersion.reset();
|
||||
}else
|
||||
if ( is2ndBiosVersionEqual(ApplePlatformDataArray[getModel()].firmwareVersion, BiosVersion.value()) ) {
|
||||
xmlLiteParser->addInfo(generateErrors, S8Printf("BiosVersion '%s' is the same as default. Dict '%s:%d'.", BiosVersion.value().c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
BiosVersion.reset();
|
||||
}
|
||||
}
|
||||
if ( BiosReleaseDate.isDefined() ) {
|
||||
int compareReleaseDateResult = compareReleaseDate(GetReleaseDate(getModel()), BiosReleaseDate.value());
|
||||
if ( compareReleaseDateResult == 0 ) {
|
||||
// This is just 'info'. It's useless but fine to define the same as default.
|
||||
xmlLiteParser->addInfo(generateErrors, S8Printf("BiosReleaseDate '%s' is the same as default ('%s') -> ignored. Dict '%s:%d'.", BiosReleaseDate.value().c_str(), GetReleaseDate(getModel()).c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
xmlLiteParser->addInfo(generateErrors, S8Printf("BiosReleaseDate '%s' is the same as default. Dict '%s:%d'.", BiosReleaseDate.value().c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
BiosReleaseDate.reset();
|
||||
}else
|
||||
if ( compareReleaseDateResult == 1 ) {
|
||||
@ -528,7 +532,7 @@ public:
|
||||
xmlLiteParser->addWarning(generateErrors, S8Printf("EfiVersion '%s' is older than default ('%s') -> ignored. Dict '%s:%d'.", EfiVersion.value().c_str(), ApplePlatformDataArray[dgetModel()].efiversion.c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
EfiVersion.reset();
|
||||
} else if (AsciiStrVersionToUint64(ApplePlatformDataArray[dgetModel()].efiversion, 4, 5) == AsciiStrVersionToUint64(EfiVersion.value(), 4, 5)) {
|
||||
xmlLiteParser->addInfo(generateErrors, S8Printf("EfiVersion '%s' is the same as default ('%s') -> ignored. Dict '%s:%d'.", EfiVersion.value().c_str(), ApplePlatformDataArray[dgetModel()].efiversion.c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
xmlLiteParser->addInfo(generateErrors, S8Printf("EfiVersion '%s' is the same as default. Dict '%s:%d'.", EfiVersion.value().c_str(), xmlPath.c_str(), keyPos.getLine())); // Do not set b to false : we don't want to invalidate the whole dict
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
int getLine() { return currentPos.line; }
|
||||
int getCol() { return currentPos.col; }
|
||||
XObjArray<XmlParserMessage>& getXmlParserMessageArray() { return errorsAndWarnings; }
|
||||
size_t getXmlParserInfoMessageCount() const { size_t n=0 ; for ( size_t i=0 ; i < errorsAndWarnings.size() ; i++ ) if ( errorsAndWarnings[i].type == XmlParserMessageType::info ) ++n; return n; }
|
||||
// Add warning, error and xml error always return false so you can return addWarning(...) from validate function
|
||||
XBool addInfo(XBool generateErrors, const XString8& warning) { if ( generateErrors ) AddXmlParserMessage(new XmlParserMessage(XmlParserMessageType::info, warning)); return false; }
|
||||
XBool addWarning(XBool generateErrors, const XString8& warning) { if ( generateErrors ) AddXmlParserMessage(new XmlParserMessage(XmlParserMessageType::warning, warning)); return false; }
|
||||
|
@ -1857,6 +1857,9 @@ static void ScanDriverDir(IN CONST CHAR16 *Path, OUT EFI_HANDLE **DriversToConne
|
||||
continue;
|
||||
}
|
||||
if ( LStringW(DirEntry->FileName).containsIC("OpenRuntime") ) {
|
||||
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v12.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.7.5") ) {
|
||||
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
|
||||
}else
|
||||
if ( LStringW(DirEntry->FileName).isEqualIC("OpenRuntime-v12.efi") && LString8(OPEN_CORE_VERSION).isEqual("0.7.3") ) {
|
||||
OpenRuntimeEfiName.takeValueFrom(DirEntry->FileName);
|
||||
}else
|
||||
|
Loading…
Reference in New Issue
Block a user