grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] grub-install: Include all decompressor modules in pvxen core


From: Ian Campbell
Subject: Re: [PATCH] grub-install: Include all decompressor modules in pvxen core image.
Date: Fri, 28 Nov 2014 17:25:55 +0000

On Fri, 2014-11-28 at 20:09 +0300, Andrei Borzenkov wrote:
> В Fri, 28 Nov 2014 08:33:34 +0000
> Ian Campbell <address@hidden> пишет:
> 
> > From: Ian Campbell <address@hidden>
> > 
> > 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.

> > +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.

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);
> >  
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]