Add support for renaming macWK boot.efi files
This prevents those boot entries from appearing in the macOS boot menu
This commit is contained in:
parent
6b3524cde8
commit
82a2e7f85c
1 changed files with 19 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ UFD_LABEL = f'{KIT_NAME_SHORT}_UFD'
|
||||||
|
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
def apply_image(part_path, image_path):
|
def apply_image(part_path, image_path, hide_macos_boot=True):
|
||||||
"""Apply raw image to dev_path using dd."""
|
"""Apply raw image to dev_path using dd."""
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
|
|
@ -70,6 +70,24 @@ def apply_image(part_path, image_path):
|
||||||
]
|
]
|
||||||
run_program(cmd)
|
run_program(cmd)
|
||||||
|
|
||||||
|
# Bail?
|
||||||
|
if not ('macwk' in image_path.name.lower() and hide_macos_boot):
|
||||||
|
return
|
||||||
|
|
||||||
|
# Hide macOS boot files
|
||||||
|
boot_efi_path = '/mnt/TMP/System/Library/CoreServices/boot.efi'
|
||||||
|
linux.mount(source=part_path, mount_point='/mnt/TMP', read_write=True)
|
||||||
|
if os.path.exists(boot_efi_path):
|
||||||
|
try:
|
||||||
|
os.rename(
|
||||||
|
boot_efi_path,
|
||||||
|
boot_efi_path.replace('boot.efi', 'secretboot.efi'),
|
||||||
|
)
|
||||||
|
except OSError:
|
||||||
|
# Ignore for now?
|
||||||
|
pass
|
||||||
|
linux.unmount(source_or_mountpoint='/mnt/TMP')
|
||||||
|
|
||||||
|
|
||||||
def build_ufd():
|
def build_ufd():
|
||||||
# pylint: disable=too-many-statements
|
# pylint: disable=too-many-statements
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue