Commit cf2e07f0 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Only configure EFI if the system is EFI capable

parent a4cebc7f
......@@ -15,6 +15,7 @@
"""Configure system grub."""
import os
from typing import Callable, Dict, List, Optional
from idmslinux_installer.ilistate import IliState
......@@ -50,8 +51,8 @@ class ConfigSystemGrub(Plugin):
ili_state.output_callback(f'Installing grub MBR on {device}')
sysgrub.install_mbr(ili_state.target_root, device, ili_state.output_callback)
# Install grub in the efi directory if we have an efi filesystem
if ili_state.fstab['efi']:
# Install grub in the EFI directory if we have an efi filesystem and are on an efi enabled system
if (ili_state.fstab['efi'] and os.path.exists('/sys/firmware/efi/efivars')):
ili_state.output_callback('Installing grub EFI in %s' % ili_state.fstab['efi']['mount_point'])
sysgrub.install_efi(ili_state.target_root, ili_state.fstab['efi']['mount_point'], ili_state.output_callback)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment