grub-install: Install PV Xen binaries into the upstream specified path
authorIan Campbell <ijc@hellion.org.uk>
Sat, 6 Sep 2014 11:20:12 +0000 (12:20 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
Upstream have defined a specification for where guests ought to place their
xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
loaded from dom0.

http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html

The spec calls for installation into /boot/xen/pvboot-i386.elf or
/boot/xen/pvboot-x86_64.elf.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Bug-Debian: https://bugs.debian.org/762307
Forwarded: http://lists.gnu.org/archive/html/grub-devel/2014-10/msg00041.html
Last-Update: 2014-10-24

Patch-Name: grub-install-pvxen-paths.patch

Gbp-Pq: Name grub-install-pvxen-paths.patch

util/grub-install.c

index 4c155ec8cb469774246bf878ce7933dcc3e53d00..44ae196f356c28364b681bbb22a366337e2847e1 100644 (file)
@@ -2042,6 +2042,28 @@ main (int argc, char *argv[])
        }
       break;
 
+    case GRUB_INSTALL_PLATFORM_I386_XEN:
+      {
+       char *path = grub_util_path_concat (2, bootdir, "xen");
+       char *dst = grub_util_path_concat (2, path, "pvboot-i386.elf");
+       grub_install_mkdir_p (path);
+       grub_install_copy_file (imgfile, dst, 1);
+       free (dst);
+       free (path);
+      }
+      break;
+
+    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
+      {
+       char *path = grub_util_path_concat (2, bootdir, "xen");
+       char *dst = grub_util_path_concat (2, path, "pvboot-x86_64.elf");
+       grub_install_mkdir_p (path);
+       grub_install_copy_file (imgfile, dst, 1);
+       free (dst);
+       free (path);
+      }
+      break;
+
     case GRUB_INSTALL_PLATFORM_MIPSEL_LOONGSON:
     case GRUB_INSTALL_PLATFORM_MIPSEL_QEMU_MIPS:
     case GRUB_INSTALL_PLATFORM_MIPS_QEMU_MIPS:
@@ -2051,8 +2073,6 @@ main (int argc, char *argv[])
     case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
     case GRUB_INSTALL_PLATFORM_ARM_UBOOT:
     case GRUB_INSTALL_PLATFORM_I386_QEMU:
-    case GRUB_INSTALL_PLATFORM_I386_XEN:
-    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
     case GRUB_INSTALL_PLATFORM_I386_XEN_PVH:
       grub_util_warn ("%s",
                      _("WARNING: no platform-specific install was performed"));