RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2060948 - grub on OpenFirmware : search --hint-ieee1275= does not work
Summary: grub on OpenFirmware : search --hint-ieee1275= does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2022-04-04
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: grub2
Version: 9.0
Hardware: ppc64le
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL:
Whiteboard:
: 2062744 (view as bug list)
Depends On:
Blocks: 2048904 2062639
TreeView+ depends on / blocked
 
Reported: 2022-03-04 16:20 UTC by Pavel Cahyna
Modified: 2022-05-17 16:14 UTC (History)
8 users (show)

Fixed In Version: grub2-2.06-27.el9_0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2062639 (view as bug list)
Environment:
Last Closed: 2022-05-17 15:51:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-114550 0 None None None 2022-03-04 16:39:42 UTC
Red Hat Issue Tracker RTT-4310 0 None None None 2022-03-10 12:43:47 UTC
Red Hat Issue Tracker RTT-4311 0 None None None 2022-03-10 12:43:52 UTC
Red Hat Issue Tracker RTT-4312 0 None None None 2022-03-10 12:43:56 UTC
Red Hat Product Errata RHBA-2022:3925 0 None None None 2022-05-17 15:51:08 UTC

Description Pavel Cahyna 2022-03-04 16:20:18 UTC
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-04 18:06:23 UTC
This worked with grub2-ppc64le-2.04-31.el9.2.ppc64le in RHEL 9 Alpha:

grub> set boot='hd0,msdos2'
grub> echo $boot                                                               
hd0,msdos2                                                                     
grub> search --no-floppy --fs-uuid --set=boot --hint-ieee1275='ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2' --hint='hd0,msdos2'  5aaa7ea0-ae19-4e13-a585-3390a14fd5ed
grub> echo $boot
ieee1275//vdevice/v-scsi@30000003/disk@8100000000000000,msdos2

Comment 2 Pavel Cahyna 2022-03-04 19:34:46 UTC
even with grub2-ppc64le-2.06-6.el9 in beta it works.

Comment 3 Pavel Cahyna 2022-03-04 20:04:51 UTC
It works in grub2-ppc64le-2.06-23.el9 and broke in grub2-ppc64le-2.06-24.el9 by @rharwood .

