]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
installer: Install GRUB in removable mode as well
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Jun 2018 17:18:25 +0000 (18:18 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Jul 2018 12:43:53 +0000 (13:43 +0100)
This allows that a system will boot IPFire even when
no boot entry is configured in the EFI BIOS

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/installer/hw.c

index 7bbda22defdaa25a01d8a7caf855cfa614c87519..3bd7480363c279f880497f01856e6837cf5ea0e1 100644 (file)
@@ -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