In invirt-autoinstaller:
[invirt/packages/invirt-autoinstaller.git] / common / usr / lib / xen-tools / debian.d / 93-setup-grub
index 8447743..d3ba6fd 100755 (executable)
@@ -85,9 +85,9 @@ for i in $(seq 1 "$NUMPARTITIONS"); do
         swap) SWAP_GUEST="$(echo ${!var} | cut -f8 -d:)";;
     esac
 done
         swap) SWAP_GUEST="$(echo ${!var} | cut -f8 -d:)";;
     esac
 done
-sed -i -e "s#root=[^ ]*#root=UUID=$ROOT_UUID#" ${prefix}/boot/grub/menu.lst
-sed -i -e "s#${ROOT_GUEST}#UUID=${ROOT_UUID}#" ${prefix}/etc/fstab
-sed -i -e "s#${SWAP_GUEST}#UUID=${SWAP_UUID}#" ${prefix}/etc/fstab
+sed -i -re "s%^(# *kopt=.*root=)[^ ]*%\1UUID=$ROOT_UUID%" ${prefix}/boot/grub/menu.lst
+sed -i -e "s%${ROOT_GUEST}%UUID=${ROOT_UUID}%" ${prefix}/etc/fstab
+sed -i -e "s%${SWAP_GUEST}%UUID=${SWAP_UUID}%" ${prefix}/etc/fstab
 
 #
 # Regenerate automagic kernels list, saving our changes
 
 #
 # Regenerate automagic kernels list, saving our changes