Comment 5 Robbie Harwood 2022-03-04 20:21:29 UTC
(Clearing needinfo since there's no specific question - presumably it was set accidentally with the @.)

Comment 6 Renaud Métrich 2022-03-07 06:08:37 UTC
(In reply to Pavel Cahyna from comment #3)
> It works in grub2-ppc64le-2.06-23.el9 and broke in grub2-ppc64le-2.06-24.el9
> by @rharwood .

OK I'm culprit here.
It appears my patch 0226-search-new-efidisk-only-option-on-EFI-systems.patch introduces must have introduced the bug, it refactored the "--no-floppy" argument handling, which was necessary to introduce the "--efidisk-only" argument.
The patch makes use of a new "flags" stack variable, which has initially uninitialized value:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
@@ -89,6 +91,7 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
   const char *id = 0;
   int i = 0, j = 0, nhints = 0;
   char **hints = NULL;
+  enum search_flags flags;   <<<<<< HERE, should be "flags = 0;"
 
   if (state[SEARCH_HINT].set)
     for (i = 0; state[SEARCH_HINT].args[i]; i++)
@@ -180,15 +183,18 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
       goto out;
     }
[...]
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Depending on memory content, this was making the code search for "--efidisk-only" implicitly.

Comment 10 Renaud Métrich 2022-03-07 10:09:21 UTC
Patch (commit db0deb7994a7be26700869dbb81786f7967244f7):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Author: Renaud Métrich <rmetrich>
Date:   Mon Mar 7 07:46:56 2022 +0100

    Fix for RHBZ2060948

diff --git a/0226-search-new-efidisk-only-option-on-EFI-systems.patch b/0226-search-new-efidisk-only-option-on-EFI-systems.patch
index ca484e63..74f483b0 100644
--- a/0226-search-new-efidisk-only-option-on-EFI-systems.patch
+++ b/0226-search-new-efidisk-only-option-on-EFI-systems.patch
@@ -108,7 +108,7 @@ index 47fc8eb9966..464e6ebb1c8 100644
    const char *id = 0;
    int i = 0, j = 0, nhints = 0;
    char **hints = NULL;
-+  enum search_flags flags;
++  enum search_flags flags = 0;
  
    if (state[SEARCH_HINT].set)
      for (i = 0; state[SEARCH_HINT].args[i]; i++)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 11 Pavel Cahyna 2022-03-07 10:12:11 UTC
Would covscan be able to detect uninitialized variable? This is something that even the compiler might warn about.

Comment 28 Robbie Harwood 2022-03-17 17:23:12 UTC
*** Bug 2062744 has been marked as a duplicate of this bug. ***

Comment 29 IBM Bug Proxy 2022-03-17 17:27:01 UTC
------- Comment From diegodo.com 2022-03-11 10:44 EDT-------
There are 3 new patches from the previous NIGHTLY and the new ONE.

0225-search-fixed-bug-stopping-iteration-when-no-floppy-i.patch
0226-search-new-efidisk-only-option-on-EFI-systems.patch
0227-efi-new-connectefi-command.patch

Two of then are changing the behavior of the search.c

I'll try to investigate what they changed so we can try to fix it...

------- Comment From diegodo.com 2022-03-11 10:44 EDT-------
*** Bug 196649 has been marked as a duplicate of this bug. ***

------- Comment From chetjain.com 2022-03-15 03:01 EDT-------
Any further update?
This needs an exception approval to include the fixes for GA, else it breaks boot operation on all NPIV lpars.
Meanwhile, is there a workaround to overcome this?

------- Comment From ssant.com 2022-03-15 08:14 EDT-------
*** Bug 196670 has been marked as a duplicate of this bug. ***

------- Comment From Steven.Unruh 2022-03-15 09:54 EDT-------
before grub choice:  <----------------------------------------- how do i do that

7f1f9f69-7958-4997-9144-b83307cdf88a.
7f1f9f69-7958-4997-9144-b83307cdf88a.
error: ../../grub-core/net/net.c:1552:disk `hd0,msdos2' not found.
Minimal BASH-like line editing is supported. For the first word,
TAB lists possible command completions. Anywhere else TAB lists
possible device or file completions.
grub>                <----------------------------------------- where do i edit?

------- Comment From Steven.Unruh 2022-03-15 09:58 EDT-------
the lpar installs fine.

this failure is on the 1st boot after install

------- Comment From ssant.com 2022-03-15 23:24 EDT-------
(In reply to comment #14)
> before grub choice:  <----------------------------------------- how do i do
> that
>
Steven, the steps mentioned by Petr are to be followed during installation.

Please attempt a fresh install. When at grub(during install) follow the steps provided by Petr and post the results.

------- Comment From rajanikanth.ha.com 2022-03-16 01:50 EDT-------
Hi,

We are able to proceed with this workaround, using grub2-2.06-27.el9_0 build  and following the steps in mentioned in the  #comment13 LPAR is installed  and able to boot LPAR after it.

Thanks!

------- Comment From ssant.com 2022-03-17 09:14 EDT-------
(In reply to comment #13)
> Hello IBM, it looks very similar to bug 2060948
>
> can you try grub2-2.06-27.el9_0 build, please?

Thanks Petr.This package resolves the problem. Machine successfully boots post installation.

Has this package already received all the necessary ack's for inclusion into Nightly build or should this go through exception process ?

Comment 31 Petr Janda 2022-03-18 14:33:41 UTC
(In reply to IBM Bug Proxy from comment #29)
> ------- Comment From diegodo.com 2022-03-11 10:44 EDT-------
> There are 3 new patches from the previous NIGHTLY and the new ONE.
> 
> 0225-search-fixed-bug-stopping-iteration-when-no-floppy-i.patch
> 0226-search-new-efidisk-only-option-on-EFI-systems.patch
> 0227-efi-new-connectefi-command.patch
> 
> Two of then are changing the behavior of the search.c
> 
> I'll try to investigate what they changed so we can try to fix it...
> 
> ------- Comment From diegodo.com 2022-03-11 10:44 EDT-------
> *** Bug 196649 has been marked as a duplicate of this bug. ***
> 
> ------- Comment From chetjain.com 2022-03-15 03:01 EDT-------
> Any further update?
> This needs an exception approval to include the fixes for GA, else it breaks
> boot operation on all NPIV lpars.
> Meanwhile, is there a workaround to overcome this?
> 
> ------- Comment From ssant.com 2022-03-15 08:14 EDT-------
> *** Bug 196670 has been marked as a duplicate of this bug. ***
> 
> ------- Comment From Steven.Unruh 2022-03-15 09:54 EDT-------
> before grub choice:  <----------------------------------------- how do i do
> that
> 
> 7f1f9f69-7958-4997-9144-b83307cdf88a.
> 7f1f9f69-7958-4997-9144-b83307cdf88a.
> error: ../../grub-core/net/net.c:1552:disk `hd0,msdos2' not found.
> Minimal BASH-like line editing is supported. For the first word,
> TAB lists possible command completions. Anywhere else TAB lists
> possible device or file completions.
> grub>                <----------------------------------------- where do i
> edit?
> 
> ------- Comment From Steven.Unruh 2022-03-15 09:58 EDT-------
> the lpar installs fine.
> 
> this failure is on the 1st boot after install
> 
> ------- Comment From ssant.com 2022-03-15 23:24 EDT-------
> (In reply to comment #14)
> > before grub choice:  <----------------------------------------- how do i do
> > that
> >
> Steven, the steps mentioned by Petr are to be followed during installation.
> 
> Please attempt a fresh install. When at grub(during install) follow the
> steps provided by Petr and post the results.
> 
> ------- Comment From rajanikanth.ha.com 2022-03-16 01:50 EDT-------
> Hi,
> 
> We are able to proceed with this workaround, using grub2-2.06-27.el9_0 build
> and following the steps in mentioned in the  #comment13 LPAR is installed 
> and able to boot LPAR after it.
> 
> Thanks!
> 
> ------- Comment From ssant.com 2022-03-17 09:14 EDT-------
> (In reply to comment #13)
> > Hello IBM, it looks very similar to bug 2060948
> >
> > can you try grub2-2.06-27.el9_0 build, please?
> 
> Thanks Petr.This package resolves the problem. Machine successfully boots
> post installation.
> 
> Has this package already received all the necessary ack's for inclusion into
> Nightly build or should this go through exception process ?

All acks provided, grub2-2.06-27.el9_0 is included in RHEL-9.0.0-20220318.0 nightly compose.

Comment 33 errata-xmlrpc 2022-05-17 15:51:03 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 (new packages: grub2), 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/RHBA-2022:3925


Note You need to log in before you can comment on or make changes to this bug.