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.
|
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.
|
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)
|
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.
|
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"?
|
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
|
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.
|
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.
|
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.
|
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.
|
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.
|
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?
|
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.
|
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.
|