From 1f3e23f7147ef23f338788a223f8a5901546866a Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Wed, 12 Oct 2011 17:13:27 -0700 Subject: Bugfix 7502: Get "add system image" to work on Xen This fix solves the problem with indirection. We introduce a symlink in /live/image/boot pointing to the current default system image. The pygrub config file in /boot/grub/menu.lst points to the kernel and initrd files in the default image by using this symlink in the pathname. Every time we add, delete or change the default system image, we need to change this symlink to point to the new default image. --- scripts/install/install-image-existing | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/install/install-image-existing') diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing index 7c75b35b..ea5455ea 100755 --- a/scripts/install/install-image-existing +++ b/scripts/install/install-image-existing @@ -258,6 +258,12 @@ if [ -e "$DEF_GRUB" ]; then sed -n '/^menuentry/,${p}' $old_grub_cfg >>$new_grub_cfg sed -i "s/^set default=[0-9]\+$/set default=$new_index/" $new_grub_cfg mv $new_grub_cfg $old_grub_cfg + + # Update the default image symlink used by Xen + if [ -L $BOOT_DIR/%%default_image ]; then + mv $BOOT_DIR/%%default_image $BOOT_DIR/%%default_image.orig + ln -s $NEWNAME $BOOT_DIR/%%default_image + fi fi logger -p local3.warning -t "SystemImage" "System Image $NEWNAME has been added and made the default boot image" -- cgit v1.2.3