summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmware/files/run-virt.include
diff options
context:
space:
mode:
authorMichael Janczyk2009-03-20 19:52:12 +0100
committerMichael Janczyk2009-03-20 19:52:12 +0100
commitecf7e272a02edf9875f5c7d678e81d907799edb4 (patch)
tree28d32b576b6d94f4684e0d0060f9e71fb6f9fbf0 /os-plugins/plugins/vmware/files/run-virt.include
parentvmchooser: if you start from a dm you do not want to hear that a dm is alread... (diff)
downloadcore-ecf7e272a02edf9875f5c7d678e81d907799edb4.tar.gz
core-ecf7e272a02edf9875f5c7d678e81d907799edb4.tar.xz
core-ecf7e272a02edf9875f5c7d678e81d907799edb4.zip
rearranged:
logs at end / all vars at one place... new log infos / logs written to HOME/.vmware/...log ah yes logs moved because /tmp is cleared every restart of xdm added scsi support again and 3D support for player 2.5 git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2754 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware/files/run-virt.include')
-rw-r--r--os-plugins/plugins/vmware/files/run-virt.include139
1 files changed, 84 insertions, 55 deletions
diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include
index f74a4b63..9bbb6b47 100644
--- a/os-plugins/plugins/vmware/files/run-virt.include
+++ b/os-plugins/plugins/vmware/files/run-virt.include
@@ -18,6 +18,7 @@
# include general configuration from vmchooser
. /etc/opt/openslx/run-virt.include
+
# configuration writer functions
################################################################################
@@ -41,12 +42,13 @@ sharedFolder.option = \"alwaysEnabled\"" >>${conffile}
;;
2.5|6.5)
shared_folder="TRUE"
+ cap3d="TRUE"
echo "
# version specific stuff
config.version = \"8\"
-ehci.present= \"TRUE\"
+ehci.present = \"TRUE\"
sharedFolder.option = \"alwaysEnabled\"
-mks.enable3d = \"FALSE\"" >>${conffile}
+mks.enable3d = \"${enable3d}\"" >>${conffile}
;;
esac
@@ -79,7 +81,7 @@ ide1:1.deviceType = \"cdrom-raw\"
scsi0.present = \"${scsi}\"
scsi0:0.present = \"${scsi}\"
scsi0:0.fileName = \"${diskfile}\"
-scsi0.virtualDev = \"lsilogic\" #\"${hddrv}\"
+scsi0.virtualDev = \"${hddrv}\"
scsi0:0.mode = \"independent-nonpersistent\"
# floppies
@@ -191,6 +193,7 @@ pref.eula.1.appName = \"VMware Workstation\"
pref.eula.1.buildNumber = \"${vmbuild}\"" >${vmhome}/preferences
}
+
# declaration of default variables
################################################################################
@@ -203,6 +206,35 @@ conffile="${confdir}/run-vmware.conf"
# users vmware config folder
vmhome="${HOME}/.vmware"
+# get several version infos for vmware/player
+. /etc/vmware/slxvmconfig
+vmbuild=$buildversion
+vmversion=$version
+
+# VMware start options
+#-X = fullscreen
+vmopt="-X"
+
+# set the variables appropriately
+VIRTCMD=vmplayer
+VIRTCMDOPTS="${vmopt} ${conffile}"
+
+
+# hardware checks
+################################################################################
+
+# enable 3D
+enable3d=$(grep -i "<enable3d param=.*" ${xml} 2>/dev/null | \
+ awk -F '"' {'print $2'})
+case "$enable3d" in
+ true|TRUE|yes|YES)
+ enable3d="TRUE"
+ ;;
+ *)
+ enable3d="FALSE"
+ ;;
+esac
+
# serial port defined (e.g. "ttyS0" or "autodetect")
serial=$(grep -i "<serial port=\"" ${xml} | awk -F "\"" '{ print $2 }')
case "$serial" in
@@ -246,14 +278,6 @@ else
memhost=$(expr ${totalmem} - ${mem} - ${mem})
fi
-# check memory range
-if [ "${mem}" -lt "256" ] || [ "${memhost}" -lt "256" ]; then
- writelog "\n\n"
- writelog "\tYour memory is out of range: ${mem} MB."
- writelog "\tMin. 256 MB for host and guest!"
- exit 1
-fi
-
# virtual fd/cd/dvd and drive devices, floppy b: for configuration
# if $floppy_0 from run-virt.include set then fdtest="TRUE"
fdtest=
@@ -278,15 +302,6 @@ ide="TRUE"
scsi="FALSE"
hddrv="ide"
-# get several version infos for vmware/player
-. /etc/vmware/slxvmconfig
-vmbuild=$buildversion
-vmversion=$version
-
-# VMware start options
-#-X = fullscreen
-vmopt="-X"
-
# check if ide/scsi and hwver of image
# read only the first 30 lines to be shure
imghead=$(head -30 ${diskfile})
@@ -305,7 +320,38 @@ case "${hddrv}" in
;;
esac
-### log function ###############################################################
+
+# write configuration files
+################################################################################
+
+# create vmware directories
+mkdir -p ${redodir} >/dev/null 2>&1
+mkdir -p ${confdir} >/dev/null 2>&1
+mkdir -p ${vmhome} >/dev/null 2>&1
+
+# create preferences
+preferencesheader
+
+# create VMware startup file
+runvmwareconfheader
+
+# sync is needed to ensure that data is really written to virtual disk
+sync
+
+# own nvram. We need it for floppy drive b, default nvram has just drive a
+# TODO: optimize, currently kinda inefficient, too much copys, but we
+# don't know which one is installed...
+for i in /opt/openslx/plugin-repo/vmware/*; do
+ cp ${i}/nvram ${confdir}/nvram 2>/dev/null
+done
+
+
+# logging and stdout
+################################################################################
+
+# remove ols logs
+rm ${vmhome}/run-vmware.* >/dev/null 2>&1
+
# function to write to stdout and logfile
writelog ()
{
@@ -313,21 +359,20 @@ writelog ()
echo -e "$1"
# log in file
- echo -e "$1" >>${redodir}/run-vmware.${USER}.log
+ echo -e "$1" >>${vmhome}/run-vmware.$$.log
}
-# Delete the LOCK file. its insecure, but ...
-rm -f ${confdir}/*LOCK >/dev/null 2>&1
-
-# create vmware directories
-mkdir -p ${redodir} >/dev/null 2>&1
-mkdir -p ${confdir} >/dev/null 2>&1
-mkdir -p ${vmhome} >/dev/null 2>&1
-
# log script information
-writelog "# File created by $0 (v.${version})\n# on $(date)\n"
+writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n"
writelog "Starting with non-persistent mode ...\n"
+# check memory range
+if [ "${mem}" -lt "256" ] || [ "${memhost}" -lt "256" ]; then
+ writelog "\tMemory out of range: ${mem} MB (guest) / ${memhost} MB (host)!"
+ writelog "\tMin. 256 MB for host and guest!"
+ exit 1
+fi
+
# Write all results to logfile
# log disksetup
writelog "Directories:"
@@ -335,6 +380,7 @@ writelog "\tConfdir:\t${confdir}"
writelog "\tConffile:\t${conffile}"
writelog "\tRedodir:\t${redodir}"
writelog "\tVMhome:\t\t${vmhome}"
+writelog "\tLogfile:\t${vmhome}/run-vmware.$$.log"
writelog "\t/tmp info: \
$(grep "/tmp " /proc/mounts) $(df -h | grep " /tmp$" | awk '{print $2}')"
# HW setup
@@ -350,29 +396,12 @@ writelog "\tFloppy_A:\t${floppy0}"
writelog "Diskimage:"
writelog "\tDiskfile:\t${diskfile}"
writelog "\tDisktype:\t${hddrv}"
+writelog "\tHWVersion:\t${hwver}"
writelog "\tVMostype:\t${vmostype}"
-writelog "\tDisplayname:\t${displayname}"
-
-# check if image exists, etc...
-#filecheck
-
-### write configuration files ##################################################
-# create preferences
-preferencesheader
-
-# create VMware startup file
-runvmwareconfheader
-
-# sync is needed to ensure that data is really written to virtual disk
-sync
-
-# own nvram. We need it for floppy drive b, default nvram has just drive a
-# TODO: optimize, currently kinda inefficient, too much copys, but we
-# don't know which one is installed...
-for i in /opt/openslx/plugin-repo/vmware/*; do
- cp ${i}/nvram ${confdir}/nvram 2>/dev/null
-done
+if [ "${cap3d}" = "TRUE" -a "${enable3d}" = "TRUE" ]; then
+ writelog "\t3D Graphics:\tenabled"
+else
+ writelog "\t3D Graphics:\tdisabled"
+fi
+writelog "\tDisplayname:\t${displayname}\n"
-# set the variables appropriately
-VIRTCMD=vmplayer
-VIRTCMDOPTS="${vmopt} ${conffile}"