From ecf7e272a02edf9875f5c7d678e81d907799edb4 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Fri, 20 Mar 2009 18:52:12 +0000 Subject: 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 --- os-plugins/plugins/vmware/files/run-virt.include | 139 ++++++++++++++--------- 1 file changed, 84 insertions(+), 55 deletions(-) (limited to 'os-plugins/plugins/vmware/files/run-virt.include') 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 "/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 "/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}" -- cgit v1.2.3-55-g7522