Update the setup-grub hook in the autoinstaller to work with pv_ops 0.0.20
authorEvan Broder <broder@mit.edu>
Sun, 3 May 2009 01:34:40 +0000 (21:34 -0400)
committerEvan Broder <broder@mit.edu>
Sun, 3 May 2009 01:34:40 +0000 (21:34 -0400)
Ubuntu kernels.

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

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

index 2539e6b..26fbdda 100755 (executable)
@@ -24,9 +24,19 @@ logMessage Script $0 starting
 # Install the xen kernel.  linux-image-xen is in ubuntu,
 # linux-image-xen-{amd64,686} in debian.
 #
 # Install the xen kernel.  linux-image-xen is in ubuntu,
 # linux-image-xen-{amd64,686} in debian.
 #
-installDebianPackage ${prefix} linux-image-xen-amd64
-installDebianPackage ${prefix} linux-image-xen-686
-installDebianPackage ${prefix} linux-image-xen
+
+installDebianPackage ${prefix} lsb-release
+
+if [ "$(chroot ${prefix} lsb_release -is)" = "Ubuntu" ]; then
+    if dpkg --compare-versions "$(chroot ${prefix} lsb_release -rs)" ge 8.10; then
+        installDebianPackage ${prefix} linux-image-virtual
+    else
+        installDebianPackage ${prefix} linux-image-xen
+    fi
+else
+    installDebianPackage ${prefix} linux-image-xen-amd64
+    installDebianPackage ${prefix} linux-image-xen-686
+fi
 
 installDebianPackage ${prefix} grub
 
 
 installDebianPackage ${prefix} grub
 
@@ -48,6 +58,16 @@ for patch in $dir/patches/*; do
 done
 
 #
 done
 
 #
+# If this is a pv_ops kernel, then we need to make some more changes
+# to make the console work right
+#
+if [ "$(chroot ${prefix} lsb_release -is)" = "Ubuntu" ] && \
+    dpkg --compare-versions "$(chroot ${prefix} lsb_release -rs)" ge 8.10; then
+    sed -i -e 's/xvc0/hvc0/' /etc/event.d/tty1
+    sed -i -e 's/console=ttyS0[^ ]*/console=hvc0/' /boot/grub/menu.lst
+fi
+
+#
 # Regenerate automagic kernels list
 #
 chroot ${prefix} /usr/sbin/update-grub -y
 # Regenerate automagic kernels list
 #
 chroot ${prefix} /usr/sbin/update-grub -y
index c56a864..dc4a04c 100644 (file)
@@ -1,3 +1,9 @@
+invirt-autoinstaller (0.0.20) unstable; urgency=low
+
+  * Update the setup-grub hook to work with pv_ops Ubuntu kernels.
+
+ -- Evan Broder <broder@mit.edu>  Sat, 02 May 2009 21:33:44 -0400
+
 invirt-autoinstaller (0.0.19) unstable; urgency=low
 
   * fix symlinks
 invirt-autoinstaller (0.0.19) unstable; urgency=low
 
   * fix symlinks