mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-23 16:17:40 +01:00
DSDT Patches refactor as an array of object.
Entry->VolName renamed Entry->DisplayedVolName because VolName already exits in the hierarchie.
This commit is contained in:
parent
a721bb0a29
commit
e9f0f8ccd8
@ -45,7 +45,6 @@
|
||||
9A105B6924483AE40006DE06 /* APFS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4624483AE30006DE06 /* APFS.cpp */; };
|
||||
9A105B6A24483AE40006DE06 /* stdlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A105B4824483AE30006DE06 /* stdlib.h */; };
|
||||
9A105B6B24483AE40006DE06 /* limits.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A105B4924483AE30006DE06 /* limits.h */; };
|
||||
9A105B6C24483AE40006DE06 /* strcmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4A24483AE30006DE06 /* strcmp.cpp */; };
|
||||
9A105B6D24483AE40006DE06 /* stddef.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A105B4B24483AE30006DE06 /* stddef.h */; };
|
||||
9A105B6E24483AE40006DE06 /* stdio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4C24483AE30006DE06 /* stdio.cpp */; };
|
||||
9A105B6F24483AE40006DE06 /* abort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4D24483AE30006DE06 /* abort.cpp */; };
|
||||
@ -162,14 +161,13 @@
|
||||
9A36E5DD24F56274007A1107 /* pure_virtual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A36E5DC24F56274007A1107 /* pure_virtual.cpp */; };
|
||||
9A36E5DE24F56274007A1107 /* pure_virtual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A36E5DC24F56274007A1107 /* pure_virtual.cpp */; };
|
||||
9A36E5DF24F56274007A1107 /* pure_virtual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A36E5DC24F56274007A1107 /* pure_virtual.cpp */; };
|
||||
9A36E5E124F7EF20007A1107 /* string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A36E5E024F7EF20007A1107 /* string.cpp */; };
|
||||
9A4185B62439F29D00BEAFB8 /* LoadOptions_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A4185B42439F29D00BEAFB8 /* LoadOptions_test.h */; };
|
||||
9A4185B72439F29D00BEAFB8 /* LoadOptions_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A4185B42439F29D00BEAFB8 /* LoadOptions_test.h */; };
|
||||
9A4185B82439F29D00BEAFB8 /* LoadOptions_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A4185B42439F29D00BEAFB8 /* LoadOptions_test.h */; };
|
||||
9A4185BA2439F29D00BEAFB8 /* LoadOptions_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4185B52439F29D00BEAFB8 /* LoadOptions_test.cpp */; };
|
||||
9A4185BB2439F29D00BEAFB8 /* LoadOptions_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4185B52439F29D00BEAFB8 /* LoadOptions_test.cpp */; };
|
||||
9A4185BC2439F29D00BEAFB8 /* LoadOptions_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4185B52439F29D00BEAFB8 /* LoadOptions_test.cpp */; };
|
||||
9A4F68532449D4AB004B2F7E /* strcmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4A24483AE30006DE06 /* strcmp.cpp */; };
|
||||
9A4F68542449D4AB004B2F7E /* strcmp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4A24483AE30006DE06 /* strcmp.cpp */; };
|
||||
9A4F68562449D4AE004B2F7E /* stdio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4C24483AE30006DE06 /* stdio.cpp */; };
|
||||
9A4F68572449D4AE004B2F7E /* stdio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4C24483AE30006DE06 /* stdio.cpp */; };
|
||||
9A4F68592449D4B4004B2F7E /* abort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A105B4D24483AE30006DE06 /* abort.cpp */; };
|
||||
@ -716,7 +714,6 @@
|
||||
9A105B4624483AE30006DE06 /* APFS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APFS.cpp; sourceTree = "<group>"; };
|
||||
9A105B4824483AE30006DE06 /* stdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdlib.h; sourceTree = "<group>"; };
|
||||
9A105B4924483AE30006DE06 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = "<group>"; };
|
||||
9A105B4A24483AE30006DE06 /* strcmp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strcmp.cpp; sourceTree = "<group>"; };
|
||||
9A105B4B24483AE30006DE06 /* stddef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stddef.h; sourceTree = "<group>"; };
|
||||
9A105B4C24483AE30006DE06 /* stdio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdio.cpp; sourceTree = "<group>"; };
|
||||
9A105B4D24483AE30006DE06 /* abort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = abort.cpp; sourceTree = "<group>"; };
|
||||
@ -775,6 +772,7 @@
|
||||
9A36E5D424F56261007A1107 /* plist_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plist_tests.cpp; sourceTree = "<group>"; };
|
||||
9A36E5D524F56261007A1107 /* plist_tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plist_tests.h; sourceTree = "<group>"; };
|
||||
9A36E5DC24F56274007A1107 /* pure_virtual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pure_virtual.cpp; sourceTree = "<group>"; };
|
||||
9A36E5E024F7EF20007A1107 /* string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string.cpp; sourceTree = "<group>"; };
|
||||
9A4185B42439F29D00BEAFB8 /* LoadOptions_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadOptions_test.h; sourceTree = "<group>"; };
|
||||
9A4185B52439F29D00BEAFB8 /* LoadOptions_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadOptions_test.cpp; sourceTree = "<group>"; };
|
||||
9A63C6CA24EBEF78000EB836 /* Version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Version.h; path = ../../Version.h; sourceTree = "<group>"; };
|
||||
@ -989,6 +987,7 @@
|
||||
9A105B4724483AE30006DE06 /* Posix */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9A36E5E024F7EF20007A1107 /* string.cpp */,
|
||||
9A105B4D24483AE30006DE06 /* abort.cpp */,
|
||||
9AC77FA924176C04005CDD5C /* abort.h */,
|
||||
9A105B4924483AE30006DE06 /* limits.h */,
|
||||
@ -999,7 +998,6 @@
|
||||
9A105B4C24483AE30006DE06 /* stdio.cpp */,
|
||||
9A105B5224483AE30006DE06 /* stdio.h */,
|
||||
9A105B4824483AE30006DE06 /* stdlib.h */,
|
||||
9A105B4A24483AE30006DE06 /* strcmp.cpp */,
|
||||
9A105B5524483AE30006DE06 /* string.h */,
|
||||
9A105B5124483AE30006DE06 /* strlen.cpp */,
|
||||
9A105B4E24483AE30006DE06 /* wchar.cpp */,
|
||||
@ -1937,6 +1935,7 @@
|
||||
9AC7806524176C04005CDD5C /* securevars.cpp in Sources */,
|
||||
9AC7807024176C04005CDD5C /* loader.cpp in Sources */,
|
||||
9AC77FC224176C04005CDD5C /* XObjArray_tests.cpp in Sources */,
|
||||
9A36E5E124F7EF20007A1107 /* string.cpp in Sources */,
|
||||
9AC7808224176C04005CDD5C /* memory.cpp in Sources */,
|
||||
9AC7803B24176C04005CDD5C /* cpu.cpp in Sources */,
|
||||
9AC7800124176C04005CDD5C /* LegacyBoot.cpp in Sources */,
|
||||
@ -1952,7 +1951,6 @@
|
||||
9AC7803724176C04005CDD5C /* device_inject.cpp in Sources */,
|
||||
9AC7804224176C04005CDD5C /* Settings.cpp in Sources */,
|
||||
9A0986372438A15400826276 /* shared_with_menu.cpp in Sources */,
|
||||
9A105B6C24483AE40006DE06 /* strcmp.cpp in Sources */,
|
||||
9AC7805F24176C04005CDD5C /* legacy.cpp in Sources */,
|
||||
9AC7800924176C04005CDD5C /* AcpiPatcher.cpp in Sources */,
|
||||
9AC7800D24176C04005CDD5C /* BdsConnect.cpp in Sources */,
|
||||
@ -2043,7 +2041,6 @@
|
||||
9A01499A244091B200B37399 /* printlib-test.cpp in Sources */,
|
||||
9AF4160C242CD75C00D2644C /* XPointer.cpp in Sources */,
|
||||
9AF4160D242CD75C00D2644C /* strncmp_test.cpp in Sources */,
|
||||
9A4F68532449D4AB004B2F7E /* strcmp.cpp in Sources */,
|
||||
9AF41610242CD75C00D2644C /* sound.cpp in Sources */,
|
||||
9AF41611242CD75C00D2644C /* usbfix.cpp in Sources */,
|
||||
9AF41612242CD75C00D2644C /* BmLib.cpp in Sources */,
|
||||
@ -2167,7 +2164,6 @@
|
||||
9A01499B244091B300B37399 /* printlib-test.cpp in Sources */,
|
||||
9AF416E9242CDA5800D2644C /* XPointer.cpp in Sources */,
|
||||
9AF416EA242CDA5800D2644C /* strncmp_test.cpp in Sources */,
|
||||
9A4F68542449D4AB004B2F7E /* strcmp.cpp in Sources */,
|
||||
9AF416ED242CDA5800D2644C /* sound.cpp in Sources */,
|
||||
9AF416EE242CDA5800D2644C /* usbfix.cpp in Sources */,
|
||||
9AF416EF242CDA5800D2644C /* BmLib.cpp in Sources */,
|
||||
|
@ -439,34 +439,31 @@ VOID PatchAllTables()
|
||||
}
|
||||
}
|
||||
if (NewTable->Signature == EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
|
||||
if (gSettings.PatchDsdtNum > 0) {
|
||||
DBG("Patching SSDTs: %d patches each\n", gSettings.PatchDsdtNum);
|
||||
if (gSettings.DSDTPatchArray.size() > 0) {
|
||||
DBG("Patching SSDTs: %zu patches each\n", gSettings.DSDTPatchArray.size());
|
||||
|
||||
// CHAR8 OTID[9];
|
||||
// OTID[8] = 0;
|
||||
// CopyMem(OTID, &NewTable->OemTableId, 8);
|
||||
// DBG("Patching SSDT %s Length=%d\n", OTID, (INT32)Len);
|
||||
|
||||
for (UINT32 i = 0; i < gSettings.PatchDsdtNum; i++) {
|
||||
if (!gSettings.PatchDsdtFind[i] || !gSettings.LenToFind[i]) {
|
||||
for (UINT32 i = 0; i < gSettings.DSDTPatchArray.size(); i++) {
|
||||
if ( gSettings.DSDTPatchArray[i].PatchDsdtFind.isEmpty() ) {
|
||||
continue;
|
||||
}
|
||||
// DBG("%d. [%s]:", i, gSettings.PatchDsdtLabel[i]);
|
||||
if (!gSettings.PatchDsdtMenuItem[i].BValue) {
|
||||
if (!gSettings.DSDTPatchArray[i].PatchDsdtMenuItem.BValue) {
|
||||
// DBG(" disabled\n");
|
||||
continue;
|
||||
}
|
||||
if (!gSettings.PatchDsdtTgt[i]) {
|
||||
if ( gSettings.DSDTPatchArray[i].PatchDsdtTgt.notEmpty() ) {
|
||||
Len = FixAny((UINT8*)NewTable, Len,
|
||||
(const UINT8*)gSettings.PatchDsdtFind[i], gSettings.LenToFind[i],
|
||||
(const UINT8*)gSettings.PatchDsdtReplace[i], gSettings.LenToReplace[i]);
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtFind,
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtReplace);
|
||||
//DBG(" OK\n");
|
||||
}else{
|
||||
//DBG("Patching: renaming in bridge\n");
|
||||
Len = FixRenameByBridge2((UINT8*)NewTable, Len,
|
||||
gSettings.PatchDsdtTgt[i],
|
||||
(const UINT8*)gSettings.PatchDsdtFind[i], gSettings.LenToFind[i],
|
||||
(const UINT8*)gSettings.PatchDsdtReplace[i], gSettings.LenToReplace[i]);
|
||||
Len = FixRenameByBridge2((UINT8*)NewTable, Len, gSettings.DSDTPatchArray[i].PatchDsdtTgt, gSettings.DSDTPatchArray[i].PatchDsdtFind, gSettings.DSDTPatchArray[i].PatchDsdtReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1338,11 +1338,16 @@ INT32 FindBin (UINT8 *dsdt, UINT32 len, const UINT8* bin, UINT32 N)
|
||||
}
|
||||
}
|
||||
if (eq) {
|
||||
return (INT32)i;
|
||||
return (INT32)i; // TODO that is an usafe cast !!!
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
INT32 FindBin (UINT8 *dsdt, size_t len, const XBuffer<UINT8>& bin) {
|
||||
if ( len > MAX_INT32 ) panic("FindBin : len > MAX_INT32"); // check against INT32, even though parameter of FindBin is UINT32. Because return value is INT32, parameter should not be > MAX_INT32
|
||||
if ( bin.size() > MAX_INT32 ) panic("FindBin : bin.size() > MAX_INT32");
|
||||
return FindBin(dsdt, (UINT32)len, bin.data(), (UINT32)bin.size());
|
||||
}
|
||||
|
||||
//if (!FindMethod(dsdt, len, "DTGP"))
|
||||
// return address of size field. Assume size not more then 0x0FFF = 4095 bytes
|
||||
@ -1757,23 +1762,28 @@ UINT32 FixADP1 (UINT8* dsdt, UINT32 len)
|
||||
return len;
|
||||
}
|
||||
|
||||
UINT32 FixAny (UINT8* dsdt, UINT32 len, const UINT8* ToFind, UINT32 LenTF, const UINT8* ToReplace, UINT32 LenTR)
|
||||
UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer<UINT8> ToFind, const XBuffer<UINT8> ToReplace)
|
||||
{
|
||||
INT32 sizeoffset, adr;
|
||||
size_t sizeoffset;
|
||||
INT32 adr;
|
||||
UINT32 i;
|
||||
BOOLEAN found = FALSE;
|
||||
if (!ToFind || !LenTF || !LenTR) {
|
||||
if ( ToFind.isEmpty() || ToReplace.isEmpty() ) {
|
||||
DBG(" invalid patches!\n");
|
||||
return len;
|
||||
}
|
||||
MsgLog(" pattern %02hhX%02hhX%02hhX%02hhX,", ToFind[0], ToFind[1], ToFind[2], ToFind[3]);
|
||||
if ((LenTF + sizeof(EFI_ACPI_DESCRIPTION_HEADER)) > len) {
|
||||
if ((ToFind.size() + sizeof(EFI_ACPI_DESCRIPTION_HEADER)) > len) {
|
||||
MsgLog(" the patch is too large!\n");
|
||||
return len;
|
||||
}
|
||||
sizeoffset = LenTR - LenTF;
|
||||
sizeoffset = ToReplace.size() - ToFind.size();
|
||||
if ( sizeoffset > MAX_INT32 ) {
|
||||
DBG(" invalid patches (sizeoffset > MAX_INT32)!\n");
|
||||
return len;
|
||||
}
|
||||
for (i = 20; i < len; ) {
|
||||
adr = FindBin(dsdt + i, len - i, ToFind, LenTF);
|
||||
adr = FindBin(dsdt + i, len - i, ToFind);
|
||||
if (adr < 0) {
|
||||
if (found) {
|
||||
MsgLog(" ]\n");
|
||||
@ -1790,38 +1800,36 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, const UINT8* ToFind, UINT32 LenTF, const
|
||||
|
||||
// MsgLog(" (%X)", adr);
|
||||
found = TRUE;
|
||||
len = move_data(adr + i, dsdt, len, sizeoffset);
|
||||
if ((LenTR > 0) && (ToReplace != NULL)) {
|
||||
CopyMem(dsdt + adr + i, ToReplace, LenTR);
|
||||
}
|
||||
len = CorrectOuterMethod(dsdt, len, adr + i - 2, sizeoffset);
|
||||
len = CorrectOuters(dsdt, len, adr + i - 3, sizeoffset);
|
||||
i += adr + LenTR;
|
||||
len = move_data(adr + i, dsdt, len, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32
|
||||
CopyMem(dsdt + adr + i, ToReplace.data(), ToReplace.size());
|
||||
len = CorrectOuterMethod(dsdt, len, adr + i - 2, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32
|
||||
len = CorrectOuters(dsdt, len, adr + i - 3, (INT32)sizeoffset); // safe cast, sizeoffset > MAX_INT32
|
||||
i += adr + ToReplace.size();
|
||||
}
|
||||
MsgLog(" ]\n"); //should not be here
|
||||
return len;
|
||||
}
|
||||
|
||||
//new method. by goodwin_c
|
||||
UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, CHAR8* TgtBrgName, const UINT8* ToFind, UINT32 LenTF, const UINT8* ToReplace, UINT32 LenTR)
|
||||
UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, const XString8& TgtBrgName, const XBuffer<UINT8>& ToFind, const XBuffer<UINT8>& ToReplace)
|
||||
{
|
||||
INT32 adr;
|
||||
BOOLEAN found = FALSE;
|
||||
UINT32 i, k;
|
||||
UINT32 BrdADR = 0, BridgeSize;
|
||||
|
||||
if (!ToFind || !LenTF || !LenTR) {
|
||||
if ( ToFind.isEmpty() || ToReplace.isEmpty() ) {
|
||||
DBG(" invalid patches!\n");
|
||||
return len;
|
||||
}
|
||||
|
||||
if (LenTF != LenTR) {
|
||||
if (ToFind.size() != ToReplace.size()) {
|
||||
DBG(" find/replace different size!\n");
|
||||
return len;
|
||||
}
|
||||
|
||||
DBG(" pattern %02hhX%02hhX%02hhX%02hhX,", ToFind[0], ToFind[1], ToFind[2], ToFind[3]);
|
||||
if ((LenTF + sizeof(EFI_ACPI_DESCRIPTION_HEADER)) > len) {
|
||||
if ((ToFind.size() + sizeof(EFI_ACPI_DESCRIPTION_HEADER)) > len) {
|
||||
DBG(" the patch is too large!\n");
|
||||
return len;
|
||||
}
|
||||
@ -1835,12 +1843,12 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, CHAR8* TgtBrgName, const UIN
|
||||
}
|
||||
BridgeSize = get_size(dsdt, BrdADR);
|
||||
if(!BridgeSize) continue;
|
||||
if(BridgeSize <= LenTF) continue;
|
||||
if(BridgeSize <= ToFind.size()) continue;
|
||||
|
||||
k = 0;
|
||||
found = FALSE;
|
||||
while (k <= 100) {
|
||||
adr = FindBin(dsdt + BrdADR, BridgeSize, ToFind, LenTF);
|
||||
adr = FindBin(dsdt + BrdADR, BridgeSize, ToFind);
|
||||
if (adr < 0) {
|
||||
if (found) {
|
||||
DBG(" ]\n");
|
||||
@ -1856,8 +1864,8 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, CHAR8* TgtBrgName, const UIN
|
||||
|
||||
DBG(" (%X)", adr);
|
||||
found = TRUE;
|
||||
if ((LenTR > 0) && (ToReplace != NULL)) {
|
||||
CopyMem(dsdt + BrdADR + adr, ToReplace, LenTR);
|
||||
if ( ToReplace.notEmpty() ) {
|
||||
CopyMem(dsdt + BrdADR + adr, ToReplace.data(), ToReplace.size());
|
||||
}
|
||||
k++;
|
||||
}
|
||||
@ -5344,26 +5352,26 @@ VOID FixBiosDsdt(UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, c
|
||||
CheckHardware();
|
||||
|
||||
//arbitrary fixes
|
||||
if (gSettings.PatchDsdtNum > 0) {
|
||||
if (gSettings.DSDTPatchArray.size() > 0) {
|
||||
MsgLog("Patching DSDT:\n");
|
||||
for (i = 0; i < gSettings.PatchDsdtNum; i++) {
|
||||
if (!gSettings.PatchDsdtFind[i] || !gSettings.LenToFind[i]) {
|
||||
for (i = 0; i < gSettings.DSDTPatchArray.size(); i++) {
|
||||
if ( gSettings.DSDTPatchArray[i].PatchDsdtFind.isEmpty() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MsgLog(" - [%s]:", gSettings.PatchDsdtLabel[i]); //yyyy
|
||||
if (gSettings.PatchDsdtMenuItem[i].BValue) {
|
||||
if (!gSettings.PatchDsdtTgt[i]) {
|
||||
MsgLog(" - [%s]:", gSettings.DSDTPatchArray[i].PatchDsdtLabel.c_str()); //yyyy
|
||||
if (gSettings.DSDTPatchArray[i].PatchDsdtMenuItem.BValue) {
|
||||
if (!gSettings.DSDTPatchArray[i].PatchDsdtTgt[i]) {
|
||||
DsdtLen = FixAny(temp, DsdtLen,
|
||||
(const UINT8*)gSettings.PatchDsdtFind[i], gSettings.LenToFind[i],
|
||||
(const UINT8*)gSettings.PatchDsdtReplace[i], gSettings.LenToReplace[i]);
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtFind,
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtReplace);
|
||||
|
||||
}else{
|
||||
// DBG("Patching: renaming in bridge\n");
|
||||
DsdtLen = FixRenameByBridge2(temp, DsdtLen,
|
||||
gSettings.PatchDsdtTgt[i],
|
||||
(const UINT8*)gSettings.PatchDsdtFind[i], gSettings.LenToFind[i],
|
||||
(const UINT8*)gSettings.PatchDsdtReplace[i], gSettings.LenToReplace[i]);
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtTgt,
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtFind,
|
||||
gSettings.DSDTPatchArray[i].PatchDsdtReplace);
|
||||
|
||||
}
|
||||
} else {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#ifndef PLATFORM_FIXBIOSDSDT_H_
|
||||
#define PLATFORM_FIXBIOSDSDT_H_
|
||||
|
||||
#include "../cpp_foundation/XBuffer.h"
|
||||
|
||||
|
||||
//DSDT fixes MASK
|
||||
@ -79,30 +80,13 @@ FindBin (
|
||||
const UINT8 *Pattern,
|
||||
UINT32 PatternLen
|
||||
);
|
||||
INT32 FindBin (UINT8 *dsdt, size_t len, const XBuffer<UINT8>& bin);
|
||||
|
||||
|
||||
UINT32
|
||||
FixAny (
|
||||
UINT8* dsdt,
|
||||
UINT32 len,
|
||||
const UINT8* ToFind,
|
||||
UINT32 LenTF,
|
||||
const UINT8* ToReplace,
|
||||
UINT32 LenTR
|
||||
);
|
||||
UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer<UINT8> ToFind, const XBuffer<UINT8> ToReplace);
|
||||
UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, const XString8& TgtBrgName, const XBuffer<UINT8>& ToFind, const XBuffer<UINT8>& ToReplace);
|
||||
|
||||
|
||||
UINT32
|
||||
FixRenameByBridge2 (
|
||||
UINT8* dsdt,
|
||||
UINT32 len,
|
||||
CHAR8* TgtBrgName,
|
||||
const UINT8* ToFind,
|
||||
UINT32 LenTF,
|
||||
const UINT8* ToReplace,
|
||||
UINT32 LenTR
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif /* PLATFORM_FIXBIOSDSDT_H_ */
|
||||
|
@ -4449,17 +4449,20 @@ static void getACPISettings(const TagDict *CfgDict)
|
||||
INTN i;
|
||||
INTN Count = PatchesArray->arrayContent().size();
|
||||
if (Count > 0) {
|
||||
gSettings.PatchDsdtNum = (UINT32)Count;
|
||||
gSettings.PatchDsdtFind = (__typeof__(gSettings.PatchDsdtFind))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
gSettings.PatchDsdtReplace = (__typeof__(gSettings.PatchDsdtReplace))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
gSettings.PatchDsdtTgt = (__typeof__(gSettings.PatchDsdtTgt))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
gSettings.LenToFind = (__typeof__(gSettings.LenToFind))AllocateZeroPool(Count * sizeof(UINT32));
|
||||
gSettings.LenToReplace = (__typeof__(gSettings.LenToReplace))AllocateZeroPool(Count * sizeof(UINT32));
|
||||
gSettings.PatchDsdtLabel = (__typeof__(gSettings.PatchDsdtLabel))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
gSettings.PatchDsdtMenuItem = new INPUT_ITEM[Count];
|
||||
// gSettings.DSDTPatchArray.size() = (UINT32)Count;
|
||||
// gSettings.PatchDsdtFind = (__typeof__(gSettings.PatchDsdtFind))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
// gSettings.PatchDsdtReplace = (__typeof__(gSettings.PatchDsdtReplace))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
// gSettings.PatchDsdtTgt = (__typeof__(gSettings.PatchDsdtTgt))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
// gSettings.LenToFind = (__typeof__(gSettings.LenToFind))AllocateZeroPool(Count * sizeof(UINT32));
|
||||
// gSettings.LenToReplace = (__typeof__(gSettings.LenToReplace))AllocateZeroPool(Count * sizeof(UINT32));
|
||||
// gSettings.PatchDsdtLabel = (__typeof__(gSettings.PatchDsdtLabel))AllocateZeroPool(Count * sizeof(UINT8*));
|
||||
// gSettings.PatchDsdtMenuItem = new INPUT_ITEM[Count];
|
||||
DBG("PatchesDSDT: %lld requested\n", Count);
|
||||
|
||||
for (i = 0; i < Count; i++) {
|
||||
gSettings.DSDTPatchArray.setEmpty();
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
DSDT_Patch* dsdtPatchPtr = new DSDT_Patch();
|
||||
DSDT_Patch& dsdtPatch = *dsdtPatchPtr;
|
||||
UINTN Size = 0;
|
||||
const TagDict* Prop2 = PatchesArray->dictElementAt(i,"DSDT/Patches"_XS8);
|
||||
DBG(" - [%02lld]:", i);
|
||||
@ -4471,25 +4474,26 @@ static void getACPISettings(const TagDict *CfgDict)
|
||||
} else {
|
||||
DSDTPatchesLabel = " (NoLabel)"_XS8;
|
||||
}
|
||||
gSettings.PatchDsdtLabel[i] = (__typeof_am__(gSettings.PatchDsdtLabel[i]))AllocateZeroPool(256);
|
||||
snprintf(gSettings.PatchDsdtLabel[i], 255, "%s", DSDTPatchesLabel.c_str());
|
||||
DBG(" (%s)", gSettings.PatchDsdtLabel[i]);
|
||||
dsdtPatch.PatchDsdtLabel = DSDTPatchesLabel;
|
||||
DBG(" (%s)", dsdtPatch.PatchDsdtLabel.c_str());
|
||||
|
||||
Prop3 = Prop2->propertyForKey("Disabled");
|
||||
gSettings.PatchDsdtMenuItem[i].BValue = !IsPropertyNotNullAndTrue(Prop3);
|
||||
dsdtPatch.PatchDsdtMenuItem.BValue = !IsPropertyNotNullAndTrue(Prop3);
|
||||
|
||||
//DBG(" DSDT bin patch #%d ", i);
|
||||
gSettings.PatchDsdtFind[i] = GetDataSetting (Prop2, "Find", &Size);
|
||||
DBG(" lenToFind: %llu", Size);
|
||||
gSettings.LenToFind[i] = (UINT32)Size;
|
||||
gSettings.PatchDsdtReplace[i] = GetDataSetting (Prop2, "Replace", &Size);
|
||||
DBG(", lenToReplace: %llu", Size);
|
||||
gSettings.LenToReplace[i] = (UINT32)Size;
|
||||
gSettings.PatchDsdtTgt[i] = (CHAR8*)GetDataSetting (Prop2, "TgtBridge", &Size);
|
||||
DBG(", Target Bridge: %s\n", gSettings.PatchDsdtTgt[i]);
|
||||
if (!gSettings.PatchDsdtMenuItem[i].BValue) {
|
||||
UINT8* data = GetDataSetting (Prop2, "Find", &Size);
|
||||
dsdtPatch.PatchDsdtFind.stealValueFrom(data, Size);
|
||||
DBG(" lenToFind: %zu", dsdtPatch.PatchDsdtFind.size());
|
||||
data = GetDataSetting (Prop2, "Replace", &Size);
|
||||
dsdtPatch.PatchDsdtReplace.stealValueFrom(data, Size);
|
||||
DBG(", lenToReplace: %zu", dsdtPatch.PatchDsdtReplace.size());
|
||||
data = GetDataSetting (Prop2, "TgtBridge", &Size);
|
||||
dsdtPatch.PatchDsdtTgt.stealValueFrom((char*)data);
|
||||
DBG(", Target Bridge: %s\n", dsdtPatch.PatchDsdtTgt.c_str());
|
||||
if (!dsdtPatch.PatchDsdtMenuItem.BValue) {
|
||||
DBG(" patch disabled at config\n");
|
||||
}
|
||||
gSettings.DSDTPatchArray.AddReference(dsdtPatchPtr, true);
|
||||
}
|
||||
} //if count > 0
|
||||
} //if prop PatchesDSDT
|
||||
@ -8397,11 +8401,12 @@ checkOffset(Rtc8Allowed);
|
||||
xb.cat(DisableFunctions);
|
||||
|
||||
//Patch DSDT arbitrary
|
||||
xb.cat(PatchDsdtNum);
|
||||
xb.cat(PatchDsdtFind);
|
||||
xb.cat(LenToFind);
|
||||
xb.cat(PatchDsdtReplace);
|
||||
xb.cat(LenToReplace);
|
||||
xb.cat((UINT32)DSDTPatchArray.size()); // PatchDsdtNum
|
||||
xb.cat(uintptr_t(0)); // PatchDsdtFind
|
||||
xb.cat(uintptr_t(0)); // LenToFind
|
||||
xb.cat(uintptr_t(0)); // PatchDsdtReplace
|
||||
xb.cat(uintptr_t(0)); // LenToReplace
|
||||
checkOffset(DebugDSDT);
|
||||
xb.cat(DebugDSDT);
|
||||
xb.cat(SlpWak);
|
||||
xb.cat(UseIntelHDMI);
|
||||
@ -8441,9 +8446,9 @@ checkOffset(CustomEntries);
|
||||
xb.cat(DisabledAMLCount);
|
||||
xb.ncat(&pad36, sizeof(pad36));
|
||||
xb.cat(DisabledAML);
|
||||
xb.cat(PatchDsdtLabel);
|
||||
xb.cat(PatchDsdtTgt);
|
||||
xb.cat(PatchDsdtMenuItem);
|
||||
xb.cat(uintptr_t(0)); // PatchDsdtLabel
|
||||
xb.cat(uintptr_t(0)); // PatchDsdtTgt
|
||||
xb.cat(uintptr_t(0)); // PatchDsdtMenuItem
|
||||
|
||||
//other
|
||||
xb.cat(IntelMaxValue);
|
||||
|
@ -204,6 +204,22 @@ public:
|
||||
|
||||
//#pragma GCC diagnostic error "-Wpadded"
|
||||
|
||||
class DSDT_Patch
|
||||
{
|
||||
public :
|
||||
XBuffer<UINT8> PatchDsdtFind;
|
||||
XBuffer<UINT8> PatchDsdtReplace;
|
||||
XString8 PatchDsdtLabel;
|
||||
XString8 PatchDsdtTgt;
|
||||
INPUT_ITEM PatchDsdtMenuItem;
|
||||
|
||||
DSDT_Patch() : PatchDsdtFind(), PatchDsdtReplace(), PatchDsdtLabel(), PatchDsdtTgt(), PatchDsdtMenuItem() { }
|
||||
|
||||
// Not sure if default are valid. Delete them. If needed, proper ones can be created
|
||||
DSDT_Patch(const DEV_PROPERTY&) = delete;
|
||||
DSDT_Patch& operator=(const DEV_PROPERTY&) = delete;
|
||||
};
|
||||
|
||||
class SETTINGS_DATA {
|
||||
public:
|
||||
// SMBIOS TYPE0
|
||||
@ -499,12 +515,16 @@ public:
|
||||
UINT32 DisableFunctions;
|
||||
|
||||
//Patch DSDT arbitrary
|
||||
UINT32 PatchDsdtNum;
|
||||
UINT8 **PatchDsdtFind;
|
||||
UINT32 *LenToFind;
|
||||
UINT8 **PatchDsdtReplace;
|
||||
XObjArray<DSDT_Patch> DSDTPatchArray;
|
||||
// UINT32 PatchDsdtNum;
|
||||
// UINT8 **PatchDsdtFind;
|
||||
// UINT32 *LenToFind;
|
||||
// UINT8 **PatchDsdtReplace;
|
||||
// UINT32 *LenToReplace;
|
||||
// CHAR8 **PatchDsdtLabel;
|
||||
// CHAR8 **PatchDsdtTgt;
|
||||
// INPUT_ITEM *PatchDsdtMenuItem;
|
||||
|
||||
UINT32 *LenToReplace;
|
||||
BOOLEAN DebugDSDT;
|
||||
BOOLEAN SlpWak;
|
||||
BOOLEAN UseIntelHDMI;
|
||||
@ -547,9 +567,6 @@ public:
|
||||
UINT32 DisabledAMLCount;
|
||||
UINT8 pad36[4];
|
||||
CHAR16 **DisabledAML;
|
||||
CHAR8 **PatchDsdtLabel;
|
||||
CHAR8 **PatchDsdtTgt;
|
||||
INPUT_ITEM *PatchDsdtMenuItem;
|
||||
|
||||
//other
|
||||
UINT32 IntelMaxValue;
|
||||
@ -592,10 +609,10 @@ public:
|
||||
KernelPatchesAllowed(0), AirportBridgeDeviceName(), KbdPrevLang(0), PointerEnabled(0), PointerSpeed(0), DoubleClickTime(0), PointerMirror(0), CustomBoot(0), CustomLogo(0),
|
||||
RefCLK(0), RtMLB(), RtROM(0), RtROMLen(0), CsrActiveConfig(0), BooterConfig(0), BooterCfgStr(), DisableCloverHotkeys(0), NeverDoRecovery(0),
|
||||
ConfigName{0}, /*MainConfigName(0),*/ BlackListCount(0), BlackList(0), RPlt{0}, RBr{0}, EPCI{0}, REV{0}, Rtc8Allowed(0),
|
||||
ForceHPET(0), ResetHDA(0), PlayAsync(0), DisableFunctions(0), PatchDsdtNum(0), PatchDsdtFind(0), LenToFind(0), PatchDsdtReplace(0), LenToReplace(0), DebugDSDT(0), SlpWak(0), UseIntelHDMI(0),
|
||||
ForceHPET(0), ResetHDA(0), PlayAsync(0), DisableFunctions(0), DSDTPatchArray(), DebugDSDT(0), SlpWak(0), UseIntelHDMI(0),
|
||||
AFGLowPowerState(0), PNLF_UID(0), ACPIDropTables(0), DisableEntryScan(0), DisableToolScan(0), KernelScan(0), LinuxScan(0), CustomEntries(0),
|
||||
CustomLegacy(0), CustomTool(0), NrAddProperties(0), AddProperties(0), BlockKexts{0}, SortedACPICount(0), SortedACPI(0), DisabledAMLCount(0), DisabledAML(0),
|
||||
PatchDsdtLabel(0), PatchDsdtTgt(0), PatchDsdtMenuItem(0), IntelMaxValue(0), OptionsBits(0), FlagsBits(0), UIScale(0), EFILoginHiDPI(0), flagstate{0},
|
||||
IntelMaxValue(0), OptionsBits(0), FlagsBits(0), UIScale(0), EFILoginHiDPI(0), flagstate{0},
|
||||
ArbProperties(0), QuirksMask(0), MaxSlide(0)
|
||||
{};
|
||||
SETTINGS_DATA(const SETTINGS_DATA& other) = delete; // Can be defined if needed
|
||||
|
@ -430,8 +430,8 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry)
|
||||
// tmpName = (CHAR16*)A_llocateZeroPool((fileLen+1)*2);
|
||||
// AsciiStrToUnicodeStrS(targetString, tmpName, fileLen);
|
||||
|
||||
Entry->VolName.strncpy(fileBuffer, fileLen);
|
||||
DBG("Created name:%ls\n", Entry->VolName.wc_str());
|
||||
Entry->DisplayedVolName.strncpy(fileBuffer, fileLen);
|
||||
DBG("Created name:%ls\n", Entry->DisplayedVolName.wc_str());
|
||||
|
||||
FreePool(fileBuffer);
|
||||
}
|
||||
@ -583,7 +583,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
Entry->APFSTargetUUID = APFSTargetUUID;
|
||||
|
||||
Entry->LoaderPath = LoaderPath;
|
||||
Entry->VolName = Volume->VolName;
|
||||
Entry->DisplayedVolName = Volume->VolName;
|
||||
Entry->DevicePath = LoaderDevicePath;
|
||||
Entry->DevicePathString = LoaderDevicePathString;
|
||||
Entry->Flags = OSFLAG_SET(Flags, OSFLAG_USEGRAPHICS);
|
||||
@ -633,7 +633,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS);
|
||||
}
|
||||
ShortcutLetter = 'M';
|
||||
if ( Entry->VolName.isEmpty() ) {
|
||||
if ( Entry->DisplayedVolName.isEmpty() ) {
|
||||
// else no sense to override it with dubious name
|
||||
GetOSXVolumeName(Entry);
|
||||
}
|
||||
@ -681,7 +681,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
|
||||
BOOLEAN BootCampStyle = ThemeX.BootCampStyle;
|
||||
|
||||
if ( Entry->Title.isEmpty() && Entry->VolName.isEmpty() ) {
|
||||
if ( Entry->Title.isEmpty() && Entry->DisplayedVolName.isEmpty() ) {
|
||||
XStringW BasenameXW = XStringW(Basename(Volume->DevicePathString.wc_str()));
|
||||
// DBG("encounter Entry->VolName ==%ls and StrLen(Entry->VolName) ==%llu\n",Entry->VolName, StrLen(Entry->VolName));
|
||||
if (BootCampStyle) {
|
||||
@ -700,7 +700,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
// DBG("encounter LoaderTitle ==%ls and Entry->VolName ==%ls\n", LoaderTitle.wc_str(), Entry->VolName);
|
||||
if (BootCampStyle) {
|
||||
if ((StriCmp(LoaderTitle.wc_str(), L"macOS") == 0) || (StriCmp(LoaderTitle.wc_str(), L"Recovery") == 0)) {
|
||||
Entry->Title.takeValueFrom(Entry->VolName);
|
||||
Entry->Title.takeValueFrom(Entry->DisplayedVolName);
|
||||
} else {
|
||||
if (!LoaderTitle.isEmpty()) {
|
||||
Entry->Title = LoaderTitle;
|
||||
@ -710,7 +710,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
}
|
||||
} else {
|
||||
Entry->Title.SWPrintf("Boot %ls from %ls", (!LoaderTitle.isEmpty()) ? LoaderTitle.wc_str() : LoaderPath.basename().wc_str(),
|
||||
Entry->VolName.wc_str());
|
||||
Entry->DisplayedVolName.wc_str());
|
||||
}
|
||||
}
|
||||
// DBG("Entry->Title =%ls\n", Entry->Title.wc_str());
|
||||
@ -795,7 +795,7 @@ void LOADER_ENTRY::AddDefaultMenu()
|
||||
|
||||
// create the submenu
|
||||
SubScreen = new REFIT_MENU_SCREEN;
|
||||
SubScreen->Title.SWPrintf("Options for %ls on %ls", Title.wc_str(), VolName.wc_str());
|
||||
SubScreen->Title.SWPrintf("Options for %ls on %ls", Title.wc_str(), DisplayedVolName.wc_str());
|
||||
|
||||
SubScreen->TitleImage = Image;
|
||||
SubScreen->ID = LoaderType + 20; //wow
|
||||
@ -809,7 +809,7 @@ void LOADER_ENTRY::AddDefaultMenu()
|
||||
SubScreen->AddMenuInfoLine_f("UUID: %s", strguid(Guid));
|
||||
}
|
||||
if ( Volume->ApfsFileSystemUUID.notEmpty() || APFSTargetUUID.notEmpty() ) {
|
||||
SubScreen->AddMenuInfoLine_f("APFS volume name: %ls", VolName.wc_str());
|
||||
SubScreen->AddMenuInfoLine_f("APFS volume name: %ls", DisplayedVolName.wc_str());
|
||||
}
|
||||
if ( Volume->ApfsFileSystemUUID.notEmpty() ) {
|
||||
SubScreen->AddMenuInfoLine_f("APFS File System UUID: %s", Volume->ApfsFileSystemUUID.c_str());
|
||||
@ -1503,9 +1503,9 @@ VOID ScanLoader(VOID)
|
||||
}
|
||||
}
|
||||
if ( targetLoaderEntry ) {
|
||||
AddLoaderEntry(SWPrintf("\\%s\\System\\Library\\CoreServices\\boot.efi", ApfsTargetUUID.c_str()), NullXString8Array, SWPrintf("Boot Mac OS X from %ls via %ls", targetLoaderEntry->VolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_OSX, 0);
|
||||
AddLoaderEntry(SWPrintf("\\%s\\System\\Library\\CoreServices\\boot.efi", ApfsTargetUUID.c_str()), NullXString8Array, SWPrintf("Boot Mac OS X from %ls via %ls", targetLoaderEntry->DisplayedVolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_OSX, 0);
|
||||
//Try to add Recovery APFS entry
|
||||
AddLoaderEntry(SWPrintf("\\%s\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, SWPrintf("Boot Mac OS X Recovery for %ls via %ls", targetLoaderEntry->VolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_RECOVERY, 0);
|
||||
AddLoaderEntry(SWPrintf("\\%s\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, SWPrintf("Boot Mac OS X Recovery for %ls via %ls", targetLoaderEntry->DisplayedVolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_RECOVERY, 0);
|
||||
//Try to add macOS install entry
|
||||
AddLoaderEntry(SWPrintf("\\%s\\com.apple.installer\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, L""_XSW, L"macOS Install Prebooter"_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_OSX_INSTALLER, 0);
|
||||
}
|
||||
@ -1528,7 +1528,7 @@ VOID ScanLoader(VOID)
|
||||
} else {
|
||||
AddLoaderEntry(SWPrintf("\\%s\\System\\Library\\CoreServices\\boot.efi", ApfsTargetUUID.c_str()), NullXString8Array, L""_XSW, L"FileVault Prebooter"_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_OSX, 0);
|
||||
//Try to add Recovery APFS entry
|
||||
AddLoaderEntry(SWPrintf("\\%s\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, SWPrintf("Boot Mac OS X Recovery for %ls via %ls", targetLoaderEntry->VolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_RECOVERY, 0);
|
||||
AddLoaderEntry(SWPrintf("\\%s\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, SWPrintf("Boot Mac OS X Recovery for %ls via %ls", targetLoaderEntry->DisplayedVolName.wc_str(), Volume->VolName.wc_str()), L""_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_RECOVERY, 0);
|
||||
//Try to add macOS install entry
|
||||
AddLoaderEntry(SWPrintf("\\%s\\com.apple.installer\\boot.efi", Volume->ApfsTargetUUIDArray[i].c_str()), NullXString8Array, L""_XSW, L"macOS Install Prebooter"_XSW, Volume, Volume->ApfsTargetUUIDArray[i], NULL, OSTYPE_OSX_INSTALLER, 0);
|
||||
}
|
||||
@ -1882,7 +1882,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
|
||||
// Add subscreen
|
||||
REFIT_MENU_SCREEN *SubScreen = new REFIT_MENU_SCREEN;
|
||||
if (SubScreen) {
|
||||
SubScreen->Title.SWPrintf("Boot Options for %ls on %ls", (Custom->Title.notEmpty()) ? Custom->Title.wc_str() : CustomPath.wc_str(), Entry->VolName.wc_str());
|
||||
SubScreen->Title.SWPrintf("Boot Options for %ls on %ls", (Custom->Title.notEmpty()) ? Custom->Title.wc_str() : CustomPath.wc_str(), Entry->DisplayedVolName.wc_str());
|
||||
SubScreen->TitleImage = Entry->Image;
|
||||
SubScreen->ID = Custom->Type + 20;
|
||||
SubScreen->GetAnime();
|
||||
@ -1908,6 +1908,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
|
||||
SubMenu->AddMenuEntry(Entry, true);
|
||||
else
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
Entry->Hidden = Custom->Hidden;
|
||||
}
|
||||
} while (FindCustomPath && Custom->Type == OSTYPE_LINEFI && Custom->KernelScan == KERNEL_SCAN_ALL); // repeat loop only for kernel scanning
|
||||
|
||||
|
@ -69,7 +69,7 @@ LOADER_ENTRY* LOADER_ENTRY::getPartiallyDuplicatedEntry() const
|
||||
DuplicateEntry->DevicePathString= DevicePathString;
|
||||
DuplicateEntry->LoadOptions = LoadOptions;
|
||||
DuplicateEntry->LoaderPath = LoaderPath;
|
||||
DuplicateEntry->VolName = VolName;
|
||||
DuplicateEntry->DisplayedVolName = DisplayedVolName;
|
||||
DuplicateEntry->DevicePath = DevicePath;
|
||||
DuplicateEntry->Flags = Flags;
|
||||
DuplicateEntry->LoaderType = LoaderType;
|
||||
|
@ -365,7 +365,7 @@ class REFIT_ABSTRACT_MENU_ENTRY
|
||||
public:
|
||||
XStringW APFSTargetUUID;
|
||||
|
||||
XStringW VolName;
|
||||
XStringW DisplayedVolName;
|
||||
EFI_DEVICE_PATH *DevicePath;
|
||||
UINT16 Flags;
|
||||
UINT8 LoaderType;
|
||||
@ -413,9 +413,9 @@ class REFIT_ABSTRACT_MENU_ENTRY
|
||||
|
||||
|
||||
LOADER_ENTRY()
|
||||
: REFIT_MENU_ITEM_BOOTNUM(), APFSTargetUUID(), VolName(0), DevicePath(0), Flags(0), LoaderType(0), OSVersion(0), BuildVersion(0),
|
||||
: REFIT_MENU_ITEM_BOOTNUM(), APFSTargetUUID(), DisplayedVolName(), DevicePath(0), Flags(0), LoaderType(0), OSVersion(), BuildVersion(),
|
||||
BootBgColor({0,0,0,0}),
|
||||
CustomBoot(0), CustomLogo(), KernelAndKextPatches(), Settings(0), KernelData(0),
|
||||
CustomBoot(0), CustomLogo(), KernelAndKextPatches(), Settings(), KernelData(0),
|
||||
AddrVtable(0), SizeVtable(0), NamesTable(0), SegVAddr(0), shift(0),
|
||||
PatcherInited(false), gSNBEAICPUFixRequire(false), gBDWEIOPCIFixRequire(false), isKernelcache(false), is64BitKernel(false),
|
||||
KernelSlide(0), KernelOffset(0), PrelinkTextLoadCmdAddr(0), PrelinkTextAddr(0), PrelinkTextSize(0),
|
||||
|
@ -1840,12 +1840,16 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
if ( !EFI_ERROR(Status) ) DBG("Clover : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
gBS->Stall(1500000); // to give time to gdb to connect
|
||||
// gBS->Stall(0500000); // to give time to gdb to connect
|
||||
// gBS->Stall(1500000); // to give time to gdb to connect
|
||||
gBS->Stall(0500000); // to give time to gdb to connect
|
||||
// PauseForKey(L"press\n");
|
||||
#endif
|
||||
}
|
||||
construct_globals_objects(gImageHandle); // do this after SelfLoadedImage is initialized
|
||||
#ifdef JIEF_DEBUG
|
||||
// all_tests();
|
||||
// PauseForKey(L"press\n");
|
||||
#endif
|
||||
|
||||
gRT->GetTime(&Now, NULL);
|
||||
|
||||
@ -1877,10 +1881,6 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
if (EFI_ERROR(Status))
|
||||
return Status;
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
all_tests();
|
||||
// PauseForKey(L"press\n");
|
||||
#endif
|
||||
|
||||
//dumping SETTING structure
|
||||
// if you change something in Platform.h, please uncomment and test that all offsets
|
||||
|
@ -2142,18 +2142,17 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDSDTPatches()
|
||||
REFIT_MENU_SCREEN *SubScreen;
|
||||
REFIT_INPUT_DIALOG *InputBootArgs;
|
||||
|
||||
INTN PatchDsdtNum = gSettings.PatchDsdtNum;
|
||||
INPUT_ITEM *DSDTPatchesMenu = gSettings.PatchDsdtMenuItem;
|
||||
INTN Index;
|
||||
size_t PatchDsdtNum = gSettings.DSDTPatchArray.size();
|
||||
// INPUT_ITEM* DSDTPatchesMenu = gSettings.PatchDsdtMenuItem;
|
||||
|
||||
Entry = newREFIT_MENU_ITEM_OPTIONS(&SubScreen, ActionEnter, SCREEN_DSDT_PATCHES, "Custom DSDT patches->"_XS8);
|
||||
|
||||
for (Index = 0; Index < PatchDsdtNum; Index++) {
|
||||
for (size_t Index = 0; Index < PatchDsdtNum; Index++) {
|
||||
InputBootArgs = new REFIT_INPUT_DIALOG;
|
||||
InputBootArgs->Title.SWPrintf("%90s", gSettings.PatchDsdtLabel[Index]);
|
||||
InputBootArgs->Title.SWPrintf("%90s", gSettings.DSDTPatchArray[Index].PatchDsdtLabel.c_str());
|
||||
// InputBootArgs->Tag = TAG_INPUT;
|
||||
InputBootArgs->Row = 0xFFFF; //cursor
|
||||
InputBootArgs->Item = &DSDTPatchesMenu[Index];
|
||||
InputBootArgs->Item = &gSettings.DSDTPatchArray[Index].PatchDsdtMenuItem;
|
||||
InputBootArgs->AtClick = ActionEnter;
|
||||
InputBootArgs->AtRightClick = ActionDetails;
|
||||
SubScreen->AddMenuEntry(InputBootArgs, true);
|
||||
|
Loading…
Reference in New Issue
Block a user