mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
Merge pull request #57 from kommtzeitkonrad/main
Fix compatibility on older firmwares
This commit is contained in:
@@ -40,7 +40,7 @@ while MainMenu:
|
|||||||
print(" Your model is not supported by this patcher!")
|
print(" Your model is not supported by this patcher!")
|
||||||
print("")
|
print("")
|
||||||
print(" If you plan to create the USB for another machine,")
|
print(" If you plan to create the USB for another machine,")
|
||||||
print(" please select option 5")
|
print(" please select option 3")
|
||||||
print(subheader)
|
print(subheader)
|
||||||
print("")
|
print("")
|
||||||
elif BuildOpenCore.current_model in ("MacPro3,1", "iMac7,1"):
|
elif BuildOpenCore.current_model in ("MacPro3,1", "iMac7,1"):
|
||||||
@@ -110,7 +110,7 @@ while MainMenu:
|
|||||||
print("\n Not Valid Choice Try again")
|
print("\n Not Valid Choice Try again")
|
||||||
OpenCoreBuilderMenu = True
|
OpenCoreBuilderMenu = True
|
||||||
|
|
||||||
|
|
||||||
elif MainMenu=="2":
|
elif MainMenu=="2":
|
||||||
print("\n Not yet implemented")
|
print("\n Not yet implemented")
|
||||||
OpenCoreInstallerMenu=True
|
OpenCoreInstallerMenu=True
|
||||||
@@ -202,8 +202,7 @@ while MainMenu:
|
|||||||
|
|
||||||
elif MainMenu=="5":
|
elif MainMenu=="5":
|
||||||
print("\n Closing program...")
|
print("\n Closing program...")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print("\n Not Valid Choice Try again")
|
print("\n Not Valid Choice Try again")
|
||||||
MainMenu=True
|
MainMenu=True
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -37,14 +37,14 @@ else:
|
|||||||
OCExist = False
|
OCExist = False
|
||||||
|
|
||||||
def BuildEFI():
|
def BuildEFI():
|
||||||
|
|
||||||
if not os.path.exists(Versions.build_path):
|
if not os.path.exists(Versions.build_path):
|
||||||
os.makedirs(Versions.build_path)
|
os.makedirs(Versions.build_path)
|
||||||
print("Created Build Folder")
|
print("Created Build Folder")
|
||||||
else:
|
else:
|
||||||
print("Build Folder already present, skipping")
|
print("Build Folder already present, skipping")
|
||||||
# Copy OpenCore into Build Folder
|
# Copy OpenCore into Build Folder
|
||||||
|
|
||||||
if os.path.exists(Versions.opencore_path_build):
|
if os.path.exists(Versions.opencore_path_build):
|
||||||
print("Deleting old copy of OpenCore zip")
|
print("Deleting old copy of OpenCore zip")
|
||||||
os.remove(Versions.opencore_path_build)
|
os.remove(Versions.opencore_path_build)
|
||||||
@@ -64,7 +64,7 @@ def BuildEFI():
|
|||||||
# Adding must have kexts
|
# Adding must have kexts
|
||||||
print("- Adding Lilu v%s" % Versions.lilu_version)
|
print("- Adding Lilu v%s" % Versions.lilu_version)
|
||||||
copy(Versions.lilu_path, Versions.kext_path_build)
|
copy(Versions.lilu_path, Versions.kext_path_build)
|
||||||
|
|
||||||
print("- Adding WhateverGreen v%s" % Versions.whatevergreen_version)
|
print("- Adding WhateverGreen v%s" % Versions.whatevergreen_version)
|
||||||
copy(Versions.whatevergreen_path, Versions.kext_path_build)
|
copy(Versions.whatevergreen_path, Versions.kext_path_build)
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ def BuildEFI():
|
|||||||
"<false/><!--RestrictEvents-->",
|
"<false/><!--RestrictEvents-->",
|
||||||
"<true/><!--RestrictEvents-->"
|
"<true/><!--RestrictEvents-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Checks for kexts
|
# Checks for kexts
|
||||||
# CPU Kext Patches
|
# CPU Kext Patches
|
||||||
if current_model in ModelArray.DualSocket:
|
if current_model in ModelArray.DualSocket:
|
||||||
@@ -85,7 +85,7 @@ def BuildEFI():
|
|||||||
"<false/><!--AppleMCEReporterDisabler-->",
|
"<false/><!--AppleMCEReporterDisabler-->",
|
||||||
"<true/><!--AppleMCEReporterDisabler-->"
|
"<true/><!--AppleMCEReporterDisabler-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_model in ModelArray.SSEEmulator:
|
if current_model in ModelArray.SSEEmulator:
|
||||||
print("- Adding AAAMouSSE v%s" % Versions.mousse_version)
|
print("- Adding AAAMouSSE v%s" % Versions.mousse_version)
|
||||||
copy(Versions.mousse_path, Versions.kext_path_build)
|
copy(Versions.mousse_path, Versions.kext_path_build)
|
||||||
@@ -100,7 +100,7 @@ def BuildEFI():
|
|||||||
"<false/><!--telemetrap-->",
|
"<false/><!--telemetrap-->",
|
||||||
"<true/><!--telemetrap-->"
|
"<true/><!--telemetrap-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ethernet Patches
|
# Ethernet Patches
|
||||||
|
|
||||||
if current_model in ModelArray.EthernetNvidia:
|
if current_model in ModelArray.EthernetNvidia:
|
||||||
@@ -124,7 +124,7 @@ def BuildEFI():
|
|||||||
"<false/><!--CatalinaBCM5701Ethernet-->",
|
"<false/><!--CatalinaBCM5701Ethernet-->",
|
||||||
"<true/><!--CatalinaBCM5701Ethernet-->"
|
"<true/><!--CatalinaBCM5701Ethernet-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Wifi Patches
|
# Wifi Patches
|
||||||
|
|
||||||
if current_model in ModelArray.WifiAtheros:
|
if current_model in ModelArray.WifiAtheros:
|
||||||
@@ -211,7 +211,7 @@ def BuildEFI():
|
|||||||
"<false/><!--IOHIDFamily-->",
|
"<false/><!--IOHIDFamily-->",
|
||||||
"<true/><!--IOHIDFamily-->"
|
"<true/><!--IOHIDFamily-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_model in ModelArray.LegacyAudio:
|
if current_model in ModelArray.LegacyAudio:
|
||||||
print("- Adding VoodooHDA v%s" % Versions.voodoohda_version)
|
print("- Adding VoodooHDA v%s" % Versions.voodoohda_version)
|
||||||
copy(Versions.voodoohda_path, Versions.kext_path_build)
|
copy(Versions.voodoohda_path, Versions.kext_path_build)
|
||||||
@@ -219,7 +219,7 @@ def BuildEFI():
|
|||||||
"<false/><!--VoodooHDA-->",
|
"<false/><!--VoodooHDA-->",
|
||||||
"<true/><!--VoodooHDA-->"
|
"<true/><!--VoodooHDA-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_model in ModelArray.pciSSDT:
|
if current_model in ModelArray.pciSSDT:
|
||||||
print("- Adding SSDT-CPBG")
|
print("- Adding SSDT-CPBG")
|
||||||
copy(Versions.pci_ssdt_path, Versions.acpi_path_build)
|
copy(Versions.pci_ssdt_path, Versions.acpi_path_build)
|
||||||
@@ -227,7 +227,7 @@ def BuildEFI():
|
|||||||
"<false/><!--SSDT-CPBG-->",
|
"<false/><!--SSDT-CPBG-->",
|
||||||
"<true/><!--SSDT-CPBG-->"
|
"<true/><!--SSDT-CPBG-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_model in ModelArray.IDEPatch:
|
if current_model in ModelArray.IDEPatch:
|
||||||
print("- Adding AppleIntelPIIXATA v%s" % Versions.piixata_version)
|
print("- Adding AppleIntelPIIXATA v%s" % Versions.piixata_version)
|
||||||
copy(Versions.piixata_path, Versions.kext_path_build)
|
copy(Versions.piixata_path, Versions.kext_path_build)
|
||||||
@@ -235,7 +235,7 @@ def BuildEFI():
|
|||||||
"<false/><!--AppleIntelPIIXATA-->",
|
"<false/><!--AppleIntelPIIXATA-->",
|
||||||
"<true/><!--AppleIntelPIIXATA-->"
|
"<true/><!--AppleIntelPIIXATA-->"
|
||||||
)
|
)
|
||||||
|
|
||||||
usb_map_path = os.path.join(Versions.current_path, "payloads/Kexts/Maps/Zip/" "USB-Map-%s.zip" % current_model)
|
usb_map_path = os.path.join(Versions.current_path, "payloads/Kexts/Maps/Zip/" "USB-Map-%s.zip" % current_model)
|
||||||
if os.path.exists(usb_map_path):
|
if os.path.exists(usb_map_path):
|
||||||
print("- Adding USB Map for %s" % current_model)
|
print("- Adding USB Map for %s" % current_model)
|
||||||
@@ -249,7 +249,7 @@ def BuildEFI():
|
|||||||
"USB-Map-SMBIOS.kext",
|
"USB-Map-SMBIOS.kext",
|
||||||
map_name
|
map_name
|
||||||
)
|
)
|
||||||
|
|
||||||
if current_model in ModelArray.DualGPUPatch:
|
if current_model in ModelArray.DualGPUPatch:
|
||||||
print("- Adding dual GPU patch")
|
print("- Adding dual GPU patch")
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
Versions.plist_data = Versions.plist_data.replace(
|
||||||
@@ -327,7 +327,7 @@ def BuildSMBIOS():
|
|||||||
"M0000000000000001",
|
"M0000000000000001",
|
||||||
serialData[1]
|
serialData[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Patch UUID
|
# Patch UUID
|
||||||
uuidGen = subprocess.Popen(["uuidgen"], stdout=subprocess.PIPE).communicate()[0]
|
uuidGen = subprocess.Popen(["uuidgen"], stdout=subprocess.PIPE).communicate()[0]
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
Versions.plist_data = Versions.plist_data.replace(
|
||||||
@@ -389,7 +389,7 @@ def MoveOpenCore():
|
|||||||
print("")
|
print("")
|
||||||
efiVol = "/Volumes/EFI"
|
efiVol = "/Volumes/EFI"
|
||||||
if os.path.exists(efiVol):
|
if os.path.exists(efiVol):
|
||||||
print("Coping OpenCore onto Volumes/EFI")
|
print("Copying OpenCore onto Volumes/EFI")
|
||||||
if os.path.exists("/Volumes/EFI/EFI"):
|
if os.path.exists("/Volumes/EFI/EFI"):
|
||||||
print("Cleaning EFI folder")
|
print("Cleaning EFI folder")
|
||||||
rmtree("/Volumes/EFI/EFI")
|
rmtree("/Volumes/EFI/EFI")
|
||||||
@@ -404,4 +404,4 @@ def MoveOpenCore():
|
|||||||
print("")
|
print("")
|
||||||
|
|
||||||
def MountOpenCore():
|
def MountOpenCore():
|
||||||
subprocess.Popen((r"sudo diskutil mount $(nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | sed 's/.*GPT,\([^,]*\),.*/\1/')").split())
|
subprocess.Popen((r"sudo diskutil mount $(nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | sed 's/.*GPT,\([^,]*\),.*/\1/')").split())
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
# List build versions
|
# List build versions
|
||||||
opencore_version = "0.6.6"
|
opencore_version = "0.6.7"
|
||||||
lilu_version = "1.5.1"
|
lilu_version = "1.5.1"
|
||||||
whatevergreen_version = "1.4.7"
|
whatevergreen_version = "1.4.7"
|
||||||
airportbcrmfixup_version = "2.1.2"
|
airportbcrmfixup_version = "2.1.2"
|
||||||
@@ -76,4 +76,4 @@ macserial_path = os.path.join(current_path, "payloads/" "Tools")
|
|||||||
# Icons
|
# Icons
|
||||||
app_icon_path = os.path.join(current_path, "OC-Patcher.icns")
|
app_icon_path = os.path.join(current_path, "OC-Patcher.icns")
|
||||||
icon_path = os.path.join(current_path, "payloads/Icon/" ".VolumeIcon.icns")
|
icon_path = os.path.join(current_path, "payloads/Icon/" ".VolumeIcon.icns")
|
||||||
gui_path = os.path.join(current_path, "payloads/Icon/" "Resources.zip")
|
gui_path = os.path.join(current_path, "payloads/Icon/" "Resources.zip")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user