summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xsetup-alpine.in10
-rw-r--r--setup-xen-dom0.in28
3 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5df268d..d748a73 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,7 @@ SBIN_FILES := lbu\
setup-proxy\
setup-sshd\
setup-timezone\
+ setup-xen-dom0\
setup-xorg-base\
update-conf
diff --git a/setup-alpine.in b/setup-alpine.in
index 8406a9c..eb1c6a8 100755
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -48,6 +48,12 @@ while getopts "af:c:hq" opt ; do
done
shift `expr $OPTIND - 1`
+# mount xenfs so we can detect xen dom0
+if [ "$(rc --sys)" = "XENU" ] && ! grep -q '^xenfs' /proc/mounts; then
+ modprobe xenfs
+ mount -t xenfs xenfs /proc/xen
+fi
+
if [ "$USEANSWERFILE" != "" ]; then
if [ -e "$USEANSWERFILE" ]; then
. "$USEANSWERFILE"
@@ -178,6 +184,10 @@ if ! is_qemu; then
$PREFIX/sbin/setup-ntp ${NTPOPTS}
fi
+if is_xen_dom0; then
+ setup-xen-dom0
+fi
+
DEFAULT_DISK=none \
$PREFIX/sbin/setup-disk -q ${DISKOPTS}
diff --git a/setup-xen-dom0.in b/setup-xen-dom0.in
new file mode 100644
index 0000000..a9c993a
--- /dev/null
+++ b/setup-xen-dom0.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# simple script to setup basic xen dom0
+
+# kernel modules
+for mod in xen_netback xen_blkback xenfs xen-platform-pci xen_wdt tun; do
+ modprobe $mod
+ grep -q -w $mod /etc/modules || echo $mod >> /etc/modules
+done
+
+# install packages
+apk add -q xen udev
+
+# setup and start services
+rc-update -q del mdev sysinit
+rc-update -q add udev sysinit
+for svc in udev-postmount xenstored xenconsoled; do
+ rc-update -q add $svc default
+done
+
+if ! rc-service -q udev status; then
+ rc-service udev start
+ rc-service udev-postmount start
+fi
+
+rc-service xenstored start
+rc-service xenconsoled start
+