]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/installer/hw.c
installer: Install GRUB in removable mode as well
[ipfire-2.x.git] / 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