Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1848123

Summary: Support for --grub-users, --grub-arg, --grub-class, and --grub-id extensions supported by Red Hat Grub2 builds
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: boom-bootAssignee: LVM and device-mapper development team <lvm-team>
Status: CLOSED DUPLICATE QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: agk, bmr, jbrassow, mcsontos
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-15 15:06:49 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:

Description Corey Marthaler 2020-06-17 17:43:19 UTC
Description of problem:
These checks were added for the rhel7.9 verification of boom, but I see they are not supported still for the latest build in rhel8.3. Is this supposed to go into rhel8.3?


[root@hayes-03 ~]#  boom create --title 11 --grub-user root --root-lv /dev/snapper/boom_snap
WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
Profile with os_id='1d60e6e' does not support None
ERROR - Command failed: OsProfile os_id=1d60e6e does not allow 'grub_users'

[root@hayes-03 ~]#  boom create --title 12 --grub-arg 16 --root-lv /dev/snapper/boom_snap
WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
Profile with os_id='1d60e6e' does not support None
ERROR - Command failed: OsProfile os_id=1d60e6e does not allow 'grub_arg'

[root@hayes-03 ~]#  boom create --title 13 --grub-class kernel --root-lv /dev/snapper/boom_snap
WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
Profile with os_id='1d60e6e' does not support None
ERROR - Command failed: OsProfile os_id=1d60e6e does not allow 'grub_class'


Version-Release number of selected component (if applicable):
boom-boot-1.2-1.el8    BUILT: Sun Jun  7 07:20:03 CDT 2020

kernel-4.18.0-208.el8    BUILT: Thu May 28 09:44:03 CDT 2020
lvm2-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
lvm2-libs-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
lvm2-dbusd-2.03.09-2.el8    BUILT: Fri May 29 11:32:49 CDT 2020
lvm2-lockd-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
boom-boot-1.2-1.el8    BUILT: Sun Jun  7 07:20:03 CDT 2020
device-mapper-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-libs-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-event-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-event-libs-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020

Comment 1 Bryn M. Reeves 2020-06-18 11:50:27 UTC
For some reason the RHEL8 RPMs are not shipping any pre-defined profiles. I already filed bug 1842626 a couple of weeks ago to consolidate the two examples that were supposed to be shipped into a single profile for all RHEL8 versions so this should be addressed when that bug gets fixed.

> Profile with os_id='1d60e6e' does not support None

