Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4368

[leapp] IPU 7->8 on Z: grubby fails to list existing entries

    • None
    • Low
    • rhel-sst-desktop-firmware-bootloaders
    • ssg_display
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:
      grubby matches none of the "configFileInfo" type and falls back to the "default config" (hence grub) when /etc/grub2*.cfg files are missing, `/etc/zipl.conf` file is present and an unexpected `/etc/grub.d` directory is there.

      The bug resides in grubby, but it impacts almost only Leapp, which can possibly use something else on IBM Z systems. Feel free to change the component if needed.

      Version-Release number of selected component (if applicable):
      leapp-upgrade-el7toel8-0.17.0-1.el7_9.noarch

      How reproducible:
      Always

      Steps to Reproduce:
      On s390x, just create the problematic directory

      1. mkdir /etc/grub.d

      To reproduce it more easily from an x86_64 system

      1. mv /etc/grub2*.cfg /tmp/
      2. touch /etc/zipl.conf

      Actual results:
      ============================================================
      ERRORS
      ============================================================

      2023-01-03 11:28:56.408140 [ERROR] Actor: source_boot_loader_scanner
      Message: Failed to call `grubby` to list available boot entries.
      Summary:
      Details: Command ['grubby', '--info', 'ALL'] failed with exit code 1.
      Stderr: error opening /boot/grub/grub.cfg for read: No such file or directory

      ============================================================
      END OF ERRORS
      ============================================================

      Additional info:

      • in the customer environment the directory `/etc/grub.d` was empty, hence just removing it fixed the issue.
      • checking from gdb

      (gdb) b readConfig
      Breakpoint 1 at 0x4029b2: file grubby.c, line 1364.
      (gdb) b grubby.c:5187
      Breakpoint 2 at 0x404c46: file grubby.c, line 5187.

      (gdb) r
      Starting program: /usr/sbin/grubby --info ALL

      Breakpoint 2, main (argc=<optimized out>, argv=0x7fffffffe468) at grubby.c:5187
      5187 if (!grubConfig)

      (gdb) list
      5182 }
      5183
      5184 if (!grubConfig)

      { 5185 if (cfi->findConfig) 5186 grubConfig = cfi->findConfig(cfi); 5187 if (!grubConfig) 5188 grubConfig = cfi->defaultConfig; 5189 }

      5190
      5191 if (bootloaderProbe

      (gdb) n
      5186 grubConfig = cfi->findConfig(cfi);
      (gdb) n
      5187 if (!grubConfig)
      (gdb) n
      5191 if (bootloaderProbe

      (gdb) p grubConfig
      $1 = 0x40c307 "/boot/grub/grub.cfg"

              bootloader-eng-team bootloader -eng-team
              rhn-support-cbesson Christophe Besson
              bootloader -eng-team bootloader -eng-team
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: