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 625216

Summary: grubby recieved SIGSEGV in kickstart
Product: Red Hat Enterprise Linux 6 Reporter: Jack Neely <jjneely>
Component: grubbyAssignee: Brian Lane <bcl>
Status: CLOSED NOTABUG QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: borgan, gasmith, notting, pasteur, pjones, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-10 19:41:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 647893    
Attachments:
Description Flags
grub configuration none

Description Jack Neely 2010-08-18 21:27:39 UTC
Description of problem:

In my test Kickstart for the RHEL 6 beta, I setup a reinstall target in grub.  This includes running the following command in the %post

/sbin/grubby --add-kernel=/boot/install/vmlinuz    --title="Reinstall Workstation"    --copy-default    --args="ks=http://web-kickstart.linux.ncsu.edu/ks.py ramdisk_size=8192 noshell noipv6 ksdevice=$KSDEVICE"    --initrd=/boot/install/initrd.img

Grubby dies horribly:

grubby recieved SIGSEGV!  Backtrace (8):
/sbin/grubby[0x804f8b8]
[0x67c400]
/lib/libc.so.6(+0x773a8)[0x1873a8]
/sbin/grubby[0x804e1e4]
/sbin/grubby[0x804e33d]
/sbin/grubby[0x804f4f8]
/lib/libc.so.6(__libc_start_main+0xe6)[0x126cc6]
/sbin/grubby[0x80490a1]

When the system reboots after installation I'm able to log in as root and run the same grubby command without error.


Version-Release number of selected component (if applicable):
grubby-7.0.15-1.el6.i686

Comment 2 Bill Nottingham 2010-08-18 23:25:48 UTC
This looks similar to bug 592294.

Comment 3 Jack Neely 2010-08-19 14:22:59 UTC
Created attachment 439696 [details]
grub configuration

This is the grub.conf that anaconda generates, but grubby fails to alter.

Comment 4 RHEL Program Management 2010-10-29 21:31:58 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 5 Jack Neely 2010-11-30 15:35:50 UTC
Now that RHEL 6 final is sitting on my test bench I've discovered that Grubby no longer segfaults in the kickstart %post script.  Instead I get an error message

   grubby fatal error: unable to find a suitable template

That the grub configuration is left unaltered.

I'm still using the below grubby incantation.  I've verified that all the files referenced and environment variables exist.

/sbin/grubby --add-kernel=/boot/install/vmlinuz    --title="Reinstall Workstation"    --copy-default    --args="ks=http://web-kickstart.linux.ncsu.edu/ks.py noshell noipv6 ksdevice=$KSDEVICE"    --initrd=/boot/install/initrd.img

Running the same command on the system after the install produces no error and correctly edits the grub.conf

Comment 6 Jack Neely 2011-01-10 18:09:23 UTC
From the rhel6-list the following in your kickstart before any yum or grubby commands does work around the bug:

ln -s `awk '{ if ($2 == "/") print $1; }' /etc/fstab` /dev/root

Comment 7 Peter Jones 2011-01-10 19:41:08 UTC
If you're going to run grubby from %post, you're going to need to set up the environment that's needed on a running system, which includes that symlink.