From 416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Thu, 2 Sep 2010 17:50:49 +0200 Subject: change dir structure --- src/os-plugins/plugins/openvz/XX_openvz.sh | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/os-plugins/plugins/openvz/XX_openvz.sh (limited to 'src/os-plugins/plugins/openvz/XX_openvz.sh') diff --git a/src/os-plugins/plugins/openvz/XX_openvz.sh b/src/os-plugins/plugins/openvz/XX_openvz.sh new file mode 100644 index 00000000..721c76a4 --- /dev/null +++ b/src/os-plugins/plugins/openvz/XX_openvz.sh @@ -0,0 +1,66 @@ +# Copyright (c) 2010 - RZ Uni Freiburg +# Copyright (c) 2010 - OpenSLX GmbH +# +# This program/file is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org +# +# stage3 part of 'openvz' plugin - the runlevel script +# +# script is included from init via the "." load function - thus it has all +# variables and functions available + +# include default directories +. /etc/openslx.conf + +CONFFILE=/initramfs/plugin-conf/openvz.conf +PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/openvz +PLUGINDIR=/mnt/${OPENSLX_DEFAULT_DIR}/plugin-repo/openvz +VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}/openvz + +# 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 [ $openvz_active -ne 0 2>/dev/null ]; then + + [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'openvz' os-plugin ..."; + + # load general configuration + . /etc/initramfs-setup + + # get source of openvz image server (get type, server and path) + if strinstr "/" "${openvz_imagesrc}" ; then + vbimgprot=$(uri_token ${openvz_imagesrc} prot) + vbimgserv=$(uri_token ${openvz_imagesrc} server) + vbimgpath="$(uri_token ${openvz_imagesrc} path)" + fi + if [ -n "${vbimgserv}" ] ; then + # directory where qemu images are expected in + mnttarget=${VIRTDIR} + # mount the openvz image source readonly (ro) + fsmount ${vbimgprot} ${vbimgserv} ${vbimgpath} ${mnttarget} ro + else + [ $DEBUGLEVEL -gt 1 ] && \ + error " * Incomplete information in variable ${openvz_imagesrc}." \ + nonfatal + fi + + # copy virtualization include files to config dir + testmkd ${PLUGINCONFDIR} + cp ${PLUGINDIR}/*.include ${PLUGINCONFDIR} + # copy ${CONFFILE} to ${PLUGINCONFDIR} just in case + cp ${CONFFILE} ${PLUGINCONFDIR} + + # activate init files + + fi +fi -- cgit v1.2.3-55-g7522