All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
@ 2021-10-07 20:36 Walter, Stefan
  2021-10-07 21:50 ` Peter Seiderer
  2021-10-08 16:53 ` Alexander Dahl
  0 siblings, 2 replies; 13+ messages in thread
From: Walter, Stefan @ 2021-10-07 20:36 UTC (permalink / raw)
  To: buildroot

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

Hi,

the following used to work until Buildroot 2021.02, i.e. the resulting image booted normally. Ever since Buildroot 2021.02.1 and up until 2021.02.5, 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.

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

Does anyone have any idea what's going wrong here since 2021.02.1?

Best regards,
Stefan

[-- Attachment #2: genimage.cfg --]
[-- Type: application/octet-stream, Size: 537 bytes --]

image compactflash.img {
  hdimage {
    align = 512
    partition-table = true
  }

  partition boot {
    in-partition-table = false
    image = "grub_boot.img"
    offset = 0
    size = 512
  }

  partition grub {
    in-partition-table = false
    image = "grub_core.img"
    offset = 512
    #size =
  }

  partition root {
    partition-type = 0x83
    bootable = true
    # An existing image of the partition's file system.
    image = "rootfs.ext2"
  }

  partition home {
    partition-type = 0x83
    image = "home.ext3"
  }
}

[-- Attachment #3: grub_early.cfg --]
[-- Type: application/octet-stream, Size: 49 bytes --]

set root=hd0,msdos1
set prefix=($root)/boot/grub

[-- Attachment #4: my_defconfig --]
[-- Type: application/octet-stream, Size: 1196 bytes --]

BR2_DL_DIR="$(HOME)/.buildroot-downloads"
BR2_CCACHE=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_KERNEL_HEADERS_4_19=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_GCC_ENABLE_LTO=y
BR2_INIT_SYSV=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_BASH=y
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_LATEST_CIP_VERSION=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LINUX_FIRMWARE=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y
BR2_PACKAGE_BIND=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
# BR2_PACKAGE_URANDOM_SCRIPTS is not set
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_UTIL_LINUX_LIBUUID=y
BR2_PACKAGE_UTIL_LINUX_LAST=y
BR2_PACKAGE_UTIL_LINUX_LOGIN=y
BR2_PACKAGE_UTIL_LINUX_RUNUSER=y
BR2_PACKAGE_UTIL_LINUX_SU=y
BR2_PACKAGE_UTIL_LINUX_SULOGIN=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_3=y
BR2_TARGET_ROOTFS_EXT2_SIZE="500M"
BR2_TARGET_GRUB2=y
BR2_PACKAGE_HOST_E2TOOLS=y
BR2_PACKAGE_HOST_GENEXT2FS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_GENPART=y
BR2_PACKAGE_HOST_GPTFDISK=y
BR2_PACKAGE_HOST_MTD=y
BR2_PACKAGE_HOST_PARTED=y

[-- Attachment #5: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-07 20:36 [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1 Walter, Stefan
@ 2021-10-07 21:50 ` Peter Seiderer
  2021-10-08 14:27   ` Walter, Stefan
  2021-10-08 16:53 ` Alexander Dahl
  1 sibling, 1 reply; 13+ messages in thread
From: Peter Seiderer @ 2021-10-07 21:50 UTC (permalink / raw)
  To: Walter, Stefan; +Cc: buildroot

Hello Walter,

On Thu, 7 Oct 2021 20:36:07 +0000, "Walter, Stefan" <stefan.walter@iml.fraunhofer.de> wrote:

> Hi,
>
> the following used to work until Buildroot 2021.02, i.e. the resulting image booted normally. Ever since Buildroot 2021.02.1 and up until 2021.02.5, 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.
>
> 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
>
> Does anyone have any idea what's going wrong here since 2021.02.1?

Only known issue was 'Bug 13586 - grub failure with BR2_OPTIMIZE_3' (see [1]),
but should be fixed by commit 'boot/grub2: workaround breakage with -O2,
-O3 build' (see [2])

Regards,
Peter

[1] https://bugs.busybox.net/show_bug.cgi?id=13586
[2] https://git.buildroot.net/buildroot/commit/?id=7cb51d4843caaa9144270d92f86e60d8b5a2a1ec

>
> Best regards,
> Stefan

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-07 21:50 ` Peter Seiderer
@ 2021-10-08 14:27   ` Walter, Stefan
  2021-10-08 17:25     ` Peter Seiderer
  0 siblings, 1 reply; 13+ messages in thread
From: Walter, Stefan @ 2021-10-08 14:27 UTC (permalink / raw)
  To: buildroot; +Cc: Peter Seiderer

Hi Peter,

> Von: Peter Seiderer <ps.report@gmx.net>
> Betreff: Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
> 
> > Does anyone have any idea what's going wrong here since 2021.02.1?
> 
> Only known issue was 'Bug 13586 - grub failure with BR2_OPTIMIZE_3' (see
> [1]), but should be fixed by commit 'boot/grub2: workaround breakage with -O2,
> -O3 build' (see [2])
> [1] https://bugs.busybox.net/show_bug.cgi?id=13586
> [2] https://git.buildroot.net/buildroot/commit/?id=7cb51d4843caaa9144270d92f86e60d8b5a2a1ec

I was aware of this issue, and I had hoped that it would fix the problem. Unfortunately, it did not. I even explicitly built all of Buildroot with "-Os" instead of "-O2" once, but that didn't help, either.

Is anyone able to boot (an i386 machine) with a setup like the one I have described?

Best regards,
Stefan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-07 20:36 [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1 Walter, Stefan
  2021-10-07 21:50 ` Peter Seiderer
@ 2021-10-08 16:53 ` Alexander Dahl
  1 sibling, 0 replies; 13+ messages in thread
From: Alexander Dahl @ 2021-10-08 16:53 UTC (permalink / raw)
  To: Walter, Stefan; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2170 bytes --]

Hello Stefan

On Thu, Oct 07, 2021 at 08:36:07PM +0000, Walter, Stefan wrote:
> the following used to work until Buildroot 2021.02, i.e. the
> resulting image booted normally. Ever since Buildroot 2021.02.1 and
> up until 2021.02.5, 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.

Sounds like should try git bisect between 2021.02 and 2021.02.1 to
identify the commit which broke your setup?

Greets
Alex

> 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
> 
> Does anyone have any idea what's going wrong here since 2021.02.1?
> 
> Best regards,
> Stefan




> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot


-- 
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN     | speech censured, the first thought forbidden, the
 X  AGAINST      | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-08 14:27   ` Walter, Stefan
@ 2021-10-08 17:25     ` Peter Seiderer
  2021-10-11 12:23       ` Walter, Stefan
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Seiderer @ 2021-10-08 17:25 UTC (permalink / raw)
  To: Walter, Stefan; +Cc: buildroot

Hello Walter,

On Fri, 8 Oct 2021 14:27:35 +0000, "Walter, Stefan" <stefan.walter@iml.fraunhofer.de> wrote:

> Hi Peter,
>
> > Von: Peter Seiderer <ps.report@gmx.net>
> > Betreff: Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
> >
> > > Does anyone have any idea what's going wrong here since 2021.02.1?
> >
> > Only known issue was 'Bug 13586 - grub failure with BR2_OPTIMIZE_3' (see
> > [1]), but should be fixed by commit 'boot/grub2: workaround breakage with -O2,
> > -O3 build' (see [2])
> > [1] https://bugs.busybox.net/show_bug.cgi?id=13586
> > [2] https://git.buildroot.net/buildroot/commit/?id=7cb51d4843caaa9144270d92f86e60d8b5a2a1ec
>
> I was aware of this issue, and I had hoped that it would fix the problem. Unfortunately, it did not. I even explicitly built all of Buildroot with "-Os" instead of "-O2" once, but that didn't help, either.

That's sad...

>
> Is anyone able to boot (an i386 machine) with a setup like the one I have described?

I have on running config with grub/i386, buildroot-2021.02.4 based...

Maybe try to 'bisect' the problem as you mentioned it worked before 2021.02.1 (did
you test 2021.02.0?), not much grub related patches in between...

  1fcdfbfb8a Update for 2019.08
  ea7ec41cf6 boot/grub2: bump to verson 2.04
  836b84a774 Update for 2019.11
  5f5477b0ab Update for 2020.02
  7e64a050fb boot/grub2: Fix GRUB i386-pc build with Ubuntu gcc
  2f7a8021b5 boot/grub2: Backport Boothole securify fixes
  2766f34619 Update for 2020.08
  9624a001f9 Update for 2020.11
  e2fba6457b Update for 2021.02
  e840f2d469 boot/grub2: Backport 2021/03/02 securify fixes
  300c8d20b5 boot/grub2: ignore the last 3 remaining CVEs
  6668381363 CHANGES: Add last minute 2021.02.1 updates
  76b4f9e9b6 Update for 2021.02.2
  5293208a57 Update for 2021.02.3
  860c15087d boot/grub2: workaround breakage with -O2, -O3 build
  004a792dcf Update for 2021.02.4
  6d9e38c427 package/swupdate: don't require website for services

Start with reverting 'e840f2d469 boot/grub2: Backport 2021/03/02 securify fixes'...

Regards,
Peter

>
> Best regards,
> Stefan
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-08 17:25     ` Peter Seiderer
@ 2021-10-11 12:23       ` Walter, Stefan
  2021-10-11 17:29         ` Walter, Stefan
  0 siblings, 1 reply; 13+ messages in thread
From: Walter, Stefan @ 2021-10-11 12:23 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

Hi Peter,

> Von: Peter Seiderer <ps.report@gmx.net>
> 
> > Is anyone able to boot (an i386 machine) with a setup like the one I have
> > described?
> 
> I have on running config with grub/i386, buildroot-2021.02.4 based...

that's strange. Building with the configuration that was attached to my original e-mail, it doesn't even boot with qemu, so it's a problem local to the actual hardware. I just re-checked with 2021.02.4, too.

> Maybe try to 'bisect' the problem as you mentioned it worked before
> 2021.02.1 (did you test 2021.02.0?), not much grub related patches in
> between...

Buildroot 2021.02(.0) does boot, the following releases on the 2021.02.x branch don't. I just tested 2021.08 with the same configuration file, and it doesn't boot, either.

I haven't actually bisected, yet, but looking at the commit log, ...

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

...this looks like the most likely culprit, because it's the only commit to boot/grub2 I see that makes any changes to the GRUB sources between 2021.02 and 2021.02.1.

>   300c8d20b5 boot/grub2: ignore the last 3 remaining CVEs

This one doesn't actually make any changes to the GRUB sources, so I guess it's not it.

>   860c15087d boot/grub2: workaround breakage with -O2, -O3 build

As mentioned, I had hoped for this commit to fix the behaviour, but the following 2021.02 releases still don't work for me.

I'll bisect to be able to point at the actual commit more confidently.

Best regards,
Stefan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-11 12:23       ` Walter, Stefan
@ 2021-10-11 17:29         ` Walter, Stefan
  2021-10-18 22:22           ` Peter Seiderer
  0 siblings, 1 reply; 13+ messages in thread
From: Walter, Stefan @ 2021-10-11 17:29 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

Hi,

> > Maybe try to 'bisect' the problem as you mentioned it worked before
> > 2021.02.1 (did you test 2021.02.0?), not much grub related patches in
> > between...
> 
> Buildroot 2021.02(.0) does boot, the following releases on the 2021.02.x
> branch don't. I just tested 2021.08 with the same configuration file, and it
> doesn't boot, either.
> 
> I haven't actually bisected, yet, but looking at the commit log, ...
> 
> >   e840f2d469 boot/grub2: Backport 2021/03/02 securify fixes
> 
> ...this looks like the most likely culprit, because it's the only commit to
> boot/grub2 I see that makes any changes to the GRUB sources between
> 2021.02 and 2021.02.1.

I can now confirm that this is the commit that introduced the problem. What baffles me is that you say you have a working configuration using GRUB and i386. Could you send it to me or try mine for comparison?

Best regards,
Stefan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-11 17:29         ` Walter, Stefan
@ 2021-10-18 22:22           ` Peter Seiderer
  2021-10-19 15:17             ` Walter, Stefan
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Seiderer @ 2021-10-18 22:22 UTC (permalink / raw)
  To: Walter, Stefan; +Cc: buildroot

Hello Stefan,

On Mon, 11 Oct 2021 17:29:19 +0000, "Walter, Stefan" <stefan.walter@iml.fraunhofer.de> wrote:

> Hi,
>
> > > Maybe try to 'bisect' the problem as you mentioned it worked before
> > > 2021.02.1 (did you test 2021.02.0?), not much grub related patches in
> > > between...
> >
> > Buildroot 2021.02(.0) does boot, the following releases on the 2021.02.x
> > branch don't. I just tested 2021.08 with the same configuration file, and it
> > doesn't boot, either.
> >
> > I haven't actually bisected, yet, but looking at the commit log, ...
> >
> > >   e840f2d469 boot/grub2: Backport 2021/03/02 securify fixes
> >
> > ...this looks like the most likely culprit, because it's the only commit to
> > boot/grub2 I see that makes any changes to the GRUB sources between
> > 2021.02 and 2021.02.1.
>
> I can now confirm that this is the commit that introduced the problem. What baffles me is that you say you have a working configuration using GRUB and i386. Could you send it to me or try mine for comparison?

Can you try instead of your original

/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

the following one (makes the difference here for me with the qemu test):

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

Note the --directory change from the '.../host/lib/grub/i386-pc' (installed) directory to
'.../build/grub2-2.04/build-i386-pc/grub-core' build directory (as the original buildroot
grub2 install step uses to create images/grub.img...

Suspect the host/lib/grub/i386-pc provided modules are from the build/host-grub2-2.04 build
(instead of the build/grub2-2.04 for the target) and therefore without the '-Os' fix
(or they are mangled during the install step)...

Regards,
Peter

>
> Best regards,
> Stefan

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-18 22:22           ` Peter Seiderer
@ 2021-10-19 15:17             ` Walter, Stefan
  2021-10-19 21:02               ` Peter Seiderer
  0 siblings, 1 reply; 13+ messages in thread
From: Walter, Stefan @ 2021-10-19 15:17 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: buildroot

Hi Peter,

> Can you try instead of your original
> 
> /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
> 
> the following one (makes the difference here for me with the qemu test):
> 
> /path/to/buildroot-sdk/host/bin/grub-mkimage \
> 	--config=grub_early.cfg \
> 	--directory=/path/to/buildroot-sdk/build/grub2-2.04/build-i386-
> pc/grub-core \
> 	-o ./genimage_input_tmp/grub_core.img \
> 	--format=i386-pc \
> 	--prefix==/boot/grub \
> 	biosdisk part_msdos ext2 normal linux configfile
> 
> Note the --directory change from the '.../host/lib/grub/i386-pc' (installed)
> directory to '.../build/grub2-2.04/build-i386-pc/grub-core' build directory (as
> the original buildroot
> grub2 install step uses to create images/grub.img...

there is no directory build/grub2-2.04/build-i386-pc, but there is a build/grub2.204/grub-core, which I assume you meant. I tried with that directory, and indeed, the resulting image boots.

Thank you for your help so far! I'll reference this in the issue at https://bugs.busybox.net/show_bug.cgi?id=14281.

Best regards,
Stefan
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-19 15:17             ` Walter, Stefan
@ 2021-10-19 21:02               ` Peter Seiderer
  2021-10-21 17:59                 ` Yann E. MORIN
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Seiderer @ 2021-10-19 21:02 UTC (permalink / raw)
  To: Walter, Stefan; +Cc: buildroot

Hello Stefan,

On Tue, 19 Oct 2021 15:17:23 +0000, "Walter, Stefan" <stefan.walter@iml.fraunhofer.de> wrote:

> Hi Peter,
>
> > Can you try instead of your original
> >
> > /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
> >
> > the following one (makes the difference here for me with the qemu test):
> >
> > /path/to/buildroot-sdk/host/bin/grub-mkimage \
> > 	--config=grub_early.cfg \
> > 	--directory=/path/to/buildroot-sdk/build/grub2-2.04/build-i386-
> > pc/grub-core \
> > 	-o ./genimage_input_tmp/grub_core.img \
> > 	--format=i386-pc \
> > 	--prefix==/boot/grub \
> > 	biosdisk part_msdos ext2 normal linux configfile
> >
> > Note the --directory change from the '.../host/lib/grub/i386-pc' (installed)
> > directory to '.../build/grub2-2.04/build-i386-pc/grub-core' build directory (as
> > the original buildroot
> > grub2 install step uses to create images/grub.img...
>
> there is no directory build/grub2-2.04/build-i386-pc, but there is a build/grub2.204/grub-core, which I assume you meant.

Yes, your are right...

>  I tried with that directory, and indeed, the resulting image boots.

Thanks for testing (and for providing your command lines from your build)...

The host-grub2 modules build can be fixed by the following patch:

--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -125,7 +125,9 @@ GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
 # use the cross compile variant to ensure grub2 builds

 HOST_GRUB2_CONF_ENV = \
-       CPP="$(HOSTCC) -E"
+       CPP="$(HOSTCC) -E" \
+       CFLAGS="$(HOST_CFLAGS) -Os" \
+       CPPFLAGS="$(HOST_CPPFLAGS) -Os"

 GRUB2_CONF_ENV = \
        CPP="$(TARGET_CC) -E" \

Regards,
Peter

>
> Thank you for your help so far! I'll reference this in the issue at https://bugs.busybox.net/show_bug.cgi?id=14281.
>
> Best regards,
> Stefan

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-19 21:02               ` Peter Seiderer
@ 2021-10-21 17:59                 ` Yann E. MORIN
  2021-10-22  9:48                   ` Köry Maincent
  0 siblings, 1 reply; 13+ messages in thread
From: Yann E. MORIN @ 2021-10-21 17:59 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: Köry Maincent, Walter, Stefan, buildroot

Peter, Stefan, All,

+Köry who did some heavy works on grub2 recently...

On 2021-10-19 23:02 +0200, Peter Seiderer spake thusly:
> On Tue, 19 Oct 2021 15:17:23 +0000, "Walter, Stefan" <stefan.walter@iml.fraunhofer.de> wrote:
> The host-grub2 modules build can be fixed by the following patch:
> 
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -125,7 +125,9 @@ GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
>  # use the cross compile variant to ensure grub2 builds
> 
>  HOST_GRUB2_CONF_ENV = \
> -       CPP="$(HOSTCC) -E"
> +       CPP="$(HOSTCC) -E" \
> +       CFLAGS="$(HOST_CFLAGS) -Os" \
> +       CPPFLAGS="$(HOST_CPPFLAGS) -Os"

Sure, but why do we even need to build the modules in the host version
to begin with?

We should probably build the host version with --with-platform=none I
think.

Yes, we do currently use cdboot.img from the host, but that is probably
a mistake and a remnant for long ago... Instead, I think we should only
used modules from the target build.

Regards,
Yann E. MORIN.

>  GRUB2_CONF_ENV = \
>         CPP="$(TARGET_CC) -E" \
> 
> Regards,
> Peter
> 
> >
> > Thank you for your help so far! I'll reference this in the issue at https://bugs.busybox.net/show_bug.cgi?id=14281.
> >
> > Best regards,
> > Stefan
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-21 17:59                 ` Yann E. MORIN
@ 2021-10-22  9:48                   ` Köry Maincent
  2021-10-22 17:42                     ` Peter Seiderer
  0 siblings, 1 reply; 13+ messages in thread
From: Köry Maincent @ 2021-10-22  9:48 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Peter Seiderer, Walter, Stefan, buildroot

Yann, Peter, Stefan, all

On Thu, 21 Oct 2021 19:59:01 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> > <stefan.walter@iml.fraunhofer.de> wrote: The host-grub2 modules build can
> > be fixed by the following patch:
> > 
> > --- a/boot/grub2/grub2.mk
> > +++ b/boot/grub2/grub2.mk
> > @@ -125,7 +125,9 @@ GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
> >  # use the cross compile variant to ensure grub2 builds
> > 
> >  HOST_GRUB2_CONF_ENV = \
> > -       CPP="$(HOSTCC) -E"
> > +       CPP="$(HOSTCC) -E" \
> > +       CFLAGS="$(HOST_CFLAGS) -Os" \
> > +       CPPFLAGS="$(HOST_CPPFLAGS) -Os"  
> 
> Sure, but why do we even need to build the modules in the host version
> to begin with?

I agree. This patch seems not relevant. We build host-grub2 only for the
binaries. Stefan should use the target modules directory and not the one
from the host.

> We should probably build the host version with --with-platform=none I
> think.
> 
> Yes, we do currently use cdboot.img from the host, but that is probably
> a mistake and a remnant for long ago... Instead, I think we should only
> used modules from the target build.

I will add the none platform and the right cdboot.img path into my v2 grub patch
series.

Regards,
Köry
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1
  2021-10-22  9:48                   ` Köry Maincent
@ 2021-10-22 17:42                     ` Peter Seiderer
  0 siblings, 0 replies; 13+ messages in thread
From: Peter Seiderer @ 2021-10-22 17:42 UTC (permalink / raw)
  To: Köry Maincent; +Cc: Yann E. MORIN, Walter, Stefan, buildroot

Hello Köry, *,

On Fri, 22 Oct 2021 11:48:24 +0200, Köry Maincent <kory.maincent@bootlin.com> wrote:

> Yann, Peter, Stefan, all
> 
> On Thu, 21 Oct 2021 19:59:01 +0200
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> 
> > > <stefan.walter@iml.fraunhofer.de> wrote: The host-grub2 modules build can
> > > be fixed by the following patch:
> > > 
> > > --- a/boot/grub2/grub2.mk
> > > +++ b/boot/grub2/grub2.mk
> > > @@ -125,7 +125,9 @@ GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
> > >  # use the cross compile variant to ensure grub2 builds
> > > 
> > >  HOST_GRUB2_CONF_ENV = \
> > > -       CPP="$(HOSTCC) -E"
> > > +       CPP="$(HOSTCC) -E" \
> > > +       CFLAGS="$(HOST_CFLAGS) -Os" \
> > > +       CPPFLAGS="$(HOST_CPPFLAGS) -Os"    
> > 
> > Sure, but why do we even need to build the modules in the host version
> > to begin with?  
> 
> I agree. This patch seems not relevant. We build host-grub2 only for the
> binaries. Stefan should use the target modules directory and not the one
> from the host.

So Stefan use-case only worked by chance in the past (because host/target
shared the same arch x86)...

> 
> > We should probably build the host version with --with-platform=none I
> > think.
> > 
> > Yes, we do currently use cdboot.img from the host, but that is probably
> > a mistake and a remnant for long ago... Instead, I think we should only
> > used modules from the target build.  

One could argue that it would be a nice feature to have the host-tools and
the (cross-compiled) target-modules in one place...
> 
> I will add the none platform and the right cdboot.img path into my v2 grub patch
> series.

...but I am fine with this solution ;-)

Regards,
Peter

> 
> Regards,
> Köry

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-22 17:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 20:36 [Buildroot] Boot process stuck at "GRUB loading.." since 2021.02.1 Walter, Stefan
2021-10-07 21:50 ` Peter Seiderer
2021-10-08 14:27   ` Walter, Stefan
2021-10-08 17:25     ` Peter Seiderer
2021-10-11 12:23       ` Walter, Stefan
2021-10-11 17:29         ` Walter, Stefan
2021-10-18 22:22           ` Peter Seiderer
2021-10-19 15:17             ` Walter, Stefan
2021-10-19 21:02               ` Peter Seiderer
2021-10-21 17:59                 ` Yann E. MORIN
2021-10-22  9:48                   ` Köry Maincent
2021-10-22 17:42                     ` Peter Seiderer
2021-10-08 16:53 ` Alexander Dahl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.