Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuPJ5-0005zA-FJ for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 12:26:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuPIy-0005ui-AR for grub-devel@gnu.org; Fri, 28 Nov 2014 12:26:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuPIs-0005dM-Kp for grub-devel@gnu.org; Fri, 28 Nov 2014 12:26:04 -0500 Received: from [2001:41c8:1:628a::89] (port=41020 helo=benson.vm.bytemark.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuPIs-0005cn-FN for grub-devel@gnu.org; Fri, 28 Nov 2014 12:25:58 -0500 Received: from [185.25.64.249] (helo=kazak) by benson.vm.bytemark.co.uk with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XuPIr-00036z-5Z; Fri, 28 Nov 2014 17:25:57 +0000 Message-ID: <1417195555.23604.69.camel@hellion.org.uk> Subject: Re: [PATCH] grub-install: Include all decompressor modules in pvxen core image. From: Ian Campbell To: Andrei Borzenkov Date: Fri, 28 Nov 2014 17:25:55 +0000 In-Reply-To: <20141128200952.31d2c6be@opensuse.site> References: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> <20141128200952.31d2c6be@opensuse.site> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7-1 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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, grub-devel@gnu.org 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 17:26:10 -0000 On Fri, 2014-11-28 at 20:09 +0300, Andrei Borzenkov wrote: > =D0=92 Fri, 28 Nov 2014 08:33:34 +0000 > Ian Campbell =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > > From: Ian Campbell > >=20 > > This avoids needing to update all the native update-grub stanzas to als= o probe > > for and arrange to load the relevant decompressor, which would be waste= ful on > > native boots. > >=20 >=20 > Could you give some more details why you need it? In order to boot a Linux kernel under Xen grub needs to extract the ELF file from the bzImage payload, which is compressed. The compression algo is a kernel compile time option, gz and xz are the most probably ones today. > > +push_all_decompressor_modules(void) > > +{ > > + grub_install_push_module ("gzio"); > > + grub_install_push_module ("xzio"); > > + grub_install_push_module ("lzopio"); > > +} > > + >=20 > It is not enough. Some of them need another modules that are autoloaded > by normal. autoloading should work, I think. But if not -- how can one determine which modules are required and/or arrange for them to be added automatically? >=20 > > +static void > > probe_mods (grub_disk_t disk) > > { > > grub_partition_t part; > > @@ -1228,6 +1236,23 @@ main (int argc, char *argv[]) > > } > > } > > =20 > > + > > + 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); > > =20 >=20 >=20