From 71ecbe8e688b11dd3baf8dc1c41d3b355eac01c6 Mon Sep 17 00:00:00 2001
From: Michael Janczyk
Date: Fri, 23 Oct 2009 17:26:38 +0000
Subject: default directories introduced. please test and say what you think.
examples see plugins vmware and vmchooser. can be simplyfied further
(VIRTDIR, ETC...). /opt/openslx can bu user for plugins, ect as well (maybe
PLUGINDIR?).
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3177 95ad53e4-c205-0410-b2fa-d234c58c8868
---
.../plugins/desktop/themes/gdm/openslx/theme.xml | 80 +++++++++++-----------
.../plugins/desktop/themes/kdm/openslx/theme.xml | 54 +++++++--------
os-plugins/plugins/vmchooser/XX_vmchooser.sh | 35 ++++++----
os-plugins/plugins/vmchooser/files/run-virt.sh | 5 +-
os-plugins/plugins/vmware/XX_vmware.sh | 13 ++--
os-plugins/plugins/vmware/files/run-virt.include | 9 ++-
6 files changed, 104 insertions(+), 92 deletions(-)
mode change 100755 => 100644 os-plugins/plugins/desktop/themes/gdm/openslx/theme.xml
(limited to 'os-plugins')
diff --git a/os-plugins/plugins/desktop/themes/gdm/openslx/theme.xml b/os-plugins/plugins/desktop/themes/gdm/openslx/theme.xml
old mode 100755
new mode 100644
index 0706e8f0..46ef334e
--- a/os-plugins/plugins/desktop/themes/gdm/openslx/theme.xml
+++ b/os-plugins/plugins/desktop/themes/gdm/openslx/theme.xml
@@ -5,13 +5,13 @@ GDM-OpenSLX-Theme
-->
-
+
-
-
+
-
@@ -21,14 +21,14 @@ GDM-OpenSLX-Theme
-
+
-
- -
+
-
%c
@@ -50,7 +50,7 @@ GDM-OpenSLX-Theme
-
+
-
@@ -61,13 +61,13 @@ GDM-OpenSLX-Theme
-
+
-
-
+
-
@@ -91,16 +91,16 @@ GDM-OpenSLX-Theme
-
+
-
+
-
-
+
-
+
-
@@ -118,8 +118,8 @@ GDM-OpenSLX-Theme
-
- -
+
+
-
@@ -134,7 +134,7 @@ GDM-OpenSLX-Theme
-
+
-
@@ -164,7 +164,7 @@ GDM-OpenSLX-Theme
-
+
-
@@ -188,37 +188,37 @@ GDM-OpenSLX-Theme
-
+
-
+
-
- -
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
+
+ -
+
+
+
+
-
+
+
+
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+
+
diff --git a/os-plugins/plugins/desktop/themes/kdm/openslx/theme.xml b/os-plugins/plugins/desktop/themes/kdm/openslx/theme.xml
index 4af39bdf..d748c776 100644
--- a/os-plugins/plugins/desktop/themes/kdm/openslx/theme.xml
+++ b/os-plugins/plugins/desktop/themes/kdm/openslx/theme.xml
@@ -4,15 +4,15 @@
KDM-OpenSLX-Theme
-->
-
+
-
+
-
-
+
-
@@ -22,14 +22,14 @@ KDM-OpenSLX-Theme
-
+
-
-
- -
+
+
-
%c
@@ -51,7 +51,7 @@ KDM-OpenSLX-Theme
-
+
-
@@ -62,19 +62,19 @@ KDM-OpenSLX-Theme
-
+
-
-
+
-
-
+
-
@@ -99,7 +99,7 @@ KDM-OpenSLX-Theme
- -
+
-
@@ -112,27 +112,27 @@ KDM-OpenSLX-Theme
-
+
- -
-
-
-
-
+ -
+
+
+
+
-
+
-
+
-
-
+
-
+
-
@@ -150,8 +150,8 @@ KDM-OpenSLX-Theme
-
- -
+
+
-
@@ -166,7 +166,7 @@ KDM-OpenSLX-Theme
-
+
-
@@ -196,7 +196,7 @@ KDM-OpenSLX-Theme
-
+
-
@@ -220,13 +220,13 @@ KDM-OpenSLX-Theme
-
+
-
+
diff --git a/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
index 65e23d4e..1cb827a3 100644
--- a/os-plugins/plugins/vmchooser/XX_vmchooser.sh
+++ b/os-plugins/plugins/vmchooser/XX_vmchooser.sh
@@ -12,14 +12,19 @@
# 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/vmchooser.conf"
+ETCDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}
+VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}
if [ -e $CONFFILE ]; then
. $CONFFILE
if [ $vmchooser_active -ne 0 ] ; then
- [ $DEBUGLEVEL -gt 0 ] && echo "vmchooser: copying stage3 configuration file ..."
- testmkd /mnt/etc/opt/openslx
- cp $CONFFILE /mnt/etc/opt/openslx/vmchooser-stage3.conf
+ [ $DEBUGLEVEL -gt 0 ] \
+ && echo "vmchooser: copying stage3 configuration file ..."
+ cp $CONFFILE ${ETCDIR}/vmchooser-stage3.conf
testmkd /mnt/var/X11R6/bin
ln -s /opt/openslx/plugin-repo/vmchooser/run-virt.sh \
@@ -28,8 +33,8 @@ if [ -e $CONFFILE ]; then
/mnt/var/X11R6/bin/vmchooser
# setup all generic virtualization / starting stuff like the floppy image
- testmkd /mnt/var/lib/virt/vmchooser/fd-loop 1777
- testmkd /mnt/var/lib/virt/vmchooser/loopimg
+ testmkd ${VIRTDIR}/vmchooser/fd-loop 1777
+ testmkd ${VIRTDIR}/vmchooser/loopimg
# loop file for exchanging information between linux and vm guest
if modprobe ${MODPRV} loop; then
@@ -39,32 +44,32 @@ if [ -e $CONFFILE ]; then
fi
# mount a clean tempfs (bug in UnionFS prevents loopmount to work)
grep -qE "unionfs |aufs " /proc/mounts && \
- mount -n -o size=1500k -t tmpfs vm-loopimg /mnt/var/lib/virt/vmchooser/loopimg
+ mount -n -o size=1500k -t tmpfs vm-loopimg ${VIRTDIR}/vmchooser/loopimg
# create an empty floppy image of 1.4MByte size
- dd if=/dev/zero of=/mnt/var/lib/virt/vmchooser/loopimg/fd.img \
- count=2880 bs=512 2>/dev/null
- chmod 0777 /mnt/var/lib/virt/vmchooser/loopimg/fd.img
+ dd if=/dev/zero of=${VIRTDIR}/vmchooser/loopimg/fd.img count=2880 bs=512 \
+ 2>/dev/null
+ chmod 0777 ${VIRTDIR}/vmchooser/loopimg/fd.img
# use dos formatter copied into stage3
- mkdosfs /mnt/var/lib/virt/vmchooser/loopimg/fd.img >/dev/null 2>&1 #|| error
- mount -n -t msdos -o loop,umask=000 /mnt/var/lib/virt/vmchooser/loopimg/fd.img \
- /mnt/var/lib/virt/vmchooser/fd-loop
+ mkdosfs ${VIRTDIR}/vmchooser/loopimg/fd.img >/dev/null 2>&1 #|| error
+ mount -n -t msdos -o loop,umask=000 ${VIRTDIR}/vmchooser/loopimg/fd.img \
+ ${VIRTDIR}/vmchooser/fd-loop
# create run-virt.include header (and fill in information on removable
# devices if present
echo -e "# run-virt.include created by $0 during stage3 plugin setup" \
- >/mnt/etc/opt/openslx/run-virt.include
+ >${ETCDIR}/run-virt.include
waitfor /etc/hwinfo.cdrom
j=0
for i in $(cat /etc/hwinfo.cdrom); do
- echo "cdrom_$j=$i" >>/mnt/etc/opt/openslx/run-virt.include
+ echo "cdrom_$j=$i" >>${ETCDIR}/run-virt.include
j=$(expr $j + 1)
done
waitfor /etc/hwinfo.floppy
j=0
for i in $(cat /etc/hwinfo.floppy); do
- echo "floppy_$j=$i" >>/mnt/etc/opt/openslx/run-virt.include
+ echo "floppy_$j=$i" >>${ETCDIR}/run-virt.include
j=$(expr $j + 1)
done
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index ee9c8124..910cf128 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -18,6 +18,9 @@
# fied virtualization tool.
# -----------------------------------------------------------------------------
+# include default directories
+. /etc/opt/openslx/openslx.conf
+
# Sanity checks
###############################################################################
@@ -185,7 +188,7 @@ writelog ()
echo -e "$1"
# Log into file
- echo -e "$1" >>/tmp/run-virt.$$.log
+ echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-virt.${USER}.$$.log
}
# Setup the rest of the environment and run the virtualization tool just confi-
diff --git a/os-plugins/plugins/vmware/XX_vmware.sh b/os-plugins/plugins/vmware/XX_vmware.sh
index 5068c0f6..34bb8067 100644
--- a/os-plugins/plugins/vmware/XX_vmware.sh
+++ b/os-plugins/plugins/vmware/XX_vmware.sh
@@ -16,6 +16,12 @@
# write /etc/vmware/config (if a non-standard location of vmware basedir is
# to be configured), /etc/init.d/vmware
+# include default directories
+. /etc/openslx.conf
+
+ETCDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}
+VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}
+
# check if the configuration file is available
if [ -e /initramfs/plugin-conf/vmware.conf ]; then
@@ -154,7 +160,7 @@ $(ipcalc -m $vmip/$vmpx|sed s/.*=//) {" \
vmimgpath="$(uri_token ${vmware_imagesrc} path)"
fi
if [ -n "${vmimgserv}" -a -n ${vmimgpath} -a -n ${vmimgprot} ] ; then
- mnttarget=/mnt/var/lib/virt/vmware
+ mnttarget=${VIRTDIR}/vmware
# mount the vmware image source readonly (ro)
fsmount ${vmimgprot} ${vmimgserv} ${vmimgpath} ${mnttarget} ro
else
@@ -196,12 +202,11 @@ prefvmx.useRecommendedLockedMemSize = "TRUE"' | sed -e "s/^ *//" \
# copy version depending files - the vmchooser expects for every virtua-
# lization plugin a file named after it (here run-vmware.include)
- testmkd /mnt/etc/opt/openslx
cp /mnt/opt/openslx/plugin-repo/vmware/run-virt.include \
- /mnt/etc/opt/openslx/run-vmware.include
+ ${ETCDIR}/run-vmware.include
# copy version depending files
cp /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmplayer \
- /mnt/var/X11R6/bin/vmplayer
+ /mnt/var/X11R6/bin/vmplayer
if [ -e /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmware ]; then
cp /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmware \
/mnt/var/X11R6/bin/vmware
diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include
index 725ccb1c..a148442c 100644
--- a/os-plugins/plugins/vmware/files/run-virt.include
+++ b/os-plugins/plugins/vmware/files/run-virt.include
@@ -15,6 +15,8 @@
# - component for vmware/player of the vmchooser plugin run-virt.sh
# -----------------------------------------------------------------------------
+# include default directories
+. /etc/opt/openslx/openslx.conf
# include general configuration from vmchooser
. /etc/opt/openslx/run-virt.include
@@ -211,6 +213,8 @@ confdir=${redodir}
conffile="${confdir}/run-vmware.conf"
# users vmware config folder
vmhome="${HOME}/.vmware"
+# logfile
+logfile=${OPENSLX_DEFAULT_LOGDIR}/run-vmware.${USER}.$$.log
# get several version infos for vmware/player
. /etc/vmware/slxvmconfig
@@ -376,11 +380,6 @@ done
# logging and stdout
################################################################################
-logfile=${vmhome}/run-vmware.`hostname`.log
-
-# remove ols logs
-rm ${vmhome}/run-vmware.* >/dev/null 2>&1
-
# function to write to stdout and logfile
writelog ()
{
--
cgit v1.2.3-55-g7522