Bug#755256: [PATCH] grub-install: Include all decompressor modules in pvxen core image.

Ian Campbell ijc at hellion.org.uk
Fri Nov 28 08:33:34 UTC 2014


From: Ian Campbell <ijc at debian.org>

This avoids needing to update all the native update-grub stanzas to also probe
for and arrange to load the relevant decompressor, which would be wasteful on
native boots.

Signed-off-by: Ian Campbell <ijc at debian.org>
---
 util/grub-install.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/util/grub-install.c b/util/grub-install.c
index 7a7734e..6ad5afb 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -422,6 +422,14 @@ push_cryptodisk_module (const char *mod, void *data __attribute__ ((unused)))
 }
 
 static void
+push_all_decompressor_modules(void)
+{
+  grub_install_push_module ("gzio");
+  grub_install_push_module ("xzio");
+  grub_install_push_module ("lzopio");
+}
+
+static void
 probe_mods (grub_disk_t disk)
 {
   grub_partition_t part;
@@ -1228,6 +1236,23 @@ main (int argc, char *argv[])
 	}
     }
 
+
+  switch (platform)
+    {
+    case GRUB_INSTALL_PLATFORM_I386_XEN:
+    case GRUB_INSTALL_PLATFORM_X86_64_XEN:
+      /* When booting a Xen PV kernel grub may need to decompress the
+       * kernel which may use a variety of algorithmns. Since we try
+       * to reuse the native grub.cfg files rather than trying to
+       * insmod the relevant decompressors on the fly we build them
+       * into the core image. This means we avoid needlessly loading
+       * modules on native. */
+      push_all_decompressor_modules();
+      break;
+    default:
+      break;
+    }
+
   grub_install_copy_files (grub_install_source_directory,
 			   grubdir, platform);
 
-- 
2.1.3



More information about the Pkg-grub-devel mailing list