grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@hellion.org.uk>
To: grub-devel@gnu.org
Cc: 755256@bugs.debian.org, Ian Campbell <ijc@debian.org>
Subject: [PATCH] grub-install: Include all decompressor modules in pvxen core image.
Date: Fri, 28 Nov 2014 08:33:34 +0000	[thread overview]
Message-ID: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> (raw)

From: Ian Campbell <ijc@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@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



             reply	other threads:[~2014-11-28  8:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28  8:33 Ian Campbell [this message]
2014-11-28 17:09 ` [PATCH] grub-install: Include all decompressor modules in pvxen core image Andrei Borzenkov
2014-11-28 17:25   ` Ian Campbell
2014-11-30 11:31     ` Andrei Borzenkov
2014-11-30 11:51       ` Ian Campbell
2014-11-30 11:52         ` Ian Campbell
2014-11-30 13:34         ` Ian Campbell
2014-12-07 17:18           ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-12-07 17:26             ` Andrei Borzenkov
2014-12-07 21:53               ` Vladimir 'φ-coder/phcoder' Serbinenko
2016-02-12 16:28               ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417163614-22703-1-git-send-email-ijc@hellion.org.uk \
    --to=ijc@hellion.org.uk \
    --cc=755256@bugs.debian.org \
    --cc=grub-devel@gnu.org \
    --cc=ijc@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).