mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
installer: Create a flag that marks if EFI support is available
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -81,7 +81,10 @@ struct hw* hw_init() {
|
|||||||
// Detect if we are running in EFI mode
|
// Detect if we are running in EFI mode
|
||||||
ret = access("/sys/firmware/efi", R_OK);
|
ret = access("/sys/firmware/efi", R_OK);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
hw->efi = 1;
|
hw->efi_supported = 1;
|
||||||
|
|
||||||
|
// Should we install in EFI mode?
|
||||||
|
hw->efi = 1;
|
||||||
|
|
||||||
return hw;
|
return hw;
|
||||||
}
|
}
|
||||||
@@ -1063,7 +1066,8 @@ int hw_install_bootloader(struct hw* hw, struct hw_destination* dest, const char
|
|||||||
// Install GRUB in EFI mode
|
// Install GRUB in EFI mode
|
||||||
if (hw->efi) {
|
if (hw->efi) {
|
||||||
snprintf(cmd, sizeof(cmd), "/usr/sbin/grub-install"
|
snprintf(cmd, sizeof(cmd), "/usr/sbin/grub-install"
|
||||||
" --target=%s-efi --efi-directory=%s", hw->arch, HW_PATH_BOOT_EFI);
|
" --target=%s-efi --efi-directory=%s %s", hw->arch, HW_PATH_BOOT_EFI,
|
||||||
|
(hw->efi_supported) ? "" : "--no-nvram");
|
||||||
|
|
||||||
r = system_chroot(output, DESTINATION_MOUNT_PATH, cmd);
|
r = system_chroot(output, DESTINATION_MOUNT_PATH, cmd);
|
||||||
if (r)
|
if (r)
|
||||||
|
|||||||
@@ -60,7 +60,12 @@
|
|||||||
struct hw {
|
struct hw {
|
||||||
struct udev *udev;
|
struct udev *udev;
|
||||||
char arch[STRING_SIZE];
|
char arch[STRING_SIZE];
|
||||||
|
|
||||||
|
// Enabled if we should install in EFI mode
|
||||||
int efi;
|
int efi;
|
||||||
|
|
||||||
|
// Enabled if this system supports EFI
|
||||||
|
int efi_supported;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hw_disk {
|
struct hw_disk {
|
||||||
|
|||||||
Reference in New Issue
Block a user