summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-06-21 18:28:31 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-06-21 18:28:31 +0000
commitabaaa064e3ff78cef3c29018456d9078c418bcee (patch)
treee83eed5d72766627106fbabb1e206bde4b97e26f
parentcda38306b4d0b5ea34ad529455bd8a423ef502e6 (diff)
downloadalpine-conf-abaaa064e3ff78cef3c29018456d9078c418bcee.zip
setup-disk: fix install of xen dom0
ref #1213
-rw-r--r--setup-disk.in19
1 files changed, 8 insertions, 11 deletions
diff --git a/setup-disk.in b/setup-disk.in
index 0afcfff..366ccdc 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -73,10 +73,6 @@ is_vmware() {
|| grep -q VMware /proc/ide/hd*/model 2>/dev/null
}
-is_xen() {
- [ -d /proc/xen ]
-}
-
# return true (0) if given device is lvm
is_lvm() {
lvs "$1" >/dev/null 2>&1
@@ -250,15 +246,15 @@ install_mounted_root() {
if is_vmware; then
kernel_opts="pax_nouderef $kernel_opts"
fi
- if is_xen; then
- kernel_opts="xen $kernel_opts"
- fi
modules="sd-mod,usb-storage,${root_fs}${raidmod}"
sed -e "s:^root=.*:root=$root:" \
-e "s:^default_kernel_opts=.*:default_kernel_opts=\"$kernel_opts\":" \
-e "s:^modules=.*:modules=$modules:" \
/etc/update-extlinux.conf > "$mnt"/etc/update-extlinux.conf
-
+ if [ "$(rc --sys)" = "XEN0" ]; then
+ sed -i -e "s:^default=.*:default=xen-grsec:" \
+ "$mnt"/etc/update-extlinux.conf
+ fi
# generate the fstab
if [ -f "$mnt"/etc/fstab ]; then
@@ -282,6 +278,9 @@ EOF
local apkflags="--initdb --quiet --progress --update-cache --clean-protected"
local pkgs=$(cat "$mnt"/etc/apk/world "$mnt"/var/lib/apk/world 2>/dev/null)
pkgs="$pkgs acct linux-$KERNEL_FLAVOR alpine-base"
+ if [ "$(rc --sys)" = "XEN0" ]; then
+ pkgs="$pkgs xen-hypervisor"
+ fi
local repos=$(sed -e 's/\#.*//' /etc/apk/repositories)
local repoflags=
for i in $repos; do
@@ -291,9 +290,7 @@ EOF
apk add --root "$mnt" $apkflags --overlay-from-stdin \
$repoflags $pkgs <$ovlfiles>/dev/null || return 1
echo ""
- if ! is_xen; then
- extlinux $extlinux_raidopt --install "$mnt"/boot
- fi
+ extlinux $extlinux_raidopt --install "$mnt"/boot
}
unmount_partitions() {