Red Hat Bugzilla – Bug 625216
grubby recieved SIGSEGV in kickstart
Last modified: 2011-08-31 15:08:34 EDT
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
This looks similar to bug 592294.
Created attachment 439696 [details] grub configuration This is the grub.conf that anaconda generates, but grubby fails to alter.
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.
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
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
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.