From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuP3a-0000Rs-A8 for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 12:10:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuP3S-0000GN-IL for grub-devel@gnu.org; Fri, 28 Nov 2014 12:10:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuP3M-0006fD-GI for grub-devel@gnu.org; Fri, 28 Nov 2014 12:10:02 -0500 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:47216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuP3M-0006ev-9A for grub-devel@gnu.org; Fri, 28 Nov 2014 12:09:56 -0500 Received: by mail-la0-f50.google.com with SMTP id pn19so5130473lab.23 for ; Fri, 28 Nov 2014 09:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=1jRkkOOIecGYr5M47W6NLhi2sCT/1Iw/W6FabFezyLk=; b=ZfIR+zd8FcUIth9e3S6nbUCGujbwrAdlU4Rh39kss9YG27qk6QHpIuuaCyWiNlW3Zc yekONlMCF2FZwbDEm/TorhAcUREm0H7NS79mZCh5g35kNq7uW77Gzj6vNKLFVqDWjeKj sFQQjOT7EYFEHqnigHQ2Mi1KT/A2YmIbml4nyWksrLx2U9lT6x4jK1awOd5vUvkodJA3 43mZhM0r00oBdLCLSFkgKTHr7XpwxyjnipqzC/V3GsQdpK4G2WzY3SDoIfaieAK2bSgs bsthq4Fslb2KRxmjoSZZZJ3xG6z04DzC5nSPL1PJrc5t7+3ydjiPyJosaPQOURkHvfzG rqlA== X-Received: by 10.152.27.2 with SMTP id p2mr44594835lag.19.1417194595577; Fri, 28 Nov 2014 09:09:55 -0800 (PST) Received: from opensuse.site (ppp91-76-149-193.pppoe.mtu-net.ru. [91.76.149.193]) by mx.google.com with ESMTPSA id px7sm2707904lac.17.2014.11.28.09.09.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 09:09:54 -0800 (PST) Date: Fri, 28 Nov 2014 20:09:52 +0300 From: Andrei Borzenkov To: Ian Campbell Subject: Re: [PATCH] grub-install: Include all decompressor modules in pvxen core image. Message-ID: <20141128200952.31d2c6be@opensuse.site> In-Reply-To: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> References: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 Cc: 755256@bugs.debian.org, grub-devel@gnu.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 17:10:08 -0000 =D0=92 Fri, 28 Nov 2014 08:33:34 +0000 Ian Campbell =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > From: Ian Campbell >=20 > 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 wastefu= l on > native boots. >=20 Could you give some more details why you need it? > Signed-off-by: Ian Campbell > --- > util/grub-install.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > 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))) > } > =20 > static void > +push_all_decompressor_modules(void) > +{ > + grub_install_push_module ("gzio"); > + grub_install_push_module ("xzio"); > + grub_install_push_module ("lzopio"); > +} > + It is not enough. Some of them need another modules that are autoloaded by normal. > +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