Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuH04-0000UX-2N for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 03:34:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuGzt-0000Q4-0b for grub-devel@gnu.org; Fri, 28 Nov 2014 03:33:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuGzi-0004yh-KQ for grub-devel@gnu.org; Fri, 28 Nov 2014 03:33:48 -0500 Received: from [2001:41c8:1:628a::89] (port=36961 helo=benson.vm.bytemark.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuGzi-0004yZ-Fd for grub-devel@gnu.org; Fri, 28 Nov 2014 03:33:38 -0500 Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginm.net ([86.6.25.227] helo=celaeno.hellion.org.uk) by benson.vm.bytemark.co.uk with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XuGzh-0000LO-2z; Fri, 28 Nov 2014 08:33:37 +0000 Received: from dagon.hellion.org.uk ([192.168.1.7]) by celaeno.hellion.org.uk with smtp (Exim 4.80) (envelope-from ) id 1XuGze-0001gO-Ls; Fri, 28 Nov 2014 08:33:35 +0000 Received: by dagon.hellion.org.uk (sSMTP sendmail emulation); Fri, 28 Nov 2014 08:33:34 +0000 From: Ian Campbell To: grub-devel@gnu.org Subject: [PATCH] grub-install: Include all decompressor modules in pvxen core image. Date: Fri, 28 Nov 2014 08:33:34 +0000 Message-Id: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> X-Mailer: git-send-email 2.1.3 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:41c8:1:628a::89 Cc: 755256@bugs.debian.org, Ian Campbell X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 08:33:58 -0000 From: Ian Campbell 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 --- 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