Bug 12946 - Grub: Decompressor is too big.
Summary: Grub: Decompressor is too big.
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2020.02.2
Hardware: PC Linux
: P5 normal
Target Milestone: 2020.02
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-25 14:46 UTC by Stefan Walter
Modified: 2020-06-04 22:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
Small Buildroot defconfig (739 bytes, text/plain)
2020-05-29 09:25 UTC, Stefan Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Walter 2020-05-25 14:46:11 UTC
I'm using grub-mkimage from a Buildroot SDK built with "make sdk" to create a boot loader image that is later combined with a home partition image (using genimage). After updating (from 2018.02.12) to 2020.02.2, when running

grub-mkimage --config="$grub_early.cfg" --directory="$GRUB_DIR" -o "$OUTPUT_PATH"/grub_core.img --format=i386-pc --prefix==/boot/grub ${GRUB_MODULES}

I'm now seeing this:

grub-mkimage: error: Decompressor is too big.

I'm building on Ubuntu 19.10 with GCC 9.2.1. The problem itself seems to be known with the Grub developers: https://lists.gnu.org/archive/html/grub-devel/2020-03/msg00217.html

Is it possible to integrate the fix mentioned there for 2020.02.3?
Comment 1 Fabrice Fontaine 2020-05-25 18:01:21 UTC
Hi,

Thanks for the bug report, does the following patch fix your issue:
https://patchwork.ozlabs.org/project/buildroot/patch/20200525180029.2140650-1-fontaine.fabrice@gmail.com/ ?

Best Regards,

Fabrice
Comment 2 Stefan Walter 2020-05-26 06:17:35 UTC
Hi,

thanks for the patch! Unfortunately, the build of host-grub2 of the patched Buildroot fails with an automake version mismatch:

mv Makefile.util.am.new Makefile.util.am
 cd . && /bin/bash /home/vagrant/src/myproject/build/buildroot-src/buildroot-2020.02.2/output/build/host-grub2-2.04/build-aux/missing automake-1.15 --gnu Makefile
configure.ac:48: error: version mismatch.  This is Automake 1.15.1,
configure.ac:48: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:48: comes from Automake 1.15.  You should recreate
configure.ac:48: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.15' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make[1]: *** [Makefile:3350: Makefile.in] Error 63

Best regards,
Stefan
Comment 3 Fabrice Fontaine 2020-05-26 18:28:55 UTC
Thanks for spotting this issue, you'll find the v2 here: https://patchwork.ozlabs.org/project/buildroot/patch/20200526182937.2246421-1-fontaine.fabrice@gmail.com/
Comment 4 Fabrice Fontaine 2020-05-27 07:19:21 UTC
I sent a v3 following the review of Yann: https://patchwork.ozlabs.org/project/buildroot/patch/20200527071932.2307442-1-fontaine.fabrice@gmail.com/
Comment 5 Stefan Walter 2020-05-27 11:55:39 UTC
v3 works fine for me, thank you very much!
Comment 6 Yann E. MORIN 2020-05-27 20:20:27 UTC
Stefan, All,

Could you please provide a minimalistic defconfig that reproduces the issue, please?

I have Ubutun 19.10, but I could not reproduce your issue...

Regards,
Yann E. MORIN.
Comment 7 Stefan Walter 2020-05-28 05:47:21 UTC
Hi Yann,

which part is it that you cannot reproduce on your system - the build failure related to automake, or the original issue, i.e. the error thrown by grub-mkimage?

The original issue seems to depend on the environment's compiler used, not the one selected in Buildroot. According to https://lists.gnu.org/archive/html/grub-devel/2020-03/msg00217.html, it only occurs at least with GCC 8.3.0 and GCC 9.2.1 (which I am using), but not with GCC 7.5.0. Which GCC are you using?

Best regards,
Stefan
Comment 8 Yann E. MORIN 2020-05-28 20:21:30 UTC
Stefan,

> which part is it that you cannot reproduce on your system - the build failure related to automake, or the original issue, i.e. the error thrown by grub-mkimage?

Obviously it is your original issue I am speaking about, and that I can't reproduce.

> The original issue seems to depend on the environment's compiler used, not the one selected in Buildroot. According to https://lists.gnu.org/archive/html/grub-devel/2020-03/msg00217.html, it only occurs at least with GCC 8.3.0 and GCC 9.2.1 (which I am using), but not with GCC 7.5.0.

As I said, I am also on Ubuntu 19.10, so using gcc 9.2.1.
Comment 9 Stefan Walter 2020-05-29 09:25:24 UTC
Created attachment 8481 [details]
Small Buildroot defconfig
Comment 10 Stefan Walter 2020-05-29 09:38:10 UTC
(In reply to Yann E. MORIN from comment #8)

I have attached a small defconfig that I can reproduce the problem with. Without the patch, output/host/lib/grub/i386-pc/lzma_decompress.img has a size of 134479600 bytes, which is what causes the actual error with grub-mkimage; with the patch, the file's size is only 2864 bytes.

The exact compiler version used by me is: c++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008.

Best regards,
Stefan

p.s.: Please note that neither was it obvious which issue you were referring to, nor does mentioning the Ubuntu version clearly indicate which GCC version you're using. While the default compiler on Ubuntu 19.10 seems to be GCC 9, there are two more GCC versions in the package repository for you to choose from, of which one the problem does not seem to occur with (according to the report I linked to).
Comment 11 Yann E. MORIN 2020-06-04 22:10:37 UTC
Hello,

Thanks for the report. This is supposedly fixed now with commit 7e64a050fb.

Please give it a spin, and reopen if the issue is still present.

Regards,
Yann E. MORIN.