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

grub2-mkconfig clobbers /boot/loader/entries

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • rhel-9.2.0
    • grub2
    • None
    • None
    • rhel-bootloader
    • ssg_display
    • 2
    • False
    • False
    • Hide

      None

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

      Description of problem:

      Running "grub2-mkconfig" will remove all options from the BLS entries in /boot/loader/entries and /etc/kernel/cmdline.

      Version-Release number of selected component (if applicable):
      grub2-tools-2.06-60.el9.x86_64

      How reproducible:
      Always

      Steps to Reproduce:

      1. cat /boot/loader/entries/* | grep ^options
        options root=UUID=b862bc8d-e44f-44be-95f8-93ccdcaa6b35 console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M $tuned_params
      1. cat /etc/kernel/cmdline
        root=UUID=b862bc8d-e44f-44be-95f8-93ccdcaa6b35 console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0<no newline at end>
      1. cat /proc/cmdline
        BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-268.el9.x86_64 root=UUID=b862bc8d-e44f-44be-95f8-93ccdcaa6b35 console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
      1. grub2-mkconfig -o /dev/null
        Generating grub configuration file ...
        Adding boot menu entry for UEFI Firmware Settings ...
        done
      1. cat /boot/loader/entries/* | grep ^options
        options root=UUID=b862bc8d-e44f-44be-95f8-93ccdcaa6b35 ro
      1. cat /etc/kernel/cmdline
        root=UUID=b862bc8d-e44f-44be-95f8-93ccdcaa6b35 ro

      Actual results:

      As above.

      Expected results:

      Running grub2-mkconfig should not change the BLS entries or /etc/kernel/cmdline.

      (My expectation is that grub2-mkconfig should never change any files itself, it should only gather information and output a config file that I then might or might not install for real. But maybe that is a wrong expectation.)

      Additional info:

      I think this has started to happen for two reasons:

      • GRUB_CMDLINE_LINUX in /etc/default/grub is empty in RHEL 9, probably since the beginning. In RHEL 8 and Fedora, it matches the BLS entries.
      • The 10_linux part of grub2-mkconfig used to only look at BLS entries that match the machine id and would miss the one that is actually present, which looks like this:
      1. ls /boot/loader/entries
        ffffffffffffffffffffffffffffffff-5.14.0-268.el9.x86_64.conf

      This is why grub2-mkconfig would not clobber BLS entries before RHEL 9.2, I think. It would probably clobber /etc/kernel/cmdline.

      Now 10_linux processes all files in /boot/loader/entries.

      Also note that /etc/kernel/cmdline does not contain the crashkernel option that is in the BLS entries.

              bootloader-eng-team bootloader -eng-team
              mvollmer1@redhat.com Marius Vollmer
              bootloader -eng-team bootloader -eng-team
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: