Bug 14281 - Boot process stuck at "GRUB loading.." since 2021.02.1
Summary: Boot process stuck at "GRUB loading.." since 2021.02.1
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2021.02.5
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-18 12:08 UTC by Stefan Walter
Modified: 2024-06-15 15:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
Buildroot configuration (1.17 KB, text/plain)
2021-10-18 12:12 UTC, Stefan Walter
Details
GRUB configuration (49 bytes, text/plain)
2021-10-18 12:12 UTC, Stefan Walter
Details
genimage configuration (537 bytes, text/plain)
2021-10-18 12:12 UTC, Stefan Walter
Details
host-grub2.patch (410 bytes, patch)
2021-10-20 13:05 UTC, Stefan Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Walter 2021-10-18 12:08:58 UTC
The following used to work until including Buildroot 2021.02, i.e. the resulting image used to boot normally. Ever since Buildroot 2021.02.1, the resulting image does not boot any more - the boot process either gets stuck right after displaying "GRUB loading..", or it reboots at that point, leading to an infinite boot loop. More specifically, this problem exists since the following commit:

e840f2d469 boot/grub2: Backport 2021/03/02 securify fixes

Here's what I'm doing:

1. Run Buildroot to create a root partition image (my_defconfig attached).
2. Create a GRUB image like this (grub_early.cfg attached):

/path/to/buildroot-sdk/host/bin/grub-mkimage --config=grub_early.cfg --directory=/path/to/buildroot-sdk/host/lib/grub/i386-pc -o ./genimage_input_tmp/grub_core.img --format=i386-pc --prefix==/boot/grub biosdisk part_msdos ext2 normal linux configfile

3. Create a home partition image like this:

MKE2FS_CONFIG=/path/to/buildroot-sdk/host/etc/mke2fs.conf /path/to/buildroot-sdk/host/sbin/mke2fs -d home_partition_prep/home -j -L home -t ext3 -U random -b 4096 ./genimage_input_tmp/home.ext3 25M

4. Create a disk image like this (genimage.cfg attached):

/path/to/buildroot-sdk/host/bin/genimage --loglevel=1 --config=genimage.cfg --inputpath=./genimage_input_tmp --outputpath=images --rootpath=home_partition_prep --tmppath=./genimage_tmp --tune2fs=/path/to/buildroot-sdk/host/usr/sbin/tune2fs --e2fsck=/path/to/buildroot-sdk/host/usr/sbin/e2fsck

(Note that I had also previously raised this issue on the Buildroot mailing list - see http://lists.busybox.net/pipermail/buildroot/2021-October/625323.html.)
Comment 1 Stefan Walter 2021-10-18 12:12:05 UTC
Created attachment 9121 [details]
Buildroot configuration
Comment 2 Stefan Walter 2021-10-18 12:12:35 UTC
Created attachment 9126 [details]
GRUB configuration
Comment 3 Stefan Walter 2021-10-18 12:12:56 UTC
Created attachment 9131 [details]
genimage configuration
Comment 4 Thomas Petazzoni 2021-10-18 18:47:12 UTC
When you say "The following used to work until including Buildroot 2021.02", could you clarify which version of Buildroot works for you ? 2020.11 is working ?

If so, could you take 2021.02, and try to downgrade the version of gcc and/or binutils ? Buildroot offers the choice of 3 versions for gcc and binutils: X-1, X and X+1, where X is the default. Could you try to use X-1 for gcc, and X-1 for binutils, and see if it improves the situation ?
Comment 5 Stefan Walter 2021-10-19 15:31:08 UTC
No problem:

- Version 2020.02.11 works
- Version 2021.02 works
- Version 2021.02.1 does not work

I could try using other GCC versions, and had actually already started doing that, but the hint given at http://lists.busybox.net/pipermail/buildroot/2021-October/626296.html revealed that using the GRUB image in build/grub2-2.04/grub-core instead of the one in host/lib/grub/i386-pc helps. I can confirm that I get a booting image with that.

So, as mentioned by Peter in that e-mail, it looks like a problem with host-grub2...?
Comment 6 Stefan Walter 2021-10-20 13:04:13 UTC
I'll attach the patch that Peter sent in http://lists.busybox.net/pipermail/buildroot/2021-October/626342.html to this issue for the sake of completeness. I can confirm that, with the patch applied to the head of the 2021.02.x branch (241a7c6fe7 in my case), I get a booting image again. It would be great to have this in 2021.02.7.
Comment 7 Stefan Walter 2021-10-20 13:05:36 UTC
Created attachment 9136 [details]
host-grub2.patch
Comment 8 Yann E. MORIN 2024-06-15 15:00:01 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!