Refactor `_add_efistub_bootloader()` use cmd list (#2127)

This commit is contained in:
codefiles 2023-09-28 18:29:54 -04:00 committed by GitHub
parent 3695c37bc4
commit 7a9a934ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 11 deletions

View File

@ -1076,23 +1076,22 @@ TIMEOUT=5
for kernel in self.kernels:
# Setup the firmware entry
label = f'Arch Linux ({kernel})'
loader = f"/vmlinuz-{kernel}"
cmdline = [
*microcode,
f"initrd=\\initramfs-{kernel}.img",
*kernel_parameters,
]
cmd = f'efibootmgr ' \
f'--disk {parent_dev_path} ' \
f'--part {boot_partition.partn} ' \
f'--create ' \
f'--label "{label}" ' \
f'--loader {loader} ' \
f'--unicode \'{" ".join(cmdline)}\' ' \
f'--verbose'
cmd = [
'efibootmgr',
'--disk', str(parent_dev_path),
'--part', str(boot_partition.partn),
'--create',
'--label', f'Arch Linux ({kernel})',
'--loader', f"/vmlinuz-{kernel}",
'--unicode', ' '.join(cmdline),
'--verbose'
]
SysCommand(cmd)