53 lines
1.0 KiB
Bash
Executable File
53 lines
1.0 KiB
Bash
Executable File
#!/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/share/xen-tools/common.sh ]; then
|
|
. /usr/share/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 2>/dev/null | egrep -qi 'GRand Unified Bootloader.*Legacy'; then
|
|
installDebianPackage ${prefix} grub-legacy
|
|
else
|
|
installDebianPackage ${prefix} grub
|
|
fi
|
|
|
|
if [ ! -e ${prefix}/boot/grub/default ]; then
|
|
echo default > ${prefix}/boot/grub/default
|
|
fi
|
|
chroot ${prefix} /usr/sbin/update-grub
|
|
|
|
else
|
|
logMessage "pygrub not set, skipping grub-legacy installation"
|
|
fi # if pygrub
|
|
|
|
#
|
|
# Log our finish
|
|
#
|
|
logMessage Script $0 finished
|