raise error if systemd-boot is used on a BIOS system

This commit is contained in:
advaithm 2021-03-12 11:38:48 +05:30
parent 850fd2efa8
commit ceadb59b26
No known key found for this signature in database
GPG Key ID: E557E45E6DAFFC0C
1 changed files with 41 additions and 38 deletions

View File

@ -313,6 +313,7 @@ class Installer():
self.log(f'Adding bootloader {bootloader} to {self.boot_partition}', level=LOG_LEVELS.Info) self.log(f'Adding bootloader {bootloader} to {self.boot_partition}', level=LOG_LEVELS.Info)
if bootloader == 'systemd-bootctl': if bootloader == 'systemd-bootctl':
if hasUEFI():
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install')) o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader: with open(f'{self.mountpoint}/boot/loader/loader.conf', 'w') as loader:
loader.write('default arch\n') loader.write('default arch\n')
@ -356,6 +357,8 @@ class Installer():
return True return True
break break
raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.") raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.")
else:
raise RequirementError("Systemd boot is UEFI only it can not be installed or used on bios")
elif bootloader == 'grub-install': elif bootloader == 'grub-install':
if hasUEFI(): if hasUEFI():
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB')) o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB'))