From 0b4909b49210c2363406327b5b13c6dd779c115c Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Wed, 27 Sep 2023 02:49:20 -0400 Subject: Use unpacking for list creation (#2117) --- archinstall/lib/installer.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index f8f59cc0..5d1bb7dc 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -857,17 +857,17 @@ class Installer: for kernel in self.kernels: for variant in ("", "-fallback"): # Setup the loader entry - with open(entries_dir / f'{self.init_time}_{kernel}{variant}.conf', 'w') as entry: - entry_lines: List[str] = [] - - entry_lines.extend(comments) - entry_lines.append(f'title Arch Linux ({kernel}{variant})\n') - entry_lines.append(f'linux /vmlinuz-{kernel}\n') - entry_lines.extend(microcode) - entry_lines.append(f'initrd /initramfs-{kernel}{variant}.img\n') - entry_lines.append(options) - - entry.writelines(entry_lines) + entry = [ + *comments, + f'title Arch Linux ({kernel}{variant})\n', + f'linux /vmlinuz-{kernel}\n', + *microcode, + f'initrd /initramfs-{kernel}{variant}.img\n', + options, + ] + + entry_conf = entries_dir / f'{self.init_time}_{kernel}{variant}.conf' + entry_conf.write_text(''.join(entry)) self.helper_flags['bootloader'] = 'systemd' @@ -1079,11 +1079,11 @@ TIMEOUT=5 label = f'Arch Linux ({kernel})' loader = f"/vmlinuz-{kernel}" - cmdline = [] - - cmdline.extend(microcode) - cmdline.append(f"initrd=\\initramfs-{kernel}.img") - cmdline.extend(kernel_parameters) + cmdline = [ + *microcode, + f"initrd=\\initramfs-{kernel}.img", + *kernel_parameters, + ] cmd = f'efibootmgr ' \ f'--disk {parent_dev_path} ' \ -- cgit v1.2.3-70-g09d2