Hardknott: grub immediately reboots


Tony Battersby
 

After upgrading from Dunfell (YP 3.1) to Hardknott (YP 3.3), our
firmware was unable to boot.  Our target hardware is x86-64 booting in
legacy BIOS mode using grub on a variety of motherboards and CPUs.  The
grub menu would never show up; instead it would reboot immediately,
leading to an endless reboot loop.

I have two different workarounds.  Create a bbappend file for grub, and
do one of the following two things:

1) Add the following line:

CFLAGS_remove = "-O2"

2) Or make a patch to revert the following commit, and add it to SRC_URI:

https://git.savannah.gnu.org/cgit/grub.git/commit/?id=4ea7bae51f97e49c84dc67ea30b466ca8633b9f6


NOTE: this commit fixes a CVE, so do not revert it without due
consideration.


Here is my upstream bug report:

https://savannah.gnu.org/bugs/index.php?60458


Is anyone else experiencing this problem?  I am wondering how it got
past Yocto QA.

Tony Battersby
Cybernetics


Anuj Mittal
 

-----Original Message-----
From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On Behalf Of
Tony Battersby
Sent: Tuesday, April 27, 2021 03:07 AM
To: yocto@lists.yoctoproject.org
Subject: [yocto] Hardknott: grub immediately reboots

After upgrading from Dunfell (YP 3.1) to Hardknott (YP 3.3), our firmware was
unable to boot.  Our target hardware is x86-64 booting in legacy BIOS mode using
grub on a variety of motherboards and CPUs.  The grub menu would never show up;
instead it would reboot immediately, leading to an endless reboot loop.

I have two different workarounds.  Create a bbappend file for grub, and do one of the
following two things:

1) Add the following line:

CFLAGS_remove = "-O2"
I think we should probably remove this. That's what Fedora also seems to be doing so Os is used.

https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/grub.macros#_19

and what grub configure expects:

https://git.savannah.gnu.org/cgit/grub.git/tree/configure.ac#n41

Thanks,

Anuj


Tony Battersby
 

On 4/28/21 11:25 PM, Mittal, Anuj wrote:

-----Original Message-----
From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On Behalf Of
Tony Battersby
Sent: Tuesday, April 27, 2021 03:07 AM
To: yocto@lists.yoctoproject.org
Subject: [yocto] Hardknott: grub immediately reboots

After upgrading from Dunfell (YP 3.1) to Hardknott (YP 3.3), our firmware was
unable to boot.  Our target hardware is x86-64 booting in legacy BIOS mode using
grub on a variety of motherboards and CPUs.  The grub menu would never show up;
instead it would reboot immediately, leading to an endless reboot loop.

I have two different workarounds.  Create a bbappend file for grub, and do one of the
following two things:

1) Add the following line:

CFLAGS_remove = "-O2"
I think we should probably remove this. That's what Fedora also seems to be doing so Os is used.

https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/grub.macros#_19

and what grub configure expects:

https://git.savannah.gnu.org/cgit/grub.git/tree/configure.ac#n41

Thanks,

Anuj
I have opened a Yocto bug here:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14367

Tony