From 16d145935866a409a72c29a07b48fe3b30bb7868 Mon Sep 17 00:00:00 2001 From: Torxed Date: Mon, 23 Jun 2025 18:11:33 +0200 Subject: [PATCH 1/5] Added temporary hold on bootctl's --variables=BOOL usage, as it's not in systemd main yet --- archinstall/lib/installer.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 749fec0a8c..14ce2515ac 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1172,15 +1172,24 @@ def _add_systemd_bootloader( bootctl_options.append(f'--esp-path={efi_partition.mountpoint}') bootctl_options.append(f'--boot-path={boot_partition.mountpoint}') + # TODO: This is a temporary workaround to deal with https://github.com/archlinux/archinstall/pull/3396#issuecomment-2996862019 + # the systemd_version check can be removed once `--variables=BOOL` is merged into systemd. + systemd_version = int(self.pacman.run("-Q systemd").trace_log.split(b" ")[1][:3].decode()) # Install the boot loader try: # Force EFI variables since bootctl detects arch-chroot # as a container environemnt since v257 and skips them silently. # https://github.com/systemd/systemd/issues/36174 - SysCommand(f'arch-chroot {self.target} bootctl --variables=yes {" ".join(bootctl_options)} install') + if systemd_version >= 258: + SysCommand(f'arch-chroot {self.target} bootctl --variables=yes {" ".join(bootctl_options)} install') + else: + SysCommand(f'arch-chroot {self.target} bootctl {" ".join(bootctl_options)} install') except SysCallError: - # Fallback, try creating the boot loader without touching the EFI variables - SysCommand(f'arch-chroot {self.target} bootctl --variables=no {" ".join(bootctl_options)} install') + if systemd_version >= 258: + # Fallback, try creating the boot loader without touching the EFI variables + SysCommand(f'arch-chroot {self.target} bootctl --variables=no {" ".join(bootctl_options)} install') + else: + SysCommand(f'arch-chroot {self.target} bootctl --no-variables {" ".join(bootctl_options)} install') # Loader configuration is stored in ESP/loader: # https://man.archlinux.org/man/loader.conf.5 From 7b498f6488030efa60b9af38ac36749a8eeb1262 Mon Sep 17 00:00:00 2001 From: Torxed Date: Mon, 23 Jun 2025 18:20:50 +0200 Subject: [PATCH 2/5] Fixed ruff format check --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 14ce2515ac..796f61814d 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1174,7 +1174,7 @@ def _add_systemd_bootloader( # TODO: This is a temporary workaround to deal with https://github.com/archlinux/archinstall/pull/3396#issuecomment-2996862019 # the systemd_version check can be removed once `--variables=BOOL` is merged into systemd. - systemd_version = int(self.pacman.run("-Q systemd").trace_log.split(b" ")[1][:3].decode()) + systemd_version = int(self.pacman.run('-Q systemd').trace_log.split(b' ')[1][:3].decode()) # Install the boot loader try: # Force EFI variables since bootctl detects arch-chroot From 251070a89ab2c1adcce1ee09e0193d99d72b7bf5 Mon Sep 17 00:00:00 2001 From: Torxed Date: Mon, 23 Jun 2025 18:27:38 +0200 Subject: [PATCH 3/5] Fixed mypy type check issue --- archinstall/lib/installer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 796f61814d..1adf24834f 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1174,7 +1174,11 @@ def _add_systemd_bootloader( # TODO: This is a temporary workaround to deal with https://github.com/archlinux/archinstall/pull/3396#issuecomment-2996862019 # the systemd_version check can be removed once `--variables=BOOL` is merged into systemd. - systemd_version = int(self.pacman.run('-Q systemd').trace_log.split(b' ')[1][:3].decode()) + if pacman_q_systemd := self.pacman.run('-Q systemd').trace_log: + pacman_version = int(pacman_q_systemd.split(b' ')[1][:3].decode()) + else: + pacman_version = 257 # This works as a safety workaround for this hot-fix + # Install the boot loader try: # Force EFI variables since bootctl detects arch-chroot From f1b7bf0228448e0d9391a591a0586d53850c66f7 Mon Sep 17 00:00:00 2001 From: Torxed Date: Mon, 23 Jun 2025 18:34:06 +0200 Subject: [PATCH 4/5] Spelling error --- archinstall/lib/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 1adf24834f..091ef444db 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1175,9 +1175,9 @@ def _add_systemd_bootloader( # TODO: This is a temporary workaround to deal with https://github.com/archlinux/archinstall/pull/3396#issuecomment-2996862019 # the systemd_version check can be removed once `--variables=BOOL` is merged into systemd. if pacman_q_systemd := self.pacman.run('-Q systemd').trace_log: - pacman_version = int(pacman_q_systemd.split(b' ')[1][:3].decode()) + systemd_version = int(pacman_q_systemd.split(b' ')[1][:3].decode()) else: - pacman_version = 257 # This works as a safety workaround for this hot-fix + systemd_version = 257 # This works as a safety workaround for this hot-fix # Install the boot loader try: From 8630f6f72eb1c39c9655a25e7a9650c7475d2190 Mon Sep 17 00:00:00 2001 From: Torxed Date: Mon, 23 Jun 2025 18:34:36 +0200 Subject: [PATCH 5/5] Fixed flake8 complaint --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 091ef444db..ac861f022c 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1177,7 +1177,7 @@ def _add_systemd_bootloader( if pacman_q_systemd := self.pacman.run('-Q systemd').trace_log: systemd_version = int(pacman_q_systemd.split(b' ')[1][:3].decode()) else: - systemd_version = 257 # This works as a safety workaround for this hot-fix + systemd_version = 257 # This works as a safety workaround for this hot-fix # Install the boot loader try: