In invirt-autoinstaller: 0.0.26
authorEvan Broder <broder@mit.edu>
Sun, 3 May 2009 05:19:10 +0000 (01:19 -0400)
committerEvan Broder <broder@mit.edu>
Sun, 3 May 2009 05:19:10 +0000 (01:19 -0400)
  * Switch the grub config and /etc/fstab to using UUIDs for specifying
    the boot and swap partitions.

svn path=/trunk/packages/invirt-autoinstaller/; revision=2339

common/usr/lib/xen-tools/debian.d/93-setup-grub
debian/changelog

index c6b6cb2..5102c4a 100755 (executable)
@@ -68,6 +68,21 @@ if [ "$(chroot ${prefix} lsb_release -is)" = "Ubuntu" ] && \
 fi
 
 #
 fi
 
 #
+# Since pv_ops kernels force block device names to xvda, xvdb, etc,
+# the default root value of root=/dev/hda won't actually help us.
+#
+# To work around that, find a UUID for the swap and root partitions
+# and use that in the grub config (and also in /etc/fstab)
+#
+ROOT_DEV="$(perl -e 'print $ENV{"image-dev"}')"
+SWAP_DEV="$(perl -e 'print $ENV{"swap-dev"}')"
+ROOT_UUID="$(vol_id --uuid "$ROOT_DEV")"
+SWAP_UUID="$(vol_id --uuid "$SWAP_DEV")"
+sed -i -e "s#root=[^ ]*#root=UUID=$ROOT_UUID#" ${prefix}/boot/grub/menu.lst
+sed -i -e "s#${ROOT_DEV}#${ROOT_UUID}#" ${prefix}/etc/fstab
+sed -i -e "s#${SWAP_DEV}#${SWAP_UUID}#" ${prefix}/etc/fstab
+
+#
 # Regenerate automagic kernels list
 #
 chroot ${prefix} /usr/sbin/update-grub -y
 # Regenerate automagic kernels list
 #
 chroot ${prefix} /usr/sbin/update-grub -y
index db1f706..1123964 100644 (file)
@@ -1,3 +1,10 @@
+invirt-autoinstaller (0.0.26) unstable; urgency=low
+
+  * Switch the grub config and /etc/fstab to using UUIDs for specifying
+    the boot and swap partitions.
+
+ -- Evan Broder <broder@mit.edu>  Sun, 03 May 2009 01:18:45 -0400
+
 invirt-autoinstaller (0.0.25) unstable; urgency=low
 
   * Uh...right. Let's edit the event.d file and menu.lst within the
 invirt-autoinstaller (0.0.25) unstable; urgency=low
 
   * Uh...right. Let's edit the event.d file and menu.lst within the