From 572ed17f62cc2c595fa1134abd665873ed1fbff7 Mon Sep 17 00:00:00 2001 From: Volker Uhrig Date: Sat, 24 May 2008 15:02:14 +0000 Subject: * fixed problems with local installed version raised through vmpl2.0 integration. local should work now. at least it passed tests with suse 10.2 * integration with vmchooser is still missing on side of vmchooser plugin. You can use it with a proper formed xml file: /var/X11R6/bin/run/run-vmware.sh /path/to/xml/xmlfile.xml * vmpl2.0 isn't usable yet. * small bugfixes and nicer output of runvmware git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1793 95ad53e4-c205-0410-b2fa-d234c58c8868 --- .../plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 27 +++++---- os-plugins/plugins/vmware/XX_vmware.sh | 6 +- os-plugins/plugins/vmware/files/install-vmpl2.0.sh | 7 +-- .../plugins/vmware/files/runvmware-player-v1 | 68 +++++++++------------- .../plugins/vmware/files/runvmware-player-v2 | 68 +++++++++------------- 5 files changed, 78 insertions(+), 98 deletions(-) (limited to 'os-plugins') diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index ac2281e4..4f22a66a 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -261,17 +261,24 @@ sub _writeWrapperScript #!/bin/sh # written by OpenSLX-plugin 'vmware' in Stage1 # radically simplified version of the original script $file by VMware Inc. - #TODO: test it with local installed vmplayer!!! - export LD_LIBRARY_PATH=$vmpath/lib - export GTK_PIXBUF_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gdk-pixbuf.loaders - export GTK_IM_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gtk.immodules - export FONTCONFIG_PATH=$vmpath/libconf/etc/fonts - export PANGO_RC_FILE=$vmpath/libconf/etc/pango/pangorc - # possible needed... but what are they good for? - #export GTK_DATA_PREFIX= - #export GTK_EXE_PREFIX= - #export GTK_PATH= + End-of-Here + + # kinda ugly and we only need it for local. Preserves errors + if ($kind ne "local") { + $script .= unshiftHereDoc(<<" End-of-Here"); + export LD_LIBRARY_PATH=$vmpath/lib + export GTK_PIXBUF_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gdk-pixbuf.loaders + export GTK_IM_MODULE_FILE=$vmpath/libconf/etc/gtk-2.0/gtk.immodules + export FONTCONFIG_PATH=$vmpath/libconf/etc/fonts + export PANGO_RC_FILE=$vmpath/libconf/etc/pango/pangorc + # possible needed... but what are they good for? + #export GTK_DATA_PREFIX= + #export GTK_EXE_PREFIX= + #export GTK_PATH= + End-of-Here + } + $script .= unshiftHereDoc(<<" End-of-Here"); PREFIX=$vmpath # depends on the vmware location exec "\$PREFIX"'/lib/wrapper-gtk24.sh' \\ "\$PREFIX"'/lib' \\ diff --git a/os-plugins/plugins/vmware/XX_vmware.sh b/os-plugins/plugins/vmware/XX_vmware.sh index dd5913c5..d753f64a 100644 --- a/os-plugins/plugins/vmware/XX_vmware.sh +++ b/os-plugins/plugins/vmware/XX_vmware.sh @@ -101,7 +101,7 @@ $(ipcalc -m $vmnet1|sed s/.*=//) {" \ if [ -n "$vmware_vmnet8" ] ; then local vmip=${vmware_vmnet8%/*} local vmpx=${vmware_vmnet8#*/} - local vmsub=$(echo $vmip |sed 's,\(.*\)\..*,\1,') # x.x.x.x => x.x.x + uocal vmsub=$(echo $vmip |sed 's,\(.*\)\..*,\1,') # x.x.x.x => x.x.x"> echo -e "vmnet8=$vmip/$vmpx" >> /mnt/etc/vmware/slxvmconfig echo -e "\n# definition for virtual vmnet8 interface" \ >> /mnt/etc/vmware/dhcpd.conf @@ -250,8 +250,12 @@ $(ipcalc -m $vmip/$vmpx|sed s/.*=//) {" \ ## Copy version depending files cp /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/runvmware \ /mnt/var/X11R6/bin/run-vmware.sh + chmod 755 /mnt/var/X11R6/bin/run-vmware.sh if [ "${vmware_kind}" = "vmpl2.0" ]; then # TODO: setup up kernel files + # need something in it. see + # http://openslx.org/trac/de/openslx/wiki/WasEsNochZuDokumentierenGilt + echo "" fi [ $DEBUGLEVEL -gt 0 ] && echo " * done with 'vmware' os-plugin ..." diff --git a/os-plugins/plugins/vmware/files/install-vmpl2.0.sh b/os-plugins/plugins/vmware/files/install-vmpl2.0.sh index ac3a56f0..1814fb67 100644 --- a/os-plugins/plugins/vmware/files/install-vmpl2.0.sh +++ b/os-plugins/plugins/vmware/files/install-vmpl2.0.sh @@ -18,13 +18,10 @@ if [ "${REPLY}" == "YES" ]; then echo " * Downloading vmplayer now. This may take a while" cd /opt/openslx/plugin-repo/vmware/vmpl2.0 - #TODO: during development we have this file and dont need to download it - #wget -c http://download3.vmware.com/software/vmplayer/VMware-player-2.0.2-59824.i386.tar.gz + wget -c http://download3.vmware.com/software/vmplayer/VMware-player-2.0.2-59824.i386.tar.gz echo " * Unpacking vmplayer" - #tar xfz VMware-player-2.0.2-59824.i386.tar.gz - #TODO: just for developing purpose - tar xfz ../../VMware-player-2.0.2-59824.i386.tar.gz + tar xfz VMware-player-2.0.2-59824.i386.tar.gz echo " * copying files..." mkdir root diff --git a/os-plugins/plugins/vmware/files/runvmware-player-v1 b/os-plugins/plugins/vmware/files/runvmware-player-v1 index 44c61a7c..b333b51a 100644 --- a/os-plugins/plugins/vmware/files/runvmware-player-v1 +++ b/os-plugins/plugins/vmware/files/runvmware-player-v1 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash"> # # Description: Script for preparing VMware environment Diskless # X Stations and interactive session chooser (v4) @@ -18,7 +18,7 @@ ## Read needed variables from XML file ## ################################################################################ -$xml = $1 +xml=$1 # file name of the image imagename=$(grep -i " ${xml}.utf short_description=$(grep "short_description param=\"" ${xml} - sed -e "s%&.*;%; %g" | awk -F "\"" '{print $2}') + | sed -e "s%&.*;%; %g" | awk -F "\"" '{print $2}') # if ${short_description} not defined use ${image_name} short_description=${short_description:-"${image_name}"} displayname=${short_description} @@ -448,13 +448,13 @@ EOL writelog "##################################################\n" writelog "# File created by $0 (v.${version})\n# on $(date)\n" writelog "##################################################\n" -writelog "Starting...$(echo ${np} | sed 's/i.*-//g' \ - | tr [a-z] [A-Z])-mode\n" +writelog "Starting with $(echo ${np} | sed 's/i.*-//g')-mode ...\n" ## log disksetup -writelog "Directories: - \tTmpdir:\t\t${tmpdir}\n\tVMhome:\t\t${vmhome}\n\tTmpdir info:\ - \t$(mount | grep -i "/tmp ")\n" +writelog "Directories:" +writelog "\t\tTmpdir:\t\t${tmpdir}" +writelog "\tVMhome:\t\t${vmhome}" +writelog "\tTmpdir info:\t\t$(mount | grep -i "/tmp ")" ## configuring MAC address: first four bytes are fixed (00:50:56:0D) the ## last two bytes are taken from the local network adaptor @@ -478,8 +478,10 @@ mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4) # check memory range memtest=${totalmem}-128 if [ "${mem}" -lt "128" ] || [ "${mem}" -gt "${totalmem}" ]; then - writelog "\n\n\tYour memory is out of range: ${mem} MB. - \tMin. 128 MB for host and guest!\n\tTry --mem option.\n" + writelog "\n\n" + writelog "\tYour memory is out of range: ${mem} MB." + writelog "\tMin. 128 MB for host and guest!" + writelog "tTry --mem option." exit 1 fi @@ -495,11 +497,19 @@ fi ## Write all results to logfile -writelog "finished\nResults:\n\tMAC:\t\t00:50:56:0D:${mac}\n\tMem:\t\t - ${mem} MB \tMax. res.:\t${xres}x${yres}\n\t\tCD-ROM_1:\t${cdr_1}\n\t - CD-ROM_2:\t${cdr_2}\n" -writelog "finished\nResults:\n\tDiskfile:\t${diskfile}\n\tDisktype:\t${hddrv} - \tVMostype:\t${vmostype}\n\tDisplayname:\t${displayname}\n" +writelog "finished" +writelog "Results:" +writelog "\tMAC:\t\t00:50:56:0D:${mac}" +writelog "\tMem:\t\t${mem} MB" +writelog "\tMax. res.:\t${xres}x${yres}" +writelog "\tCD-ROM_1:\t${cdr_1}" +writelog "\tCD-ROM_2:\t${cdr_2}" +writelog "finished" +writelog "Results:" +writelog "\tDiskfile:\t${diskfile}" +writelog "\tDisktype:\t${hddrv}" +writelog "\tVMostype:\t${vmostype}" +writelog "\tDisplayname:\t${displayname}" # check if image exists, etc... filecheck @@ -521,38 +531,14 @@ preferencesheader runvmwareconfheader # poolconfiguration config.xml -#TODO: change default to global variable ${POOL} in the future -#comment out cause of scanner... we do it now by hand... just a hack -#TODO: cleaner source... -#sed -e "s/HOSTNAME/${hostname}/" \ -# -e "s/USER/${USER}/" /var/lib/vmware/templates/client-config.xml.default \ -# > /etc/vmware/fd-loop/config.xml -#echo "" > /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -# if we have a scanner, then copy scannerinformation to this xml -#sanelines="$(wc -l /etc/sane.d/net.conf|awk '{ print $1 };')" -#if [ -f /etc/sane.d/net.conf ] && [ "${sanelines}" -eq 1 ]; then -# echo "" \ -# >> /etc/vmware/fd-loop/config.xml -# echo "" >> /etc/vmware/fd-loop/config.xml -#fi -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo "" >> /etc/vmware/fd-loop/config.xml -# copy config file we get from vmchooser cp ${xml} /etc/vmware/fd-loop/config.xml - # 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: Take care if plugin-repo changes -#cp /var/lib/vmware/templates/nvram.5.0 ${tmpdir}/nvram -cp /opt/openslx/plugin-repo/nvram.5.0 ${tmpdir}/nvram +# TODO: optimize, currently kinda inefficient, too much copys +cp /opt/openslx/plugin-repo/vmware */nvram.5.0 ${tmpdir}/nvram # adjust volume writelog "Unmuting sound...\c" diff --git a/os-plugins/plugins/vmware/files/runvmware-player-v2 b/os-plugins/plugins/vmware/files/runvmware-player-v2 index 44c61a7c..b333b51a 100644 --- a/os-plugins/plugins/vmware/files/runvmware-player-v2 +++ b/os-plugins/plugins/vmware/files/runvmware-player-v2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash"> # # Description: Script for preparing VMware environment Diskless # X Stations and interactive session chooser (v4) @@ -18,7 +18,7 @@ ## Read needed variables from XML file ## ################################################################################ -$xml = $1 +xml=$1 # file name of the image imagename=$(grep -i " ${xml}.utf short_description=$(grep "short_description param=\"" ${xml} - sed -e "s%&.*;%; %g" | awk -F "\"" '{print $2}') + | sed -e "s%&.*;%; %g" | awk -F "\"" '{print $2}') # if ${short_description} not defined use ${image_name} short_description=${short_description:-"${image_name}"} displayname=${short_description} @@ -448,13 +448,13 @@ EOL writelog "##################################################\n" writelog "# File created by $0 (v.${version})\n# on $(date)\n" writelog "##################################################\n" -writelog "Starting...$(echo ${np} | sed 's/i.*-//g' \ - | tr [a-z] [A-Z])-mode\n" +writelog "Starting with $(echo ${np} | sed 's/i.*-//g')-mode ...\n" ## log disksetup -writelog "Directories: - \tTmpdir:\t\t${tmpdir}\n\tVMhome:\t\t${vmhome}\n\tTmpdir info:\ - \t$(mount | grep -i "/tmp ")\n" +writelog "Directories:" +writelog "\t\tTmpdir:\t\t${tmpdir}" +writelog "\tVMhome:\t\t${vmhome}" +writelog "\tTmpdir info:\t\t$(mount | grep -i "/tmp ")" ## configuring MAC address: first four bytes are fixed (00:50:56:0D) the ## last two bytes are taken from the local network adaptor @@ -478,8 +478,10 @@ mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4) # check memory range memtest=${totalmem}-128 if [ "${mem}" -lt "128" ] || [ "${mem}" -gt "${totalmem}" ]; then - writelog "\n\n\tYour memory is out of range: ${mem} MB. - \tMin. 128 MB for host and guest!\n\tTry --mem option.\n" + writelog "\n\n" + writelog "\tYour memory is out of range: ${mem} MB." + writelog "\tMin. 128 MB for host and guest!" + writelog "tTry --mem option." exit 1 fi @@ -495,11 +497,19 @@ fi ## Write all results to logfile -writelog "finished\nResults:\n\tMAC:\t\t00:50:56:0D:${mac}\n\tMem:\t\t - ${mem} MB \tMax. res.:\t${xres}x${yres}\n\t\tCD-ROM_1:\t${cdr_1}\n\t - CD-ROM_2:\t${cdr_2}\n" -writelog "finished\nResults:\n\tDiskfile:\t${diskfile}\n\tDisktype:\t${hddrv} - \tVMostype:\t${vmostype}\n\tDisplayname:\t${displayname}\n" +writelog "finished" +writelog "Results:" +writelog "\tMAC:\t\t00:50:56:0D:${mac}" +writelog "\tMem:\t\t${mem} MB" +writelog "\tMax. res.:\t${xres}x${yres}" +writelog "\tCD-ROM_1:\t${cdr_1}" +writelog "\tCD-ROM_2:\t${cdr_2}" +writelog "finished" +writelog "Results:" +writelog "\tDiskfile:\t${diskfile}" +writelog "\tDisktype:\t${hddrv}" +writelog "\tVMostype:\t${vmostype}" +writelog "\tDisplayname:\t${displayname}" # check if image exists, etc... filecheck @@ -521,38 +531,14 @@ preferencesheader runvmwareconfheader # poolconfiguration config.xml -#TODO: change default to global variable ${POOL} in the future -#comment out cause of scanner... we do it now by hand... just a hack -#TODO: cleaner source... -#sed -e "s/HOSTNAME/${hostname}/" \ -# -e "s/USER/${USER}/" /var/lib/vmware/templates/client-config.xml.default \ -# > /etc/vmware/fd-loop/config.xml -#echo "" > /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo " " >> /etc/vmware/fd-loop/config.xml -# if we have a scanner, then copy scannerinformation to this xml -#sanelines="$(wc -l /etc/sane.d/net.conf|awk '{ print $1 };')" -#if [ -f /etc/sane.d/net.conf ] && [ "${sanelines}" -eq 1 ]; then -# echo "" \ -# >> /etc/vmware/fd-loop/config.xml -# echo "" >> /etc/vmware/fd-loop/config.xml -#fi -#echo " " >> /etc/vmware/fd-loop/config.xml -#echo "" >> /etc/vmware/fd-loop/config.xml -# copy config file we get from vmchooser cp ${xml} /etc/vmware/fd-loop/config.xml - # 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: Take care if plugin-repo changes -#cp /var/lib/vmware/templates/nvram.5.0 ${tmpdir}/nvram -cp /opt/openslx/plugin-repo/nvram.5.0 ${tmpdir}/nvram +# TODO: optimize, currently kinda inefficient, too much copys +cp /opt/openslx/plugin-repo/vmware */nvram.5.0 ${tmpdir}/nvram # adjust volume writelog "Unmuting sound...\c" -- cgit v1.2.3-55-g7522