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 installDebianPackage ${prefix} lsb-release
30 if [ "$(chroot ${prefix} lsb_release -is)" = "Ubuntu" ]; then
31 if dpkg --compare-versions "$(chroot ${prefix} lsb_release -rs)" ge 8.10; then
32 installDebianPackage ${prefix} linux-image-virtual
34 installDebianPackage ${prefix} linux-image-xen
37 installDebianPackage ${prefix} linux-image-xen-amd64
38 installDebianPackage ${prefix} linux-image-xen-686
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 # If this is a pv_ops kernel, then we need to make some more changes
62 # to make the console work right
64 if [ "$(chroot ${prefix} lsb_release -is)" = "Ubuntu" ] && \
65 dpkg --compare-versions "$(chroot ${prefix} lsb_release -rs)" ge 8.10; then
66 sed -i -e 's/xvc0/hvc0/' /etc/event.d/tty1
67 sed -i -e 's/console=ttyS0[^ ]*/console=hvc0/' /boot/grub/menu.lst
71 # Regenerate automagic kernels list
73 chroot ${prefix} /usr/sbin/update-grub -y
78 logMessage Script $0 finished