summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/xen/XX_xen.sh
diff options
context:
space:
mode:
authorMichael Janczyk2010-04-06 20:01:24 +0200
committerMichael Janczyk2010-04-06 20:01:24 +0200
commite437b8813f2a84ccffa3a75ba1f534b38ce72b9c (patch)
treefcc8c42ec290da4f343797d4eee4c03087fd01df /os-plugins/plugins/xen/XX_xen.sh
parentAdding the runlevel linker again (having the upstart component for newer (diff)
downloadcore-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.tar.gz
core-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.tar.xz
core-e437b8813f2a84ccffa3a75ba1f534b38ce72b9c.zip
cumulative commit of local branch, many changes regarding virtualization
Diffstat (limited to 'os-plugins/plugins/xen/XX_xen.sh')
-rw-r--r--os-plugins/plugins/xen/XX_xen.sh54
1 files changed, 49 insertions, 5 deletions
diff --git a/os-plugins/plugins/xen/XX_xen.sh b/os-plugins/plugins/xen/XX_xen.sh
index ba2c4f00..af3f6cc4 100644
--- a/os-plugins/plugins/xen/XX_xen.sh
+++ b/os-plugins/plugins/xen/XX_xen.sh
@@ -14,16 +14,60 @@
# script is included from init via the "." load function - thus it has all
# variables and functions available
-if [ -e /initramfs/plugin-conf/xen.conf ]; then
- . /initramfs/plugin-conf/xen.conf
- if [ $xen_active -ne 0 ]; then
+# include default directories
+. /etc/openslx.conf
+
+CONFFILE=/initramfs/plugin-conf/xen.conf
+PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/xen
+PLUGINDIR=/mnt/${OPENSLX_DEFAULT_DIR}/plugin-repo/xen
+VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}/xen
+
+# check if the configuration file is available
+if [ -e ${CONFFILE} ]; then
+
+ # load needed variables
+ . ${CONFFILE}
+
+ # Test if this plugin is activated... more or less useless with the
+ # new plugin system
+ if [ $xen_active -ne 0 2>/dev/null ]; then
+
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'xen' os-plugin ...";
+
+ # load general configuration
+ . /etc/initramfs-setup
+
+ # get source of xen image server (get type, server and path)
+ if strinstr "/" "${xen_imagesrc}" ; then
+ vbimgprot=$(uri_token ${xen_imagesrc} prot)
+ vbimgserv=$(uri_token ${xen_imagesrc} server)
+ vbimgpath="$(uri_token ${xen_imagesrc} path)"
+ fi
+ if [ -n "${vbimgserv}" ] ; then
+ # directory where qemu images are expected in
+ mnttarget=${VIRTDIR}
+ # mount the xen image source readonly (ro)
+ fsmount ${vbimgprot} ${vbimgserv} ${vbimgpath} ${mnttarget} ro
+ else
+ [ $DEBUGLEVEL -gt 1 ] && \
+ error " * Incomplete information in variable ${xen_imagesrc}." \
+ nonfatal
+ fi
+
+ # copy virtualization include files to config dir
+ testmkd ${PLUGINCONFDIR}
testmkd /mnt/var/log/xen
testmkd /mnt/var/run/xend
testmkd /mnt/var/run/xenstored
+ cp ${PLUGINDIR}/*.include ${PLUGINCONFDIR}
+ # copy ${CONFFILE} to ${PLUGINCONFDIR} just in case
+ cp ${CONFFILE} ${PLUGINCONFDIR}
+ # activate init files
+ # TODO: in xen-slx start
+ # increase loop devices for loop images
+ modprobe -q loop max_loop=64 >/tmp/xen.log 2>&1
rllinker "xendomains" 14 8
rllinker "xend" 13 9
-
- modprobe loop max_loop=64
fi
fi