A profile needs to enable the list of optional keys that it supports (since they require support from the OS's Grub build). I don't know where this OsProfile ID comes from - it's not any of the ones that we've shipped (either in RHEL or upstream). "boom profile show 1d60e6e" will show how it was configured.

The original RHEL8 update package (boom-1.2-1.el8) was supposed to contain two RHEL8 OsProfiles (8.1 and 8.2):

Actual results:
OsID    Name                     OsVersion  
f44fb52 Red Hat Enterprise Linux 8.1 (Ootpa)
1ba0043 Red Hat Enterprise Linux 8.2 (Ootpa)

After bug 1842626 is MODIFIED there should be a single one:

OsID    Name                     OsVersion 
4abe4f7 Red Hat Enterprise Linux 8 (Ootpa)

The use of optional keys like grub_arg, grub_users, grub_class is enabled on a per-profile basis: you should see an "Optional keys" field in the "boom profile show" output that lists the key names that that OS permits:

# boom profile show
OS Profile (os_id=4abe4f7)
  OS ID: "4abe4f7fd38fc7506cbe2f42b1b85d54af3b29b1",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8 (Ootpa)", Version ID: "8",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts} rhgb quiet",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_class grub_arg", UTS release pattern: "el8"
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you're creating an OsProfile by hand (or using --from-host) then you need to specify these key names on the command line when creating the profile:

# boom profile create --from-host --optional-keys "grub_users grub_class grub_arg"
Created profile with os_id f44fb52:
  OS ID: "f44fb528ff8360ad67e2fe0274750b838da0bd6a",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8.1 (Ootpa)", Version ID: "8.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_class grub_arg", UTS release pattern: "el8"

If you have an existing OsProfile that lacks the optional keys setting you can enable them with:

# boom profile create --from-host
Created profile with os_id f44fb52:
  OS ID: "f44fb528ff8360ad67e2fe0274750b838da0bd6a",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8.1 (Ootpa)", Version ID: "8.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "", UTS release pattern: "el8"

# boom profile edit f44fb52 --optional-keys "grub_users grub_class grub_arg"
Edited profile:
  OS ID: "f44fb528ff8360ad67e2fe0274750b838da0bd6a",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8.1 (Ootpa)", Version ID: "8.1",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts}",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_class grub_arg", UTS release pattern: "el8"

The keys will then be automatically added to any new BootEntry created with this profile:

# boom create --title "optional keys test" --rootlv rhel/root
Created entry with boot_id f99d5e0:
  title optional keys test
  machine-id b49e623f993c4fd7b200c5e350f9cacc
  version 4.18.0-167.el8.x86_64
  linux /vmlinuz-4.18.0-167.el8.x86_64
  initrd /initramfs-4.18.0-167.el8.x86_64.img
  options root=/dev/rhel/root ro rd.lvm.lv=rhel/root rhgb quiet
  grub_users $grub_users
  grub_arg kernel
  grub_class --unrestricted

For the very rare case that the defaults are not correct values can be specified on the command line:

# boom create --title "optional keys test2" --rootlv rhel/root --grub-users foo --grub-arg bar --grub-class baz
Created entry with boot_id 73cc7fe:
  title optional keys test2
  machine-id b49e623f993c4fd7b200c5e350f9cacc
  version 4.18.0-167.el8.x86_64
  linux /vmlinuz-4.18.0-167.el8.x86_64
  initrd /initramfs-4.18.0-167.el8.x86_64.img
  options root=/dev/rhel/root ro rd.lvm.lv=rhel/root rhgb quiet
  grub_users foo
  grub_arg bar
  grub_class baz

But this is only permitted if the corresponding OsProfile allows the optional keys specified.

There's a minor/cosmetic bug in the output you post above:

  #  boom create --title 11 --grub-user root --root-lv /dev/snapper/boom_snap
  WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
  Profile with os_id='1d60e6e' does not support None                           <<<----------
  ERROR - Command failed: OsProfile os_id=1d60e6e does not allow 'grub_users'

The first error message is broken - "None" should be the command line argument that was invalid (--grub-users): we should fix this so there is only a single, correct error message in this case. It's also possible for us to enhance this in future to automatically enable those optional keys for all Red Hat distros (since we know they are supported - we already have a heuristic for setting the uname pattern in this case).

Comment 2 Bryn M. Reeves 2020-07-15 14:56:57 UTC
I think this should be fixed in the current build - updating my test environment to verify now.

Comment 3 Bryn M. Reeves 2020-07-15 15:06:49 UTC
Verified that the optional keys are enabled by default in the built-in RHEL8 profile in boom-boot-1.2-2.el8:

# rpm -q boom-boot
boom-boot-1.2-2.el8.noarch

# boom profile list
OsID    Name                            OsVersion               
8896596 Fedora                          30 (Workstation Edition)
4abe4f7 Red Hat Enterprise Linux        8 (Ootpa)               
72e3679 Red Hat Enterprise Linux Server 7.7 (Maipo)             
4aff687 Red Hat Enterprise Linux Server 7.8 (Maipo)             

# boom profile show 4abe
OS Profile (os_id=4abe4f7)
  OS ID: "4abe4f7fd38fc7506cbe2f42b1b85d54af3b29b1",
  Name: "Red Hat Enterprise Linux", Short name: "rhel",
  Version: "8 (Ootpa)", Version ID: "8",
  Kernel pattern: "/vmlinuz-%{version}", Initramfs pattern: "/initramfs-%{version}.img",
  Root options (LVM2): "rd.lvm.lv=%{lvm_root_lv}",
  Root options (BTRFS): "rootflags=%{btrfs_subvolume}",
  Options: "root=%{root_device} ro %{root_opts} rhgb quiet",
  Title: "%{os_name} %{os_version_id} (%{version})",
  Optional keys: "grub_users grub_class grub_arg", UTS release pattern: "el8"

# boom create --title "Optional Keys Test" --rootlv rhel/root
Created entry with boot_id 01a7b91:
  title Optional Keys Test
  machine-id b49e623f993c4fd7b200c5e350f9cacc
  version 4.18.0-167.el8.x86_64
  linux /vmlinuz-4.18.0-167.el8.x86_64
  initrd /initramfs-4.18.0-167.el8.x86_64.img
  options root=/dev/rhel/root ro rd.lvm.lv=rhel/root rhgb quiet
  grub_users $grub_users
  grub_arg --unrestricted
  grub_class kernel

Marking this as a duplicate of bug 1842626 which caused the behaviour shown in comment #0.

*** This bug has been marked as a duplicate of bug 1842626 ***