From 39466a0472f46c3e6c4c84a4751d435a3a191eb5 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 3 Nov 2009 19:07:51 +0000 Subject: more OpenSLX path optimizations git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3184 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/vmchooser/files/run-virt.sh | 38 ++++++++++++++-------- os-plugins/plugins/vmchooser/files/xmlfilter.sh | 4 +-- .../plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 2 -- os-plugins/plugins/vmware/files/run-virt.include | 32 +----------------- 4 files changed, 28 insertions(+), 48 deletions(-) (limited to 'os-plugins') diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh index 910cf128..4d210b88 100644 --- a/os-plugins/plugins/vmchooser/files/run-virt.sh +++ b/os-plugins/plugins/vmchooser/files/run-virt.sh @@ -20,6 +20,9 @@ # include default directories . /etc/opt/openslx/openslx.conf +PLUGINCONFDIR=${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser +# include general configuration from vmchooser +. ${PLUGINCONFDIR}/run-virt.include # Sanity checks ############################################################################### @@ -107,13 +110,25 @@ totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024) mac=$(/sbin/ifconfig eth0 | grep eth0 | sed -e "s/ //g" \ | awk -F ":" '{print $(NF-1)":"$NF}') -# Virtual fd/cd/dvd and drive devices, floppy b: for configuration file (xml) -floppya="FALSE" -floppyb="TRUE" -floppybname="/etc/vmware/loopimg/fd.img" -cdr_1="FALSE" -cdr_2="FALSE" -# IDE is expected default, test for the virtual disk image type should +# virtual fd/cd/dvd and drive devices, floppy b: for configuration +# if $floppy_0 from run-virt.include set then fdtest="TRUE" +fdtest= +fdtest=${floppy_0:+"TRUE"} +# if $fdtest not set floppy0="FALSE", else "TRUE" +floppy0=${fdtest:-"FALSE"} +floppy1="TRUE" +floppy1name="${PLUGINCONFDIR}/loopimg/fd.img" +# if $cdrom_0 from run-virt.include set then cdtest="TRUE" +cdtest= +cdtest=${cdrom_0:+"TRUE"} +# if $cdtest not set cdrom0="FALSE", else "TRUE" +cdrom0=${cdtest:-"FALSE"} +# if $cdrom_1 from run-virt.include set then cdtest="TRUE" +cdtest= +cdtest=${cdrom_1:+"TRUE"} +# if $cdtest not set cdrom1="FALSE", else "TRUE" +cdrom1=${cdtest:-"FALSE"} +# ide is expected default, test for the virtual disk image type should # be done while creating the runscripts ... ide="TRUE" scsi="FALSE" @@ -195,9 +210,6 @@ writelog () # gured ################################################################################ -# The PATH... -export PATH="${PATH}:/var/X11R6/bin:/usr/X11R6/bin" - # Logo for console cat < to be changed (vmchooser adapts the file content!?) echo "Please fix the config.xml generation" -cp ${xml} /var/lib/virt/vmchooser/fd-loop/config.xml +cp ${xml} ${PLUGINCONFDIR}/fd-loop/config.xml # Check if virtual machine container file exists filecheck # Get all virtual machine specific stuff from the respective include file -if [ -e /etc/opt/openslx/run-${virt_mach}.include ] ; then - . /etc/opt/openslx/run-${virt_mach}.include +if [ -e ${PLUGINCONFDIR}/run-${virt_mach}.include ] ; then + . PLUGINCONFDIR/run-${virt_mach}.include # start a windowmanager for player 2+ # otherwise expect problems with windows opening in background if [ "${virt_mach}" = "vmware" ]; then diff --git a/os-plugins/plugins/vmchooser/files/xmlfilter.sh b/os-plugins/plugins/vmchooser/files/xmlfilter.sh index 0a69ef7b..bc6ee2b8 100755 --- a/os-plugins/plugins/vmchooser/files/xmlfilter.sh +++ b/os-plugins/plugins/vmchooser/files/xmlfilter.sh @@ -26,8 +26,8 @@ # - filter for slxgrp (which comes from /etc/machine-setup) # -if [ -f /etc/opt/openslx/vmchooser-stage3.conf ]; then - . /etc/opt/openslx/vmchooser-stage3.conf +if [ -f ${PLUGINCONFDIR}/vmchooser.conf ]; then + . ${PLUGINCONFDIR}/vmchooser.conf fi for FILE in $1/*.xml; do diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index ca3dd35b..1a4540f0 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -295,11 +295,9 @@ sub installationPhase # stage3 copys our own wrapper script if (-e "/usr/bin/vmplayer" && ! -e "/usr/bin/vmplayer.slx-back") { rename("/usr/bin/vmplayer", "/usr/bin/vmplayer.slx-bak"); - linkFile("/var/X11R6/bin/vmplayer", "/usr/bin/vmplayer"); } # the same with vmware, if ws is installed if (-e "/usr/bin/vmware" && ! -e "/usr/bin/vmware.slx-bak") { - linkFile("/var/X11R6/bin/vmware", "/usr/bin/vmware"); rename("/usr/bin/vmware", "/usr/bin/vmware.slx-bak"); } } diff --git a/os-plugins/plugins/vmware/files/run-virt.include b/os-plugins/plugins/vmware/files/run-virt.include index e3da346e..f2d45b83 100644 --- a/os-plugins/plugins/vmware/files/run-virt.include +++ b/os-plugins/plugins/vmware/files/run-virt.include @@ -15,12 +15,6 @@ # - component for vmware/player of the vmchooser plugin run-virt.sh # ----------------------------------------------------------------------------- -# include default directories -. /etc/opt/openslx/openslx.conf -# include general configuration from vmchooser -. ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/run-virt.include - - # configuration writer functions ################################################################################ @@ -239,7 +233,7 @@ vmhome="${HOME}/.vmware" logfile=${OPENSLX_DEFAULT_LOGDIR}/run-vmware.${USER}.$$.log # get several version infos for vmware/player -. /etc/vmware/slxvmconfig +. ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmware/vmware.conf vmbuild=$buildversion vmversion=$version @@ -329,30 +323,6 @@ else memhost=$(expr ${totalmem} - ${mem} - ${mem}) fi -# virtual fd/cd/dvd and drive devices, floppy b: for configuration -# if $floppy_0 from run-virt.include set then fdtest="TRUE" -fdtest= -fdtest=${floppy_0:+"TRUE"} -# if $fdtest not set floppy0="FALSE", else "TRUE" -floppy0=${fdtest:-"FALSE"} -floppy1="TRUE" -floppy1name="${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser/loopimg/fd.img" -# if $cdrom_0 from run-virt.include set then cdtest="TRUE" -cdtest= -cdtest=${cdrom_0:+"TRUE"} -# if $cdtest not set cdrom0="FALSE", else "TRUE" -cdrom0=${cdtest:-"FALSE"} -# if $cdrom_1 from run-virt.include set then cdtest="TRUE" -cdtest= -cdtest=${cdrom_1:+"TRUE"} -# if $cdtest not set cdrom1="FALSE", else "TRUE" -cdrom1=${cdtest:-"FALSE"} -# ide is expected default, test for the virtual disk image type should -# be done while creating the runscripts ... -ide="TRUE" -scsi="FALSE" -hddrv="ide" - # check if ide/scsi and hwver of image # read only the first 30 lines to be shure imghead=$(head -30 ${diskfile}) -- cgit v1.2.3-55-g7522