Adding a fallback systemd-boot install if writing variables failed.

This commit is contained in:
Anton Hvornum 2021-05-14 21:09:06 +02:00
parent 71b14ec9fd
commit 0df6eced77
1 changed files with 3 additions and 1 deletions

View File

@ -381,7 +381,9 @@ class Installer():
# And in which case we should do some clean up.
# Install the boot loader
sys_command(f'/usr/bin/arch-chroot {self.target} bootctl --path=/boot install')
if sys_command(f'/usr/bin/arch-chroot {self.target} bootctl --path=/boot install').exit_code != 0:
# Fallback, try creating the boot loader without touching the EFI variables
sys_command(f'/usr/bin/arch-chroot {self.target} bootctl --no-variables --path=/boot install')
# Modify or create a loader.conf
if os.path.isfile(f'{self.target}/boot/loader/loader.conf'):