From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Xv2ik-0004Lo-0D for mharc-grub-devel@gnu.org; Sun, 30 Nov 2014 06:31:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv2ic-0004Ko-Jz for grub-devel@gnu.org; Sun, 30 Nov 2014 06:31:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xv2iW-0004HA-UU for grub-devel@gnu.org; Sun, 30 Nov 2014 06:31:10 -0500 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:52785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv2iW-0004H0-N8 for grub-devel@gnu.org; Sun, 30 Nov 2014 06:31:04 -0500 Received: by mail-la0-f45.google.com with SMTP id gq15so7494272lab.18 for ; Sun, 30 Nov 2014 03:31:04 -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=CQjh+jmwGy0yQ0vDRcmaqb5QHEZQAHrlJwPUs7O0HHA=; b=FvqIFQ91VIy3jB1cQYV46wRGvWs3B4ig4TUMheHoVuXevfa99+x7TBG8KmaLRLlLAW ukHEFpK9OGaYoxpD0DQJ0yLhibP+ZE8Fyszn72aSIYp6mflmNiPX9ScjsfXTjKoxGp9A mxwZXCZtmCEa62HUZMeZHE2EIqQ+R43PAfi0ecsXPtDAjtWw7x82LbNu9gKzopiQ3pQw DETT1Wwvt0FQx02a6HiQ4s7GbPJnpmUnsuO+5ZUsffQd6v6zsqQt6zKG7ZC7HcP+W3Vb /7aXbXawxssadDNQlD7DEUCS0Dxk5b8i0o55nKYD92Pwmzn5F+4xpK4C5sj1atXL+Kxf GCBQ== X-Received: by 10.112.210.100 with SMTP id mt4mr51776680lbc.31.1417347063929; Sun, 30 Nov 2014 03:31:03 -0800 (PST) Received: from opensuse.site (ppp91-76-15-25.pppoe.mtu-net.ru. [91.76.15.25]) by mx.google.com with ESMTPSA id y3sm2379384lad.7.2014.11.30.03.31.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Nov 2014 03:31:03 -0800 (PST) Date: Sun, 30 Nov 2014 14:31:01 +0300 From: Andrei Borzenkov To: Ian Campbell Subject: Re: [PATCH] grub-install: Include all decompressor modules in pvxen core image. Message-ID: <20141130143101.0bb4298e@opensuse.site> In-Reply-To: <1417195555.23604.69.camel@hellion.org.uk> References: <1417163614-22703-1-git-send-email-ijc@hellion.org.uk> <20141128200952.31d2c6be@opensuse.site> <1417195555.23604.69.camel@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::22d 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: Sun, 30 Nov 2014 11:31:16 -0000 =D0=92 Fri, 28 Nov 2014 17:25:55 +0000 Ian Campbell =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > 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 a= lso probe > > > for and arrange to load the relevant decompressor, which would be was= teful on > > > native boots. > > >=20 > >=20 > > Could you give some more details why you need it? >=20 > In order to boot a Linux kernel under Xen grub needs to extract the ELF > file from the bzImage payload, which is compressed. >=20 > The compression algo is a kernel compile time option, gz and xz are the > most probably ones today. >=20 Not directly related but I this comment in Makefile draw my attention: # Note that the bytes added by size_append will make the xz tool think that # the file is corrupt. This is expected. We probably never read vmlinuz to the end anyway, but I wonder if it could be an issue. > > > +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. >=20 > autoloading should work, I think. >=20 OK, so you need it post-normal. core.img is really about getting access to /boot/grub; anything else can be done from within grub.cfg. If you do not want to load other filters unconditionally, just use if [ x$grub_platform =3D xxen ]; then insmod xzio fi But as far as I understand, CONFIG_KERNEL_XZ is not really dependent on Xen; so we may want to either load them for real hardware as well or - better - extend grub-file to check for compression method. > But if not -- how can one determine which modules are required and/or > arrange for them to be added automatically? >=20 > >=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 >=20 >=20