mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 12:00:15 +10:00
Add 11.2.3 mirror
This commit is contained in:
@@ -17,7 +17,7 @@ class OpenCoreLegacyPatcher:
|
|||||||
self.constants = constants.Constants()
|
self.constants = constants.Constants()
|
||||||
self.generate_base_data()
|
self.generate_base_data()
|
||||||
if utilities.check_cli_args() is None:
|
if utilities.check_cli_args() is None:
|
||||||
self.main_menu(True)
|
self.main_menu(False)
|
||||||
|
|
||||||
def generate_base_data(self):
|
def generate_base_data(self):
|
||||||
self.constants.detected_os = os_probe.detect_kernel_major()
|
self.constants.detected_os = os_probe.detect_kernel_major()
|
||||||
@@ -47,11 +47,9 @@ class OpenCoreLegacyPatcher:
|
|||||||
# 5. Install OpenCore to ESP
|
# 5. Install OpenCore to ESP
|
||||||
# 6. flash macOS
|
# 6. flash macOS
|
||||||
# 7. Prompt user to reboot
|
# 7. Prompt user to reboot
|
||||||
|
self.constants.walkthrough = True
|
||||||
build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
||||||
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS()
|
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS()
|
||||||
utilities.cls()
|
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
def post_install(self):
|
def post_install(self):
|
||||||
@@ -61,8 +59,9 @@ class OpenCoreLegacyPatcher:
|
|||||||
# 3. Install OpenCore to ESP
|
# 3. Install OpenCore to ESP
|
||||||
# 4. Determine whether root patching needed
|
# 4. Determine whether root patching needed
|
||||||
# 5. Prompt user to reboot
|
# 5. Prompt user to reboot
|
||||||
print()
|
build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
||||||
|
install.tui_disk_installation(self.constants).copy_efi()
|
||||||
|
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume
|
||||||
|
|
||||||
def main_menu(self, walkthrough):
|
def main_menu(self, walkthrough):
|
||||||
response = None
|
response = None
|
||||||
|
|||||||
11
data/mirror_data.py
Normal file
11
data/mirror_data.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Mirrors of Apple's InstallAssistant.ppkg
|
||||||
|
# Currently only listing important Installers no longer on Apple's servers
|
||||||
|
|
||||||
|
Install_macOS_Big_Sur_11_2_3 = {
|
||||||
|
"Version": "11.2.3",
|
||||||
|
"Build": "20D91",
|
||||||
|
"Link": "https://archive.org/download/install-assistant-20D91/InstallAssistant.pkg",
|
||||||
|
"Size": 11848909000,
|
||||||
|
"Source": "Archive.org",
|
||||||
|
"integirty": None,
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ from __future__ import print_function
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from resources import constants, install, utilities, defaults, sys_patch, installer
|
from resources import constants, install, utilities, defaults, sys_patch, installer
|
||||||
from data import cpu_data, smbios_data, model_array, os_data
|
from data import cpu_data, smbios_data, model_array, os_data, mirror_data
|
||||||
|
|
||||||
|
|
||||||
class MenuOptions:
|
class MenuOptions:
|
||||||
@@ -1073,8 +1073,10 @@ to your USB drive.
|
|||||||
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
|
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
|
||||||
avalible_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "DeveloperSeed")
|
avalible_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "DeveloperSeed")
|
||||||
if avalible_installers:
|
if avalible_installers:
|
||||||
|
# Add mirror of 11.2.3 for users who want it
|
||||||
|
options.append([f"macOS {mirror_data.Install_macOS_Big_Sur_11_2_3['Version']} ({mirror_data.Install_macOS_Big_Sur_11_2_3['Build']} - {utilities.human_fmt(mirror_data.Install_macOS_Big_Sur_11_2_3['Size'])} - {mirror_data.Install_macOS_Big_Sur_11_2_3['Source']})", lambda: self.download_install_assistant(mirror_data.Install_macOS_Big_Sur_11_2_3['Link'])])
|
||||||
for app in avalible_installers:
|
for app in avalible_installers:
|
||||||
options.append([f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])})", lambda x=app: self.download_install_assistant(avalible_installers[x]['Link'])])
|
options.append([f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])} - {avalible_installers[app]['Source']})", lambda x=app: self.download_install_assistant(avalible_installers[x]['Link'])])
|
||||||
for option in options:
|
for option in options:
|
||||||
menu.add_menu_option(option[0], function=option[1])
|
menu.add_menu_option(option[0], function=option[1])
|
||||||
response = menu.start()
|
response = menu.start()
|
||||||
@@ -1107,7 +1109,8 @@ to your USB drive.
|
|||||||
utilities.header(["Create macOS installer"])
|
utilities.header(["Create macOS installer"])
|
||||||
print("Installer created successfully.")
|
print("Installer created successfully.")
|
||||||
input("Press enter to exit.")
|
input("Press enter to exit.")
|
||||||
self.closing_message()
|
if self.constants.walkthrough is True:
|
||||||
|
self.closing_message()
|
||||||
else:
|
else:
|
||||||
utilities.cls()
|
utilities.cls()
|
||||||
utilities.header(["Create macOS installer"])
|
utilities.header(["Create macOS installer"])
|
||||||
@@ -1115,7 +1118,8 @@ to your USB drive.
|
|||||||
input("Press enter to return to the previous.")
|
input("Press enter to return to the previous.")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
sys.exit()
|
if self.constants.walkthrough is True:
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def closing_message(self):
|
def closing_message(self):
|
||||||
utilities.cls()
|
utilities.cls()
|
||||||
|
|||||||
@@ -160,7 +160,8 @@ class Constants:
|
|||||||
self.disable_msr_power_ctl = False # Disable MSR Power Control (missing battery throttling)
|
self.disable_msr_power_ctl = False # Disable MSR Power Control (missing battery throttling)
|
||||||
self.software_demux = False # Enable Software Demux patch set
|
self.software_demux = False # Enable Software Demux patch set
|
||||||
self.force_vmm = False # Force VMM patch
|
self.force_vmm = False # Force VMM patch
|
||||||
self.custom_sip_value = None # Set custom SIP value
|
self.custom_sip_value = None # Set custom SIP value
|
||||||
|
self.walkthrough = False # Enable Walkthrough
|
||||||
|
|
||||||
self.legacy_accel_support = [
|
self.legacy_accel_support = [
|
||||||
os_data.os_data.mojave,
|
os_data.os_data.mojave,
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ def list_downloadable_macOS_installers(download_path, catalog):
|
|||||||
"Link": download_link,
|
"Link": download_link,
|
||||||
"Size": size,
|
"Size": size,
|
||||||
"integirty": integirty,
|
"integirty": integirty,
|
||||||
|
"Source": "Apple Inc.",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -293,6 +293,11 @@ def get_rom(variable: str, *, decode: bool = False):
|
|||||||
def download_file(link, location):
|
def download_file(link, location):
|
||||||
if Path(location).exists():
|
if Path(location).exists():
|
||||||
Path(location).unlink()
|
Path(location).unlink()
|
||||||
|
try:
|
||||||
|
# Handle cases where Content-Length has garbage or is missing
|
||||||
|
size_string = f" of {int(requests.head(link).headers['Content-Length']) / 1024 / 1024}MB"
|
||||||
|
except KeyError:
|
||||||
|
size_string = ""
|
||||||
response = requests.get(link, stream=True)
|
response = requests.get(link, stream=True)
|
||||||
short_link = os.path.basename(link)
|
short_link = os.path.basename(link)
|
||||||
# SU Catalog's link is quite long, strip to make it bearable
|
# SU Catalog's link is quite long, strip to make it bearable
|
||||||
@@ -300,17 +305,18 @@ def download_file(link, location):
|
|||||||
short_link = "sucatalog.gz"
|
short_link = "sucatalog.gz"
|
||||||
header = f"# Downloading: {short_link} #"
|
header = f"# Downloading: {short_link} #"
|
||||||
box_length = len(header)
|
box_length = len(header)
|
||||||
|
box_string = "#" * box_length
|
||||||
with location.open("wb") as file:
|
with location.open("wb") as file:
|
||||||
count = 0
|
count = 0
|
||||||
for chunk in response.iter_content(1024 * 1024 * 4):
|
for chunk in response.iter_content(1024 * 1024 * 4):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
count += len(chunk)
|
count += len(chunk)
|
||||||
cls()
|
cls()
|
||||||
print("#" * box_length)
|
print(box_string)
|
||||||
print(header)
|
print(header)
|
||||||
print("#" * box_length)
|
print(box_string)
|
||||||
print("")
|
print("")
|
||||||
print(f"{count / 1024 / 1024}MB Downloaded")
|
print(f"{count / 1024 / 1024}MB Downloaded{size_string}")
|
||||||
checksum = hashlib.sha256()
|
checksum = hashlib.sha256()
|
||||||
with location.open("rb") as file:
|
with location.open("rb") as file:
|
||||||
chunk = file.read(1024 * 1024 * 16)
|
chunk = file.read(1024 * 1024 * 16)
|
||||||
|
|||||||
Reference in New Issue
Block a user