summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-12-22 23:28:39 +0100
committerDirk von Suchodoletz2008-12-22 23:28:39 +0100
commit0a5c88d206128069f2bdf2f6d4ff6a4ff3976f87 (patch)
tree61d2560c25ecbc9762cddce22e72d16327e737ba /os-plugins
parentAdding cleanup after X logoff (via Xreset). This removes all user files (diff)
downloadcore-0a5c88d206128069f2bdf2f6d4ff6a4ff3976f87.tar.gz
core-0a5c88d206128069f2bdf2f6d4ff6a4ff3976f87.tar.xz
core-0a5c88d206128069f2bdf2f6d4ff6a4ff3976f87.zip
Adding the feature to add serial ports to a VMware/Player configuration
via XML configuration file. Evaluating the parameter "<serial port="">, allowing values like "ttyS0" or "autodetect" ... If a client is running completely diskless (/tmp on RamFS) the amount of memory assigned to a guest is set to 30% (because of the redicilous vmware vmem file). git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2449 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm2
-rw-r--r--os-plugins/plugins/vmware/files/runvmware-player-v2551
2 files changed, 33 insertions, 20 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
index 099c3e72..e2394f27 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
@@ -168,6 +168,8 @@ sub fillRunlevelScript
echo -n "Starting vmware background services ..."
# load the configuration file
. /etc/vmware/slxvmconfig
+ # hack to access the first serial port
+ chmod a+rw /dev/ttyS0
load_modules
setup_vmnet0
setup_vmnet1
diff --git a/os-plugins/plugins/vmware/files/runvmware-player-v25 b/os-plugins/plugins/vmware/files/runvmware-player-v25
index 6f4021f3..51349d0b 100644
--- a/os-plugins/plugins/vmware/files/runvmware-player-v25
+++ b/os-plugins/plugins/vmware/files/runvmware-player-v25
@@ -37,7 +37,22 @@ vmostype=$(grep -i "<os param=\"" ${xml} | awk -F "\"" '{ print $2 }')
# Definition of the client system
network_kind=$(grep -i "<network param=\"" ${xml} | awk -F "\"" '{ print $2 }')
-
+# serial port defined (e.g. "ttyS0" or "autodetect")
+serial=$(grep -i "<serial port=\"" ${xml} | awk -F "\"" '{ print $2 }')
+case "$serial" in
+ tty*)
+ serialdev="serial0.filename = \"/dev/${serial}\""
+ serial="TRUE"
+ ;;
+ autodetect)
+ serialdev="serial0.autodetect = \"TRUE\""
+ serial="TRUE"
+ ;;
+ *)
+ serialdev=""
+ serial="FALSE"
+ ;;
+esac
################################################################################
##
@@ -149,16 +164,7 @@ filecheck=
diskfile="${vmdir}/${imagename}"
#TODO: check for a faster way, perhaps we should put this into XML
-# oh - yeah!! Why not do it on the SERVER??? It has enough power and has
-# to do it once and not during every start on a client :)
-#grepping every file could take much (network) resources. And if its
-#an IDE Image, but has somewhere the string ddb.adapterType stuff can
-#become screwed
-# NOOOOOOO - We do not check on every start on every client!!!
-# NOOOOOOOOO the string ddb.adapterType we are looking for is part of the
-# header of EVERY vmdk file (except *-flat.vmdk files) and is located in
-# the first ~30 lines - so it's not that big deal grepping for it :)
-# check if IDE or SCSI
+# the grepping under some circumstances lets wait the user for ages ...
if [ $(echo ${imagename} | grep -cv "\-flat.vmdk") ]; then
hddrv=$(grep -m 1 -ia "ddb.adapterType" ${diskfile} | awk -F "\"" '{print $2}')
if [ "${hddrv}" = "ide" ]; then
@@ -347,8 +353,11 @@ hgfs.mapRootShare = \"TRUE\"
isolation.tools.dnd.disable = \"FALSE\"
isolation.tools.copy.enable = \"TRUE\"
isolation.tools.paste.enabled = \"TRUE\"
-gui.restricted = \"TRUE\"" \
- >${conffile}
+gui.restricted = \"TRUE\"
+
+# serial port
+serial0.present = \"${serial}\"
+${serialdev}" >${conffile}
# set the appropriate permissions for the vmware config file
chmod u+rwx ${conffile} >/dev/null 2>&1
@@ -411,10 +420,6 @@ writelog ()
}
-
-
-
-
### MAIN SECTION ###############################################################
##
## Main part of the script...
@@ -472,6 +477,9 @@ if [ "${totalmem}" -ge "2500" ]; then
confdir=/dev/shm/vmware/$USER
conffile=${confdir}/run-vmware.conf
mkdir -p /dev/shm/vmware/$USER
+# if there is no scratch space on disk you have to waste your mem
+elif grep -qe "ramfs /tmp " /proc/mounts ; then
+ permem=30
fi
# calculate memory for vmplayer
@@ -572,9 +580,12 @@ if [ $(which vmplayer 2>/dev/null) ]; then writelog "Starting ..."
writelog "... vmplayer ${vmopt} ${conffile}\n"
# start fvwm for player 2+
# problems with windows opening in background
- which fvwm2 >/dev/null 2>&1 && \
- ( echo "EdgeScroll 0 0" > ${redodir}/fvwm
- fvwm2 -f ${redodir}/fvwm >/dev/null 2>&1 & )
+ if which fvwm2 >/dev/null 2>&1 ; then
+ ( echo "EdgeScroll 0 0" > ${redodir}/fvwm
+ fvwm2 -f ${redodir}/fvwm >/dev/null 2>&1 & )
+ else
+ kwin &
+ fi
vmplayer ${vmopt} ${conffile} >/dev/null 2>&1
else
writelog "No VMware/VMPlayer found!\n"