From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Ian Campbell <ijc@hellion.org.uk>
Cc: 755256@bugs.debian.org, grub-devel@gnu.org
Subject: Re: [PATCH] grub-install: Include all decompressor modules in pvxen core image.
Date: Sun, 30 Nov 2014 14:31:01 +0300 [thread overview]
Message-ID: <20141130143101.0bb4298e@opensuse.site> (raw)
In-Reply-To: <1417195555.23604.69.camel@hellion.org.uk>
В Fri, 28 Nov 2014 17:25:55 +0000
Ian Campbell <ijc@hellion.org.uk> пишет:
> On Fri, 2014-11-28 at 20:09 +0300, Andrei Borzenkov wrote:
> > В Fri, 28 Nov 2014 08:33:34 +0000
> > Ian Campbell <ijc@hellion.org.uk> пишет:
> >
> > > 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.
> > >
> >
> > 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.
>
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");
> > > +}
> > > +
> >
> > It is not enough. Some of them need another modules that are autoloaded
> > by normal.
>
> autoloading should work, I think.
>
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 = 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?
>
> >
> > > +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);
> > >
> >
> >
>
>
next prev parent reply other threads:[~2014-11-30 11:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 8:33 [PATCH] grub-install: Include all decompressor modules in pvxen core image Ian Campbell
2014-11-28 17:09 ` Andrei Borzenkov
2014-11-28 17:25 ` Ian Campbell
2014-11-30 11:31 ` Andrei Borzenkov [this message]
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=20141130143101.0bb4298e@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=755256@bugs.debian.org \
--cc=grub-devel@gnu.org \
--cc=ijc@hellion.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.