]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Install grub-legacy in all pygrub-based DomUs
authorAxel Beckert <abe@deuxchevaux.org>
Tue, 22 Jan 2013 01:30:15 +0000 (02:30 +0100)
committerAxel Beckert <abe@deuxchevaux.org>
Tue, 22 Jan 2013 01:35:27 +0000 (02:35 +0100)
debian/changelog
hooks/common/82-install-grub-legacy [new file with mode: 0755]
hooks/debian/82-install-grub-legacy [new symlink]
hooks/edgy/82-install-grub-legacy [new symlink]
hooks/intrepid/82-install-grub-legacy [new symlink]
hooks/karmic/82-install-grub-legacy [new symlink]

index d4769f4aab091fa5d7d88c543f836c695ec3041c..e6d8b7db6b9cc06caa31cd81cbf1e0d515a8bf68 100644 (file)
@@ -28,6 +28,8 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low
       initrds also suitable for DomU usage. Trigger update-initramfs.
     - By default install linux-image-virtual instead of linux-image-server
       on Ubuntu Intrepid and newer (Hopefully closes: #640099, LP #839492)
+    - Installs a legacy grub in all pygrub based DomUs to be able to
+      update the menu.list automatically.
   * Add debian/gbp.conf to be able to to build xen-tools with
     git-buildpackage.
   * Clean up debian/rules:
diff --git a/hooks/common/82-install-grub-legacy b/hooks/common/82-install-grub-legacy
new file mode 100755 (executable)
index 0000000..8beb5ab
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+#  Ensure that either modules-init-tools or kmod is setup.
+#
+#  This is most likely required if you're using a custom kernel
+# for your Xen system.  But even if it isn't required it can't
+# really do anything bad; just waste a bit of space.
+
+
+prefix=$1
+
+
+
+#
+#  Source our common functions
+#
+if [ -e /usr/lib/xen-tools/common.sh ]; then
+    . /usr/lib/xen-tools/common.sh
+else
+    . ./hooks/common.sh
+fi
+
+
+#
+# Log our start
+#
+logMessage Script $0 starting
+
+if [ ${pygrub} ]; then
+
+#
+#  Install the grub 0.9x package ("grub-legacy" on Debian, "grub" on Ubuntu)
+#
+if chroot ${prefix} /usr/bin/apt-cache show grub-legacy >/dev/null 2>/dev/null; then
+    installDebianPackage ${prefix} grub-legacy
+else
+    installDebianPackage ${prefix} grub
+fi
+
+else
+    logMessage "pygrub not set, skipping grub-legacy installation"
+fi # if pygrub
+
+#
+#  Log our finish
+#
+logMessage Script $0 finished
diff --git a/hooks/debian/82-install-grub-legacy b/hooks/debian/82-install-grub-legacy
new file mode 120000 (symlink)
index 0000000..4cc2a3a
--- /dev/null
@@ -0,0 +1 @@
+../common/82-install-grub-legacy
\ No newline at end of file
diff --git a/hooks/edgy/82-install-grub-legacy b/hooks/edgy/82-install-grub-legacy
new file mode 120000 (symlink)
index 0000000..4cc2a3a
--- /dev/null
@@ -0,0 +1 @@
+../common/82-install-grub-legacy
\ No newline at end of file
diff --git a/hooks/intrepid/82-install-grub-legacy b/hooks/intrepid/82-install-grub-legacy
new file mode 120000 (symlink)
index 0000000..4cc2a3a
--- /dev/null
@@ -0,0 +1 @@
+../common/82-install-grub-legacy
\ No newline at end of file
diff --git a/hooks/karmic/82-install-grub-legacy b/hooks/karmic/82-install-grub-legacy
new file mode 120000 (symlink)
index 0000000..4cc2a3a
--- /dev/null
@@ -0,0 +1 @@
+../common/82-install-grub-legacy
\ No newline at end of file