Bug 2061252

Summary: grub on OpenFirmware : search --hint-ieee1275= does not work
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 8.6CC: bootloader-eng-team, bugproxy, lmiksik, pcahyna, pjanda, rharwood
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: grub2-2.02-123.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2062380 (view as bug list) Environment:
Last Closed: 2022-05-10 15:31:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2048904, 2062380    
Attachments:
Description Flags
PVmigrate_steps_console_logs none

Description Renaud Métrich 2022-03-07 06:50:36 UTC
This bug was initially created as a copy of Bug #2060948

I am copying this bug because: 

Should also be reproducible since same broken patch is applied

Description of problem:

The command 
search --no-floppy --fs-uuid --set=boot --hint-ieee1275='ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2' --hint='hd0,msdos2'  4669d7ad-3808-406a-85a6-52218d5f52ba

where 4669d7ad-3808-406a-85a6-52218d5f52ba is the UUID of the /boot XFS filesystem does not work:
error: ../../grub-core/commands/search.c:315:no such device:
4669d7ad-3808-406a-85a6-52218d5f52ba.

unfortunately, in a multipath configuration, grub2-mkconfig adds this command to the config file before menuentries, so Grub aborts - the system is unbootable.

Version-Release number of selected component (if applicable):
2.06-25.el9

How reproducible:

Well reproducible

Steps to Reproduce:
1. Get a ppc64le machine in Beaker
2. find out the UUID of /boot
3. reboot to Grub
4. in the console enter
search --no-floppy --fs-uuid --set=boot --hint-ieee1275='ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2' --hint='hd0,msdos2'  <uuid>

where <uuid> is the UUID of /boot and ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2 is the correct OpenFirmware device path of /boot (adjust if necessary).

Actual results:
error: ../../grub-core/commands/search.c:315:no such device:
<uuid>.

Expected results:
The command succeeds - this used to be the case in RHEL 8. It sets the boot variable to ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2 if that's the correct device path.

Additional info:

I have investigated why the error does not occur without multipath configuration. It turns out that without multipath, grub2-mkconfig generates this command instead

search --no-floppy --fs-uuid --set=boot --hint-ieee1275='ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2' --hint='hd0,msdos2'   --hint-bios=hd0,msdos2  --hint-efi=hd0,msdos2 4669d7ad-3808-406a-85a6-52218d5f52

and this command works correctly.

I don't see why these additional parameters help - AFAIK the OpenFirmware machines don't even have EFI or BIOS and hd0,msdos2 is wrong anyway. It helps, though. All of those additional parameters must be present, omitting any of them leads to a failure again.

Interestingly, mere
search --no-floppy --fs-uuid --set=boot 4669d7ad-3808-406a-85a6-52218d5f52ba
works as well.

I have full debug outputs if it helps.

Comment 1 Pavel Cahyna 2022-03-07 09:52:32 UTC
I don't recall being able to reproduce it on RHEL 8. Which is the wrong build and what was the last good one before the regression?

It might be because the error depends on the stack layout. Maybe the bug will hit in some other situation, when one expects it the least.

Comment 2 Renaud Métrich 2022-03-07 10:01:26 UTC
This is linked to BZ #2048904 so should be reproducible with grub2-2.02-117.el8

Comment 3 Pavel Cahyna 2022-03-07 10:38:07 UTC
I am able to reproduce it on HRLE 8.6 and 8.7, with grub2-ppc64le-2.02-120.el8.ppc64le . We probably used a compose which had a too old build for our previous tests.

Comment 6 Renaud Métrich 2022-03-07 11:19:51 UTC
I can reproduce at will on a x86_64 system (QEMU).
Procedure below:

1. Collect UUID of "/boot" partition from running system

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# grep search /boot/grub2/grub.cfg 
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  17c2c80a-afad-4b64-a31b-55b21ced3740
  search --no-floppy --fs-uuid --set=root 17c2c80a-afad-4b64-a31b-55b21ced3740
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=boot --hint='hd0,msdos1'  17c2c80a-afad-4b64-a31b-55b21ced3740
  search --no-floppy --fs-uuid --set=boot 17c2c80a-afad-4b64-a31b-55b21ced3740
  search --no-floppy --fs-uuid --set=boot 17c2c80a-afad-4b64-a31b-55b21ced3740
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

2. Reboot, stop at Grub menu and enter prompt

3. Search for "/boot" without any hint

With grub2-pc-modules-2.02-120.el8.noarch:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> search --fs-uuid --set=boot 17c2c80a-afad-4b64-a31b-55b21ced3740
error: ../../grub-core/commands/search.c:315:no such device:
17c2c80a-afad-4b64-a31b-55b21ced3740.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


With grub2-pc-modules-2.02-120.el8.bz2060948.noarch (works):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> search --no-floppy --fs-uuid --set=boot 17c2c80a-afad-4b64-a31b-55b21ced3740
grub> echo $boot
hd0,msdos1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 8 Pavel Cahyna 2022-03-07 16:41:56 UTC
When testing manually, always pass --no-nvram to grub2-install, see bz2060948

Comment 11 Renaud Métrich 2022-03-10 07:38:23 UTC
I can confirm grub2-2.02-122.el8 works fine, tested on a Legacy system:


grub2-2.02-121:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> search --no-floppy --fs-uuid --set=root 17c2c80a-afad-4b64-a31b-55b21ced3740
error: ../../grub-core/commands/search.c:315:no such device:
17c2c80a-afad-4b64-a31b-55b21ced3740.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

grub2-2.02-122:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
grub> search --no-floppy --fs-uuid --set=root 17c2c80a-afad-4b64-a31b-55b21ced3740
grub> echo $root
hd0,msdos1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 12 Petr Janda 2022-03-10 12:20:07 UTC
switching to modified as grub2-2.02-122.el8 passed gating

Comment 17 Petr Janda 2022-03-10 15:17:35 UTC
Reproduced again on ppc64le RHEL-8.6.0-20220305.2 with grub2-2.02-120.el8
tested on the same system, same compose, but with grub2-2.02-122.el8 and it works as expected.

Taking Renaud's result into account I believe I can set Verified:tested now.

Comment 20 Robbie Harwood 2022-03-17 18:20:31 UTC
*** Bug 2065343 has been marked as a duplicate of this bug. ***

Comment 23 IBM Bug Proxy 2022-03-23 20:00:36 UTC
------- Comment From kribalac.com 2022-03-18 06:51 EDT-------
Tried grub2 from this path :
http://people.redhat.com/~pjanda/grub2-2.02-122.el8/ for Rhel8

The install was success and lpar booted up fine.

these are the steps I followed, [I have copied the fix packages to kter:/images/extras/197247]
Trying manual way of installation, update the file name in dhcp server in kter -
reboot the LPAR, after packet count select any of the method to install using arrow keys for ex HTTP
press 'e' to edit boot loader
add this line in grub -     which contains the fix rpms location
inst.addrepo=grubrepo,http://10.33.8.154/images/extras/196631
after this press ctrl-x to boot with this and proceed with HTTP + VNC install.
Install completes and LPAR reboots to login prompt successfully.

Comment 25 IBM Bug Proxy 2022-04-01 04:50:39 UTC
Created attachment 1869835 [details]
PVmigrate_steps_console_logs

Comment 27 Petr Janda 2022-04-07 07:00:15 UTC
grub2 2.02-123 version is in compose

Comment 29 errata-xmlrpc 2022-05-10 15:31:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: grub2 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:2110