Added temporary hold on bootctl's --variables=BOOL usage, as it's notin systemd main yet (#3625)
* Added temporary hold on bootctl's --variables=BOOL usage, as it's not in systemd main yet * Fixed ruff format check * Fixed mypy type check issue * Spelling error * Fixed flake8 complaint
This commit is contained in:
parent
9d0e1e5576
commit
9dd92321a5
|
|
@ -1172,15 +1172,28 @@ class Installer:
|
||||||
bootctl_options.append(f'--esp-path={efi_partition.mountpoint}')
|
bootctl_options.append(f'--esp-path={efi_partition.mountpoint}')
|
||||||
bootctl_options.append(f'--boot-path={boot_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.
|
||||||
|
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
|
||||||
|
|
||||||
# Install the boot loader
|
# Install the boot loader
|
||||||
try:
|
try:
|
||||||
# Force EFI variables since bootctl detects arch-chroot
|
# Force EFI variables since bootctl detects arch-chroot
|
||||||
# as a container environemnt since v257 and skips them silently.
|
# as a container environemnt since v257 and skips them silently.
|
||||||
# https://github.com/systemd/systemd/issues/36174
|
# 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:
|
except SysCallError:
|
||||||
# Fallback, try creating the boot loader without touching the EFI variables
|
if systemd_version >= 258:
|
||||||
SysCommand(f'arch-chroot {self.target} bootctl --variables=no {" ".join(bootctl_options)} install')
|
# 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:
|
# Loader configuration is stored in ESP/loader:
|
||||||
# https://man.archlinux.org/man/loader.conf.5
|
# https://man.archlinux.org/man/loader.conf.5
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue