summaryrefslogtreecommitdiff
path: root/setup-disk.in
diff options
context:
space:
mode:
authorCedric Schieli <cschieli@gmail.com>2010-04-14 13:52:29 +0000
committerCedric Schieli <cschieli@gmail.com>2010-04-15 14:26:43 +0000
commit9b9254613b50f254333122d4aa9d6efaccfc911b (patch)
tree864bea34b3b9ae28a744fa54e3048542784b26bd /setup-disk.in
parent0fdb828fc3b13dbb3454e3270dec8b7859f3cc6d (diff)
downloadalpine-conf-9b9254613b50f254333122d4aa9d6efaccfc911b.zip
setup-disk: install a /boot/grub/menu.lst if Xen is detected
Diffstat (limited to 'setup-disk.in')
-rw-r--r--setup-disk.in24
1 files changed, 21 insertions, 3 deletions
diff --git a/setup-disk.in b/setup-disk.in
index 7a485b8..1e8e758 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -56,6 +56,10 @@ is_vmware() {
|| grep -q VMware /proc/ide/hd*/model 2>/dev/null
}
+is_xen() {
+ [ -d /proc/xen ]
+}
+
# Find the disk device from given partition
disk_from_part() {
# we need convert cciss/c0d0* cciss!c0d0*...
@@ -171,8 +175,19 @@ install_mounted_root() {
pax_nouderef=
fi
- # create an extlinux.conf
- cat >"$mnt"/boot/extlinux.conf <<EOF
+ if is_xen; then
+ # create a menu.lst
+ mkdir -p "$mnt"/boot/grub
+ cat >"$mnt"/boot/grub/menu.lst <<EOF
+default 0
+title $KERNEL_FLAVOR
+root (hd0,0)
+kernel /boot/$KERNEL_FLAVOR root=$(uuid_or_device $rootdev) modules=ext3$raidmod quiet xen BOOT_IMAGE=/boot/$KERNEL_FLAVOR
+initrd=/boot/initramfs-$KERNEL_FLAVOR
+EOF
+ else
+ # create an extlinux.conf
+ cat >"$mnt"/boot/extlinux.conf <<EOF
timeout 20
prompt 1
default $KERNEL_FLAVOR
@@ -180,6 +195,8 @@ label $KERNEL_FLAVOR
kernel /boot/vmlinuz-$KERNEL_FLAVOR
append initrd=/boot/initramfs-$KERNEL_FLAVOR root=$(uuid_or_device $rootdev) modules=sd-mod,usb-storage,ext3$raidmod ${pax_nouderef}quiet
EOF
+ fi
+
# generate the fstab
if [ -f "$mnt"/etc/fstab ]; then
mv "$mnt"/etc/fstab "$mnt"/etc/fstab.old
@@ -188,7 +205,7 @@ EOF
# install extlinux
apk add -q syslinux
- extlinux -i $raidopt "$mnt"/boot/
+ is_xen || extlinux -i $raidopt "$mnt"/boot/
# unmount the partitions
umount $(awk '{print $2}' /proc/mounts | grep ^"$mnt" | sort -r)
@@ -390,6 +407,7 @@ __EOF__
KERNEL_FLAVOR=grsec
case "$(uname -r)" in
*-vs[0-9]*) KERNEL_FLAVOR=vserver;;
+ *-pae) KERNEL_FLAVOR=pae;;
esac
# Parse args