source: trunk/packages/invirt-autoinstaller/common/usr/lib/xen-tools/debian.d/97-setup-grub @ 1721

Last change on this file since 1721 was 1719, checked in by broder, 16 years ago

Install the right kernel on both Debian and Ubuntu - both 32 and 64 bit

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/sh
2#
3#  This script sets up the ParaVM to use pygrub
4#
5
6prefix=$1
7
8#
9#  Source our common functions
10#
11if [ -e /usr/lib/xen-tools/common.sh ]; then
12    . /usr/lib/xen-tools/common.sh
13else
14    . ./hooks/common.sh
15fi
16
17echo SCRIPT = $0
18dir=`dirname "$0"`
19
20
21logMessage Script $0 starting
22
23#
24# Install the xen kernel.  linux-image-xen is in ubuntu,
25# linux-image-xen-{amd64,686} in debian.
26#
27
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
31installDebianPackage ${prefix} -o="Apt::Install-Recommends=false" lsb-release
32if [ "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
37else
38    installDebianPackage ${prefix} linux-image-xen
39fi
40
41installDebianPackage ${prefix} grub
42
43#
44# Make the /boot/grub directory
45#
46mkdir -p ${prefix}/boot/grub
47
48#
49# Create stock menu.lst
50#
51chroot ${prefix} /usr/sbin/update-grub -y
52
53#
54# Patches to add xen kernels, use serial console, etc.
55#
56for patch in $dir/patches/*; do
57    patch -l -d ${prefix} -p1 < $patch
58done
59
60#
61# Regenerate automagic kernels list
62#
63chroot ${prefix} /usr/sbin/update-grub -y
64
65#
66# Log our finish
67#
68logMessage Script $0 finished
69
Note: See TracBrowser for help on using the repository browser.