[kernel-xen] kernel-xen-3.9.7-1 packages available - TESTERS REQUIRED!
Adi Pircalabu
adi at ddns.com.au
Wed Jun 26 14:57:03 EST 2013
On 26-06-2013 13:51 PM, Steven Haigh wrote:
> This makes me think I should use something like:
> GRUB_CONF=$(readlink -f /etc/grub.conf 2>/dev/null)
> if [ -z $GRUB_CONF ]; then
> if [ -f "/boot/grub/grub.conf" ]; then
> GRUB_CONF="/boot/grub/grub.conf"
Problem here, $GRUB_CONF link can point to any other file, you don't
test the value but you then test if /boot/grub/grub.conf exists and use
it. In this case the symlink test is useless.
> Logically, this means:
> 1) Check where /etc/grub.conf links to, then use that.
> 2) If we can't figure out where the symlink goes or it doesn't exist,
> see if /boot/grub/grub.conf exists, if so, use it.
> 3) If we can't figure out the symlink, nor find a
> /boot/grub/grub.conf, print an error and give up.
I really don't know what's supposed to happen in the future with
/etc/grub.conf and /boot/grub/grub.conf. At the moment the only
certainty is the existence of /boot/grub/grub.conf on all recent RedHat
versions to date, so maybe it's not a bad idea to just use
/boot/grub/grub.conf and forget about /etc/grub.conf. If you want to use
/etc/grub.conf you'll have to add additional logic to deal with states
like:
Is /etc/grub.conf pointing to /boot/grub/grub.conf?
If 'yes' use it
Else
Is the target a valid grub configuration file? How to validate it
and confirm that it's actually used by grub?
... and so on
--
Adi Pircalabu
More information about the kernel-xen
mailing list