3 # This script sets up the ParaVM to use pygrub
9 # Source our common functions
11 if [ -e /usr/lib/xen-tools/common.sh ]; then
12 . /usr/lib/xen-tools/common.sh
21 logMessage Script $0 starting
24 # Install the xen kernel. linux-image-xen is in ubuntu,
25 # linux-image-xen-{amd64,686} in debian.
28 # First we need to figure out whether we're dealing with Debian or
29 # Ubuntu. Unfortunately, Debian doesn't install lsb_release by
30 # default, and its lsb-release package Recommends a bunch of stuff
31 installDebianPackage ${prefix} -o="Apt::Install-Recommends=false" lsb-release
32 if [ "Debian" = "$(chroot ${prefix} lsb_release -si)" ]; then
33 # One of these exists in the amd64 repo, and one of them exists in
34 # the i386 repo. The one that doesn't exist won't get installed
35 installDebianPackage ${prefix} linux-image-xen-amd64
36 installDebianPackage ${prefix} linux-image-xen-686
38 installDebianPackage ${prefix} linux-image-xen
41 installDebianPackage ${prefix} grub
44 # Make the /boot/grub directory
46 mkdir -p ${prefix}/boot/grub
49 # Create stock menu.lst
51 chroot ${prefix} /usr/sbin/update-grub -y
54 # Patches to add xen kernels, use serial console, etc.
56 for patch in $dir/patches/*; do
57 patch -l -d ${prefix} -p1 < $patch
61 # Regenerate automagic kernels list
63 chroot ${prefix} /usr/sbin/update-grub -y
68 logMessage Script $0 finished