From: Michael Tremer Date: Sun, 17 Jun 2018 17:18:25 +0000 (+0100) Subject: installer: Install GRUB in removable mode as well X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a0b7e0ad3973581329f8bfe4a7d90e4e4df9b64;p=people%2Fms%2Fipfire-2.x.git installer: Install GRUB in removable mode as well This allows that a system will boot IPFire even when no boot entry is configured in the EFI BIOS Signed-off-by: Michael Tremer --- diff --git a/src/installer/hw.c b/src/installer/hw.c index 7bbda22def..3bd7480363 100644 --- a/src/installer/hw.c +++ b/src/installer/hw.c @@ -1066,13 +1066,17 @@ int hw_install_bootloader(struct hw* hw, struct hw_destination* dest, const char // Install GRUB in EFI mode if (hw->efi) { - snprintf(cmd, sizeof(cmd), "/usr/sbin/grub-install" - " --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); - if (r) - return r; + for (int removable = 0; removable < 1; removable++) { + snprintf(cmd, sizeof(cmd), "/usr/sbin/grub-install" + " --target=%s-efi --efi-directory=%s %s %s", + hw->arch, HW_PATH_BOOT_EFI, + (hw->efi_supported) ? "" : "--no-nvram", + (removable) ? "--removable" : ""); + + r = system_chroot(output, DESTINATION_MOUNT_PATH, cmd); + if (r) + return r; + } } // Generate configuration file