From 841a2d9b44e1e12332fe12bf25aea667f1758668 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 3 Nov 2009 17:08:39 +0000 Subject: BINPATH added to PATH support for vmplayer3 further simplifications through DEFAULTDIRS git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3180 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/vmware/XX_vmware.sh | 57 ++++++++++++++-------------------- 1 file changed, 24 insertions(+), 33 deletions(-) (limited to 'os-plugins/plugins/vmware/XX_vmware.sh') diff --git a/os-plugins/plugins/vmware/XX_vmware.sh b/os-plugins/plugins/vmware/XX_vmware.sh index 34bb8067..673eeb34 100644 --- a/os-plugins/plugins/vmware/XX_vmware.sh +++ b/os-plugins/plugins/vmware/XX_vmware.sh @@ -20,6 +20,9 @@ . /etc/openslx.conf ETCDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR} +PLUGINCONFDIR=${ETCDIR}/plugins/vmware +BINDIR=/mnt/${OPENSLX_DEFAULT_BINDIR} +PLUGINDIR=/mnt/${OPENSLX_DEFAULT_DIR}/plugin-repo/vmware VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR} # check if the configuration file is available @@ -38,17 +41,18 @@ if [ -e /initramfs/plugin-conf/vmware.conf ]; then testmkd /mnt/tmp/vmware 1777 testmkd /dev/shm/vmware 1777 + testmkd /mnt/var/run/vmware 1777 - # write the /etc/vmware/slxvmconfig file + # write the ${PLUGINCONFDIR}/vmware.conf file # check for the several variables and write the several files: - # dhcpd.conf for vmnet* interfaces - # nat.conf for the NAT configuration of vmnet8 - # TODO: vmnet-natd-8.mac not clear if really needed and which mac it + # dhcpd.conf for vmnet* interfaces + # nat.conf for the NAT configuration of vmnet8 + # TODO: vmnet-natd-8.mac not clear if really needed and which mac it # should contain (seems to be an average one) echo -e "# configuration file for vmware background services written in \ -stage3 setup" > /mnt/etc/vmware/slxvmconfig +stage3 setup" > ${PLUGINCONFDIR}/vmware.conf if [ "$vmware_bridge" = 1 ] ; then - echo "vmnet0=true" >> /mnt/etc/vmware/slxvmconfig + echo "vmnet0=true" >> ${PLUGINCONFDIR}/vmware.conf fi # write the common dhcpd.conf header for vmnet1,8 if [ -n "$vmware_vmnet1" -o -n "$vmware_vmnet8" ] ; then @@ -76,8 +80,8 @@ stage3 setup" > /mnt/etc/vmware/slxvmconfig local vmip=${vmnet1%/*} # x.x.x.x/yy => 'x.x.x.x'"> local vmpx=${vmnet1#*/} # x.x.x.x/yy => 'yy' local vmsub=$(echo $vmip |sed 's,\(.*\)\..*,\1,') # x.x.x.x => x.x.x - echo -e "vmnet1=$vmnet1" >> /mnt/etc/vmware/slxvmconfig - [ -n "$vmnat" ] && echo "vmnet1nat=true" >> /mnt/etc/vmware/slxvmconfig + echo -e "vmnet1=$vmnet1" >> ${PLUGINCONFDIR}/vmware.conf + [ -n "$vmnat" ] && echo "vmnet1nat=true" >> ${PLUGINCONFDIR}/vmware.conf echo -e "\n# definition for virtual vmnet1 interface" \ >> /mnt/etc/vmware/dhcpd-vmnet1.conf echo -e "subnet $(ipcalc -n $vmnet1|sed s/.*=//) netmask \ @@ -105,7 +109,7 @@ $(ipcalc -m $vmnet1|sed s/.*=//) {" \ # vmnet is user for config files nat.conf/dhcp local vmip="${vmsub}.1" local vmnet="${vmsub}.2" - echo -e "vmnet8=$vmip/$vmpx" >> /mnt/etc/vmware/slxvmconfig + echo -e "vmnet8=$vmip/$vmpx" >>${PLUGINCONFDIR}/vmware.conf echo -e "\n# definition for virtual vmnet8 interface" \ >> /mnt/etc/vmware/dhcpd-vmnet8.conf echo -e "subnet $(ipcalc -n $vmip/$vmpx|sed s/.*=//) netmask \ @@ -141,14 +145,13 @@ $(ipcalc -m $vmip/$vmpx|sed s/.*=//) {" \ mknod /dev/vmnet8 c 119 8 fi # copy the runlevel script to the proper place and activate it - sed "s/eth0/$nwif/g" \ - /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmware.init \ + sed "s/eth0/$nwif/g" ${PLUGINDIR}/${vmware_kind}/vmware.init \ > /mnt/etc/init.d/vmware-env \ || echo " * Error copying runlevel script. Shouldn't happen." chmod a+x /mnt/etc/init.d/vmware-env rllinker "vmware-env" 20 2 - ############################################################################# + ############################################################################ # vmware stuff first part: two scenarios # * VM images in /usr/share/vmware - then simply link # * VM images via additional mount (mount source NFS, NBD, ...) @@ -168,15 +171,8 @@ $(ipcalc -m $vmip/$vmpx|sed s/.*=//) {" \ ${vmware_imagesrc}." nonfatal fi - ############################################################################# + ############################################################################ # vmware stuff second part: setting up the environment - - # create needed directories and files - for i in /var/run/vmware /etc/vmware/loopimg \ - /etc/vmware/fd-loop /var/X11R6/bin; do - testmkd /mnt/$i - done - # make vmware dhcpd more silent touch /mnt/var/run/vmware/dhcpd-vmnet1.leases \ /mnt/var/run/vmware/dhcpd-vmnet8.leases @@ -188,7 +184,6 @@ ${vmware_imagesrc}." nonfatal done chmod 0700 /dev/vmnet* - chmod 1777 /mnt/var/run/vmware echo -e "usbfs\t\t/proc/bus/usb\tusbfs\t\tauto\t\t 0 0" >> /mnt/etc/fstab # needed for VMware 5.5.4 and versions below @@ -202,25 +197,21 @@ prefvmx.useRecommendedLockedMemSize = "TRUE"' | sed -e "s/^ *//" \ # copy version depending files - the vmchooser expects for every virtua- # lization plugin a file named after it (here run-vmware.include) - cp /mnt/opt/openslx/plugin-repo/vmware/run-virt.include \ - ${ETCDIR}/run-vmware.include + cp ${PLUGINDIR}/run-virt.include \ + ${PLUGINCONFDIR}/../vmchooser/run-vmware.include # copy version depending files - cp /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmplayer \ - /mnt/var/X11R6/bin/vmplayer - if [ -e /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmware ]; then - cp /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/vmware \ - /mnt/var/X11R6/bin/vmware + cp ${PLUGINDIR}/${vmware_kind}/vmplayer ${BINDIR}/vmplayer + if [ -e ${PLUGINDIR}/${vmware_kind}/vmware ]; then + cp ${PLUGINDIR}/${vmware_kind}/vmware ${BINDIR}/vmware fi # affects only kernel and config depending configuration of not # local installed versions - cat /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/config \ - >>/mnt/etc/vmware/config + cat ${PLUGINDIR}/${vmware_kind}/config >>/mnt/etc/vmware/config chmod 644 /mnt/etc/vmware/config echo "# stage1 variables produced during plugin install" \ - >>/mnt/etc/vmware/slxvmconfig - cat /mnt/opt/openslx/plugin-repo/vmware/${vmware_kind}/slxvmconfig \ - >>/mnt/etc/vmware/slxvmconfig + >>${PLUGINCONFDIR}/vmware.conf + cat ${PLUGINDIR}/${vmware_kind}/vmware.conf >>${PLUGINCONFDIR}/vmware.conf # if /tmp resides on nfs: create an empty container file for vmware *.vmem # it does not like to live on NFS exports (still needed??) -- cgit v1.2.3-55-g7522