bugGNU GRUB - Bugs: bug #36770, grub-2.00: please support...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #36770: grub-2.00: please support compression for EFI architectures

Submitted by:  Maxim Kammerer <mkdesu>
Submitted on:  Tue 03 Jul 2012 09:23:57 AM UTC  
 
Category: InstallationSeverity: Major
Priority: 5 - NormalItem Group: Feature Request
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: otherReproducibility: None
Planned Release: None

(Jump to the original submission Jump to the original submission)

Sun 08 Jul 2012 03:14:39 PM UTC, comment #13:

gzip compression (and adding gzio outside of memdisk) also works well now wrt. "search" command.

Maxim Kammerer <mkdesu>
Sun 08 Jul 2012 02:59:09 PM UTC, comment #12:

> Here is the patch again.


Thanks, the patch fixed the issue with compressing individual modules for me -- preloading fs modules is not necessary anymore.

> memdisk isn't a file so the filters aren't used.


Is it possible to add this functionality? This bug is a feature request, after all.

Maxim Kammerer <mkdesu>
Sun 08 Jul 2012 12:53:34 PM UTC, comment #11:

Hm, apparently my previous comment was lost somehow. Here is the patch again. memdisk isn't a file so the filters aren't used.

(file #26165)

Vladimir Serbinenko <phcoder>
Project Administrator
Sun 08 Jul 2012 12:33:00 PM UTC, comment #10:

Is it possible that calling grub_file_filter_disable_compression() in grub-core/commands/search.c interferes with automatically decompressing modules?

As a side note, is it that difficult to open memdisk through a compression filter (similarly to grub_file_open())? Compressing the whole memdisk would be far superior to compressing individual modules.

Maxim Kammerer <mkdesu>
Sat 07 Jul 2012 09:36:39 PM UTC, comment #9:

I think I have found the culprit. Everything in memdisk can be compressed with xz (modules, *.lst, embedded grub.cfg), but the "search" command works only if fs modules are either loaded beforehand, or not compressed (their dependencies, such as "fshelp", can be compressed).

E.g.:
insmod part_msdos
insmod part_gpt

insmod iso9660
insmod fat
insmod ext2
insmod hfsplus

search -fns root ...

I tested this extensively with iso9660.

Is it possible that "search" circumvents transparent decompression when autoloading modules? Is it actually expected to do that (autoloading doesn't seem to work again after rmmod'ing everything in "normal" mode)? I.e., "insmod part_*" above be there because "search" in GRUB 1.99 wouldn't work otherwise with partitions (didn't test with GRUB 2.00) -- shouldn't these be autoloaded as well on "search"?

Maxim Kammerer <mkdesu>
Sat 07 Jul 2012 07:33:39 PM UTC, comment #8:

You are right, including "gcry_crc" in addition to "xzio" (and its dependent "crypto"), and compressing with "xz -C crc32" (as mentioned in the manual [1]) works similarly to including "gzio" and compressing with "gzip -9".

I still get an "ELF magic" error for some modules, probably the same as with gzio -- will try to figure out which ones these are exactly.

[1] http://www.gnu.org/software/grub/manual/html_node/Features.html#fn-1

Maxim Kammerer <mkdesu>
Sat 07 Jul 2012 06:24:07 PM UTC, comment #7:

Correction: you need both gcry_crc and gcry_crc64 with default xz options. As for the gzio problem I couldn't reproduce it.

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 07 Jul 2012 05:59:08 PM UTC, comment #6:

I've noticed now another thing: you didn't include the gcry_sha256 with xzio.

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 07 Jul 2012 03:42:46 PM UTC, comment #5:

> Compressing files in memdisk isn't platform-dependent. You haven't indicated anything about any actions to include xzio/gzio in preloaded modules or avoiding compressing them and explicitly loading when compressing individual files.


I tried compressing all modules except gzio with gzip, and adding them to memdisk, or adding gzio outside of memdisk. Some modules would load fine (e.g., "normal"), others wouldn't (e.g., "gfxterm"), with error message indicated above.

> -C is supported only for i386-pc and mips-* as there is little real reason for compression on other platforms.


Decreasing ISO image size is one good reason, I think.

Maxim Kammerer <mkdesu>
Sat 07 Jul 2012 03:27:05 PM UTC, comment #4:

What is the reason to compress on EFI at all? There are no size limits there and 3 MiB isn't big by modern measures.

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 07 Jul 2012 03:21:10 PM UTC, comment #3:

Compressing files in memdisk isn't platform-dependent. You haven't indicated anything about any actions to include xzio/gzio in preloaded modules or avoiding compressing them and explicitly loading when compressing individual files.
-C is supported only for i386-pc and mips-* as there is little real reason for compression on other platforms.

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 07 Jul 2012 03:03:20 PM UTC, comment #2:

> 1) Ensure you use the last version.


Which latest version? I am using version 2.00, as indicated in the title of this bug report. The latest version listed at ftp://ftp.gnu.org/gnu/grub/ is 2.00.

Moreover, I am looking at:
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/util/grub-mkimage.c#L174

There is no .flags = PLATFORM_FLAGS_DECOMPRESSORS for -efi targets. Hence, "grub-mkimage --compression" flag is ignored for -efi targets. Is this incorrect?

> 2) Not compress decompressors and their dependencies.


Did you miss the "most (gzip)" and "adding gzio or xzio to modules list in grub-mkimage" remarks? It means that gzio module is not compressed, and that some modules decompress fine when loaded. Others result in "error: invalid arch independent ELF magic".

> 3) Use only supported compressing options. Defaults should be ok.


Did you actually test any compression option with *-efi targets?

Maxim Kammerer <mkdesu>
Sat 07 Jul 2012 09:10:21 AM UTC, comment #1:

You need to:
1) Ensure you use the last version.
2) Not compress decompressors and their dependencies.
3) Use only supported compressing options. Defaults should be ok.

Vladimir Serbinenko <phcoder>
Project Administrator
Tue 03 Jul 2012 09:23:57 AM UTC, original submission:

Currently, there is no way to compress *-efi images.

"grub-mkimage --compression" is not supported (see https://bugs.gentoo.org/show_bug.cgi?id=424527).

memdisk compression is not supported -- compressing memdisk (and adding gzio or xzio to modules list in grub-mkimage) results in "error: unknown filesystem".

Individually compressing modules before adding them to memdisk results in "error: invalid arch independent ELF magic" for most (gzip) or all (xz -C crc32) modules.

The above was tested mainly on x86_64-efi (TianoCore) with Gentoo's GRUB 2.00.

Thanks.

Maxim Kammerer <mkdesu>

 

Attached Files
file #26165:  comp.diff added by phcoder (2kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by mkdesu (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Jul 2012 12:53:34 PM UTCphcoderAttached File-=>Added comp.diff, #26165

    Back to the top


    Powered by Savane 3.1-cleanup