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 1246094 - rescue kernel should not generate when GRUB_DISABLE_RECOVERY="true"
Summary: rescue kernel should not generate when GRUB_DISABLE_RECOVERY="true"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grubby
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Jones
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 1223864 1233004
TreeView+ depends on / blocked
 
Reported: 2015-07-23 12:49 UTC by Tereza Cerna
Modified: 2015-09-29 10:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-17 14:19:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tereza Cerna 2015-07-23 12:49:03 UTC
Rescue kernel should not generate when GRUB_DISABLE_RECOVERY="true" in /etc/default/grub. If the variable GRUB_DISABLE_RECOVERY is deleted, it works well.

Packages:
grub2-2.02-0.22.el7.x86_64
tuned-2.5.0-1.el7.noarch

Comment 4 Tereza Cerna 2015-09-11 11:50:24 UTC
My problem is connected with testing of tuned. If GRUB_DISABLE_RECOVERY is set to "true", rescue kernel generates $tuned_params and it is bug.
 
See the problem:

# cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="console=tty0 vconsole.keymap=us console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT:+$GRUB_CMDLINE_LINUX_DEFAULT }\$tuned_params"

# grub2-mkconfig -o /boot/grub2/grub

# cat /boot/grub2/grub.cfg | grep vmlinuz
	linux16 /vmlinuz-3.10.0-306.0.1.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
	linux16 /vmlinuz-3.10.0-302.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
	linux16 /vmlinuz-3.10.0-295.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
	linux16 /vmlinuz-0-rescue-d20fb34accd74a158e40457bf1d641bf root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params   

Problem is in last row with rescue kernel which contains string "$tuned_params".

Comment 5 David Cantrell 2015-09-14 18:35:50 UTC
This does not meet the criteria for a RHEL 7.2 blocker.  Moving this one to the 7.3 planning list.

At first glance, it appears there is confusion between grub's "recovery" entries, our own debug kernel boot entries, and the "rescue" boot loader entry created by dracut.  In order to figure out what the problem is, we need to see some more information from the problem system:

1) Sample grub.cfg files both before and after the files are updated.
2) What you expect to see in grub.cfg and what is there.
3) The contents of /etc/default/grub
4) The contents of /etc/sysconfig/kernel

Remember that the "recovery" boot menu entries are controlled by the GRUB_DISABLE_RECOVERY.  The GRUB_CMDLINE_LINUX_DEFAULT variable are the list of supplementary boot parameters to pass to the kernel.

Comment 6 Jaroslav Škarvada 2015-09-15 08:54:16 UTC
(In reply to David Cantrell from comment #5)
Isn't possible to unify it? My understanding is that parameters from GRUB_CMDLINE_LINUX are added to all kernels and GRUB_CMDLINE_LINUX_DEFAULT only to non rescue kernels. Seeing GRUB_CMDLINE_LINUX_DEFAULT parameters added to images with -rescue- in name seems a bit confusing to me.

Comment 7 Peter Jones 2015-09-15 14:56:41 UTC
See /usr/lib/dracut/dracut.conf.d/02-rescue.conf from dracut-config-rescue for details here - the anaconda team does not own this code; it's part of dracut.

Comment 8 Harald Hoyer 2015-09-15 17:49:04 UTC
$ rpm -qf /usr/lib/dracut/dracut.conf.d/02-rescue.conf
dracut-config-rescue-043-60.git20150811.fc24.x86_64

Just uninstall "dracut-config-rescue".

$ rpm -qfl /usr/lib/dracut/dracut.conf.d/02-rescue.conf
/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh
/usr/lib/dracut/dracut.conf.d/02-rescue.conf
/usr/lib/kernel/install.d/51-dracut-rescue.install

/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh:
[…]
new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
[…]

It uses grubby to install the rescue initramfs entry. Not sure if that is to blame here.

Comment 9 Harald Hoyer 2015-09-15 17:50:59 UTC
(In reply to Tereza Cerna from comment #4)
> My problem is connected with testing of tuned. If GRUB_DISABLE_RECOVERY is
> set to "true", rescue kernel generates $tuned_params and it is bug.
>  
> See the problem:
> 
> # cat /etc/default/grub 
> GRUB_TIMEOUT=5
> GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
> GRUB_DEFAULT=saved
> GRUB_DISABLE_SUBMENU=true
> GRUB_TERMINAL_OUTPUT="console"
> GRUB_CMDLINE_LINUX="console=tty0 vconsole.keymap=us console=ttyS0,115200
> rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto
> vconsole.font=latarcyrheb-sun16 rhgb quiet"
> GRUB_DISABLE_RECOVERY="true"
> GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT:
> +$GRUB_CMDLINE_LINUX_DEFAULT }\$tuned_params"
> 
> # grub2-mkconfig -o /boot/grub2/grub
> 
> # cat /boot/grub2/grub.cfg | grep vmlinuz
> 	linux16 /vmlinuz-3.10.0-306.0.1.el7.x86_64
> root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us
> console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01
> rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto 
> vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
> 	linux16 /vmlinuz-3.10.0-302.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00
> ro console=tty0 vconsole.keymap=us console=ttyS0,115200
> rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto
> vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
> 	linux16 /vmlinuz-3.10.0-295.el7.x86_64 root=/dev/mapper/VolGroup00-LogVol00
> ro console=tty0 vconsole.keymap=us console=ttyS0,115200
> rd.lvm.lv=VolGroup00/LogVol01 rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto
> vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params
> 	linux16 /vmlinuz-0-rescue-d20fb34accd74a158e40457bf1d641bf
> root=/dev/mapper/VolGroup00-LogVol00 ro console=tty0 vconsole.keymap=us
> console=ttyS0,115200 rd.lvm.lv=VolGroup00/LogVol01
> rd.lvm.lv=VolGroup00/LogVol00 crashkernel=auto 
> vconsole.font=latarcyrheb-sun16 rhgb quiet $tuned_params   
> 
> Problem is in last row with rescue kernel which contains string
> "$tuned_params".


And no... dracut does not add "$tuned_params" here... that would be new-kernel-pkg/grubby.

Assigning back to grubby.

Comment 10 Jaroslav Škarvada 2015-09-16 07:59:50 UTC
This is probably not grubby. It happens when grub2-mkconfig is executed, thus there must be problem in some grub template.

The problem is that the content of GRUB_CMDLINE_LINUX_DEFAULT environment variable is added to the rescue kernels, which I think shouldn't.

Comment 11 Jaroslav Škarvada 2015-09-16 08:11:45 UTC
Reproducer:

echo 'GRUB_DISABLE_RECOVERY="true"' >> /etc/default/grub
echo 'GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=1"' >> /etc/default/grub

grub2-mkconfig -o /boot/grub2/grub.cfg

grep rescue /boot/grub2/grub.cfg

Current result:
vmlinuz rescue images with 'isolcpus=1'

Expected result:
a) No rescue images because of GRUB_DISABLE_RECOVERY="true"
b) 'isolcpus=1' not added to rescue images

Comment 12 Peter Jones 2015-09-17 14:19:03 UTC
(In reply to Jaroslav Škarvada from comment #11)
> Reproducer:
> 
> echo 'GRUB_DISABLE_RECOVERY="true"' >> /etc/default/grub
> echo 'GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=1"' >> /etc/default/grub
> 
> grub2-mkconfig -o /boot/grub2/grub.cfg
> 
> grep rescue /boot/grub2/grub.cfg
> 
> Current result:
> vmlinuz rescue images with 'isolcpus=1'
> 
> Expected result:
> a) No rescue images because of GRUB_DISABLE_RECOVERY="true"
> b) 'isolcpus=1' not added to rescue images

You are getting this parameter because when dracut makes its rescue image, it copies parameters from the default.  But your "expected result" #1 is simply a bad expectation.  If you don't want dracut's rescue images, you need to not install dracut-config-rescue .


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