boxgrinder/boxgrinder-build — pull request #13 by ryanuber (2013-05-02 18:41:24+00:00)
Title: Anaconda RHEL ports for /etc/grub.conf symlink and /etc/sysconfig/kernel

This patch brings the symlink from /etc/grub.conf to /boot/grub/grub.conf into boxgrinder for RHEL-based distributions. The original logic exists in the Anaconda project's source code, in `pyanaconda/bootloader.py`, beginning at line 1202.

This is necessary because the /sbin/new-kernel-pkg script depends on it. Without this simple symbolic link, RHEL machines created with boxgrinder will never rewrite the grub.conf file after updating a kernel. It will silently fail. This behavior has been observed on both CentOS and Scientific Linux, and likely applies to all RHEL-based distributions.

This patch also provides ported logic for writing the `/etc/sysconfig/kernel` file, which is also typically handled by Anaconda and is required to write new GRUB configuration after kernel updates. The original code in Anaconda can be found in `pyanaconda/bootloader.py` beginning at line 2133.

Tests are included for both.