mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 03:50:14 +10:00
Strip unused functions
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(False)
|
self.main_menu()
|
||||||
|
|
||||||
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()
|
||||||
@@ -38,32 +38,7 @@ class OpenCoreLegacyPatcher:
|
|||||||
else:
|
else:
|
||||||
print("- No arguments present, loading TUI")
|
print("- No arguments present, loading TUI")
|
||||||
|
|
||||||
def first_setup(self):
|
def main_menu(self):
|
||||||
# Order of operations:
|
|
||||||
# 1. Build OpenCore
|
|
||||||
# 2. Download macOS
|
|
||||||
# 3. Select USB drive
|
|
||||||
# 4. Format USB drive
|
|
||||||
# 5. Install OpenCore to ESP
|
|
||||||
# 6. flash macOS
|
|
||||||
# 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()
|
|
||||||
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS()
|
|
||||||
|
|
||||||
|
|
||||||
def post_install(self):
|
|
||||||
# Order of operations:
|
|
||||||
# 1. Build OpenCore
|
|
||||||
# 2. Prompt drive to install OC to
|
|
||||||
# 3. Install OpenCore to ESP
|
|
||||||
# 4. Determine whether root patching needed
|
|
||||||
# 5. Prompt user to reboot
|
|
||||||
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):
|
|
||||||
response = None
|
response = None
|
||||||
while not (response and response == -1):
|
while not (response and response == -1):
|
||||||
title = [
|
title = [
|
||||||
@@ -92,19 +67,6 @@ class OpenCoreLegacyPatcher:
|
|||||||
|
|
||||||
menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
|
menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
|
||||||
|
|
||||||
if walkthrough is True:
|
|
||||||
options = (
|
|
||||||
[["First Time Setup", self.first_setup]]
|
|
||||||
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
|
||||||
else []
|
|
||||||
) + [
|
|
||||||
#["Post-Installation setup", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).closing_message],
|
|
||||||
["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model],
|
|
||||||
["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings],
|
|
||||||
["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits],
|
|
||||||
["Legacy Menu", lambda: self.main_menu(False)],
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
options = (
|
options = (
|
||||||
[["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]]
|
[["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]]
|
||||||
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
||||||
|
|||||||
Reference in New Issue
Block a user