Bug 1973289

Summary: For UEFI systems, grub2-mkconfig not updating kernel args from GRUB_CMDLINE_LINUX in /etc/default/grub
Product: Red Hat Enterprise Linux 8 Reporter: Matt Flusche <mflusche>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 8.2CC: broose, dabrown, dsedgmen, fmartine, ggrimaux, kbeavers, mircea.vutcovici, rharwood, rmetrich, sbaker, sbarcomb, uemit.seren
Target Milestone: beta   
Target Release: ---   
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: 2021-09-20 21:40:54 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 Matt Flusche 2021-06-17 15:01:11 UTC
Description of problem:

On UEFI systems, the kernel command line arguments (GRUB_CMDLINE_LINUX) from /etc/default/grub are not being updated when running:

grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

It seems, /boot/efi/EFI/redhat/grubenv, is not being updated properly.

The work-around is to copy /boot/grub2/grubenv -> /boot/efi/EFI/redhat/grubenv

This works fine on BIOS booted system.

Version-Release number of selected component (if applicable):
RHEL 8.2

# rpm -qf /usr/sbin/grub2-mkconfig
grub2-tools-2.02-87.el8_2.3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. update GRUB_CMDLINE_LINUX in /etc/default/grub
2. run: grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
3. reboot and verify new parameters from GRUB_CMDLINE_LINUX are not configured or check /boot/efi/EFI/redhat/grubenv

Actual results:

GRUB_CMDLINE_LINUX from /etc/default/grub not updating kernel args on UEFI systems.

Expected results:
GRUB_CMDLINE_LINUX from /etc/default/grub updating kernel args on UEFI systems.

Additional info:

Comment 1 Matt Flusche 2021-06-17 15:08:00 UTC
Example of working around this issue on a UEFI system:

# cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt3)/boot/vmlinuz-4.18.0-193.51.1.el8_2.x86_64 root=UUID=670cf845-41e8-475a-af33-ec2750510daf ro console=ttyS0 console=ttyS0,115200n81 no_timer_check crashkernel=auto rhgb quiet skew_tick=1 nohz=on nohz_full=8-19,28-39,48-59,68-79 rcu_nocbs=8-19,28-39,48-59,68-79 tuned.non_isolcpus=0000000f,f000ff00,0ff000ff intel_pstate=disable nosoftlockup

# cat /boot/efi/EFI/redhat/grubenv 
# GRUB Environment Block
kernelopts=root=UUID=670cf845-41e8-475a-af33-ec2750510daf ro console=ttyS0 console=ttyS0,115200n81 no_timer_check  crashkernel=auto rhgb quiet 
boot_success=0
########################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

# cat /etc/default/grub 
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="console=ttyS0 console=ttyS0,115200n81 no_timer_check  crashkernel=auto rhgb quiet"
TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS=" intel_iommu=on iommu=pt isolcpus=8-19,28-39,48-59,68-79 "
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX:+$GRUB_CMDLINE_LINUX }${TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS}"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

# cat /boot/grub2/grubenv 
# GRUB Environment Block
kernelopts=root=UUID=670cf845-41e8-475a-af33-ec2750510daf ro console=ttyS0 console=ttyS0,115200n81 no_timer_check  crashkernel=auto rhgb quiet  intel_iommu=on iommu=pt isolcpus=8-19,28-39,48-59,68-79  
boot_success=1
tuned_params=skew_tick=1 nohz=on nohz_full=8-19,28-39,48-59,68-79 rcu_nocbs=8-19,28-39,48-59,68-79 tuned.non_isolcpus=0000000f,f000ff00,0ff000ff intel_pstate=disable nosoftlockup
tuned_initrd=(hd0,gpt3)/boot/tuned-initrd.img
#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for EFI firmware configuration
done

# cp -p /boot/grub2/grubenv /boot/efi/EFI/redhat/
cp: overwrite '/boot/efi/EFI/redhat/grubenv'? y

--reboot--

# cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt3)/boot/vmlinuz-4.18.0-193.51.1.el8_2.x86_64 root=UUID=670cf845-41e8-475a-af33-ec2750510daf ro console=ttyS0 console=ttyS0,115200n81 no_timer_check crashkernel=auto rhgb quiet intel_iommu=on iommu=pt isolcpus=8-19,28-39,48-59,68-79 skew_tick=1 nohz=on nohz_full=8-19,28-39,48-59,68-79 rcu_nocbs=8-19,28-39,48-59,68-79 tuned.non_isolcpus=0000000f,f000ff00,0ff000ff intel_pstate=disable nosoftlockup

Comment 23 Steve Barcomb 2021-09-20 21:40:54 UTC
Closing this bug with insufficient data.  If there is renewed interest in this bug please open a support case requesting this bug be reopened.