diff options
author | Volker Uhrig | 2008-10-08 19:39:06 +0200 |
---|---|---|
committer | Volker Uhrig | 2008-10-08 19:39:06 +0200 |
commit | 8f968388b6ab1ea7c3b9813c1103e61425c330c6 (patch) | |
tree | 5fae3f2c0d1da4545b84a7f4de2cff4d24190821 /os-plugins/plugins/vmware | |
parent | xserver: * suse-11.0 nvidia install script removes rpms before downloading. (diff) | |
download | core-8f968388b6ab1ea7c3b9813c1103e61425c330c6.tar.gz core-8f968388b6ab1ea7c3b9813c1103e61425c330c6.tar.xz core-8f968388b6ab1ea7c3b9813c1103e61425c330c6.zip |
* preparation for vmpl2.5 installation
* extracting works... if there's no real reason to touch their
installer: don't use it at all. And don't try to understand
the reason for their way...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2268 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware')
-rw-r--r-- | os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm | 76 | ||||
-rw-r--r-- | os-plugins/plugins/vmware/files/README | 4 | ||||
-rw-r--r-- | os-plugins/plugins/vmware/files/install-vmpl.sh | 299 |
3 files changed, 285 insertions, 94 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm index ce2d5fe2..6daf8b5a 100644 --- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm +++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm @@ -168,6 +168,17 @@ sub getAttrInfo content_descr => '1 means active - 0 means inactive', default => '0', }, + 'vmware::vmpl2.5' => { + applies_to_vendor_os => 1, + applies_to_system => 0, + applies_to_clients => 0, + description => unshiftHereDoc(<<' End-of-Here'), + Install and configure vmplayer v2 + End-of-Here + content_regex => qr{^(1|0)$}, + content_descr => '1 means active - 0 means inactive', + default => '0', + }, 'vmware::vmpl1.0' => { applies_to_vendor_os => 1, applies_to_system => 0, @@ -213,9 +224,10 @@ sub preInstallationPhase() my $pkgpath = $self->{attrs}->{'vmware::pkgpath'}; my $vmpl10 = $self->{attrs}->{'vmware::vmpl1.0'}; my $vmpl20 = $self->{attrs}->{'vmware::vmpl2.0'}; + my $vmpl25 = $self->{attrs}->{'vmware::vmpl2.5'}; my $local = $self->{attrs}->{'vmware::local'}; - if ($local == 0 && $vmpl10 == 0 && $vmpl20 == 0) { + if ($local == 0 && $vmpl10 == 0 && $vmpl20 == 0 && $vmpl20 == 0) { print "\n\n * At least one kind needs to get installed/activated:\n"; print " vmware::local=1 or\n"; print " vmware::vmpl1.0=1 or\n"; @@ -224,14 +236,14 @@ sub preInstallationPhase() exit 1; } - if (! -d $pkgpath && ($vmpl10 == 1 || $vmpl20 == 1)) { + if (! -d $pkgpath && ($vmpl10 == 1 || $vmpl20 == 1 || $vmpl25 == 1)) { print "\n\n * vmware::pkgpath: no such directory!\n"; print " * vmware plugin was not installed!\n\n"; exit 1; } # test just for the case we only set up local vmware - if (-d $pkgpath && ($vmpl10 == 1 || $vmpl20 == 1)) { + if (-d $pkgpath && ($vmpl10 == 1 || $vmpl20 == 1 || $vmpl25 == 1)) { # todo: ask oliver about a similiar function # like copyFile() just for directorys # or fix the manual after checked the source of @@ -267,6 +279,9 @@ sub installationPhase if ($self->{attrs}->{'vmware::vmpl1.0'} == 1) { $self->_vmpl1Installation(); } + if ($self->{attrs}->{'vmware::vmpl2.5'} == 1) { + $self->_vmpl25Installation(); + } ## prepration for our faster wrapper script # rename the default vmplayer script and create a link. @@ -336,10 +351,17 @@ sub checkStage3AttrValues if ($vm_kind eq 'vmpl2.0' && ! -d "/opt/openslx/plugin-repo/vmware/vmpl2.0/vmroot") { push @problems, _tr( - "No OpenSLX installation of VMware Player 2 found or installation failed. Using it as virtual machine wouldn't work!" + "No OpenSLX installation of VMware Player 2.0 found or installation failed. Using it as virtual machine wouldn't work!" ); } + if ($vm_kind eq 'vmpl2.5' && + ! -d "/opt/openslx/plugin-repo/vmware/vmpl2.5/vmroot") { + push @problems, _tr( + "No OpenSLX installation of VMware Player 2.5 found or installation failed. Using it as virtual machine wouldn't work!" + ); + } + if ($vm_kind eq 'vmpl1.0' && ! -d "/opt/openslx/plugin-repo/vmware/vmpl1.0/vmroot") { push @problems, _tr( @@ -585,6 +607,52 @@ sub _vmpl2Installation { } +sub _vmpl25Installation { + my $self = shift; + + my $kind = "vmpl2.5"; + my $vmpath = "/opt/openslx/plugin-repo/vmware/$kind/vmroot/lib/vmware"; + my $vmbin = "/opt/openslx/plugin-repo/vmware/$kind/vmroot/bin"; + my $vmversion = "TODO_we_need_it_for_enhanced_runvmware_config_in_stage?"; + my $vmbuildversion = "TODO_we_need_it_for_enhanced_runvmware_config_in_stage1"; + + my $pluginFilesPath + = "$self->{'openslxBasePath'}/lib/plugins/$self->{'name'}/files"; + my $installationPath = "$self->{'pluginRepositoryPath'}/$kind"; + + mkpath($installationPath); + + ## + ## Copy needed files + + # copy 'normal' needed files + my @files = qw( nvram.5.0 install-vmpl.sh ); + foreach my $file (@files) { + copyFile("$pluginFilesPath/$file", "$installationPath"); + } + + # copy on depending runvmware file + copyFile("$pluginFilesPath/runvmware-player-v25", "$installationPath", "runvmware"); + + ## + ## Install the binarys from given pkgpath + system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/$kind/install-vmpl.sh $kind"); + + ## + ## Create runlevel script + my $runlevelScript = "$self->{'pluginRepositoryPath'}/$kind/vmware.init"; + $self->_writeRunlevelScript($vmbin, $runlevelScript, $kind); + + ## + ## Create wrapperscripts + $self->_writeWrapperScript("$vmpath", "$kind", "player"); + + ## + ## Creating needed config /etc/vmware/config + $self->_writeVmwareConfig("$kind", "$vmpath"); + +} + sub _vmpl1Installation { my $self = shift; diff --git a/os-plugins/plugins/vmware/files/README b/os-plugins/plugins/vmware/files/README index 44c883ac..68e55c3f 100644 --- a/os-plugins/plugins/vmware/files/README +++ b/os-plugins/plugins/vmware/files/README @@ -18,8 +18,8 @@ Files This example files shows which VMware features are configureable for each virtual machine. Should be moved sooner or later to the vm-chooser plugin -- install-vmpl2.0.sh - Install script, which will download and install vmplayer v2.0 if choosen +- install-vmpl.sh + Install script, can handle different vmware version installations - mkdosfs linked against uclib for creating dos-formatted floppies for data transport between host and guest (needed in stage3) diff --git a/os-plugins/plugins/vmware/files/install-vmpl.sh b/os-plugins/plugins/vmware/files/install-vmpl.sh index 1d4c8419..91349d1a 100644 --- a/os-plugins/plugins/vmware/files/install-vmpl.sh +++ b/os-plugins/plugins/vmware/files/install-vmpl.sh @@ -22,6 +22,9 @@ if [ "$1" = "vmpl1.0" ]; then elif [ "$1" = "vmpl2.0" ]; then vmplversion="vmpl2.0" tgzfile=$(ls packages/VMware-player-2.0.*|sort|tail -n 1) +elif [ "$1" = "vmpl2.5" ]; then + vmplversion="vmpl2.5" + tgzfile=$(ls packages/VMware-Player-2.5.*.bundle|sort|tail -n 1) else echo "Attribute of install-vmpl.sh isn't valid!" echo "This shouldn't happen! Fix vmware.pm!" @@ -30,98 +33,218 @@ fi ### Main installation part -cd ${vmplversion} - -echo " * Unpacking vmplayer ${vmplversion}" -tar xfz ../${tgzfile} -# TODO: errorcheck if tgz wasnt downloaded properly. -# ask on mailinglist if theres a way how to handle it -# in preInstallation() "exit 1" is enough. Perhaps it will work -# here, too. Try first, and then document it in the wiki - -# reduce some errors -echo " * deleting old files if available" -rm -rf vmroot - -echo " * copying files..." -mkdir vmroot -mkdir -p vmroot/modules -mkdir -p vmroot/lib -mv vmware-player-distrib/lib vmroot/lib/vmware -mv vmware-player-distrib/bin vmroot/ -if [ "${vmplversion}" != "vmpl1.0" ]; then - mv vmware-player-distrib/sbin vmroot/ -fi -mv vmware-player-distrib/doc vmroot/ -rm -rf vmware-player-distrib/ -rm -rf vmroot/lib/vmware/modules/binary - -echo " * fixing file permission" -chmod 04755 vmroot/lib/vmware/bin/vmware-vmx - -# I don't want to understand what vmware is doing, but without this -# step we need to have LD_LIBRARY_PATH with 53 entrys. welcome to -# library hell -echo " * fixing librarys..." -cd vmroot/lib/vmware/lib -mkdir test -mv lib* test -mv test/lib*/* . -rm -rf test -cd ../../../.. - -echo " * fixing gdk and pango config files" -sed -i \ - "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ - vmroot/lib/vmware/libconf/etc/gtk-2.0/gdk-pixbuf.loaders -sed -i \ - "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ - vmroot/lib/vmware/libconf/etc/gtk-2.0/gtk.immodules -sed -i \ - "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ - vmroot/lib/vmware/libconf/etc/pango/pango.modules -sed -i \ - "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ - vmroot/lib/vmware/libconf/etc/pango/pangorc -sed -i \ - "s,/etc/pango/pango/,/etc/pango/," \ - vmroot/lib/vmware/libconf/etc/pango/pangorc - -echo " * creating /etc/vmware" -mkdir -p /etc/vmware - -echo " * unpacking kernel modules" -cd vmroot/lib/vmware/modules/source -tar xf vmnet.tar -tar xf vmmon.tar -if [ "${vmplversion}" != "vmpl1.0" ]; then - tar xf vmblock.tar -fi +if [ "${vmplversion}" != "vmpl2.5" ]; then + # tgz Installation of vmpl1.0 and vmpl2.0 + cd ${vmplversion} + + echo " * Unpacking vmplayer ${vmplversion}" + tar xfz ../${tgzfile} + # TODO: errorcheck if tgz wasnt downloaded properly. + # ask on mailinglist if theres a way how to handle it + # in preInstallation() "exit 1" is enough. Perhaps it will work + # here, too. Try first, and then document it in the wiki + + # reduce some errors + echo " * deleting old files if available" + rm -rf vmroot + + echo " * copying files..." + mkdir vmroot + mkdir -p vmroot/modules + mkdir -p vmroot/lib + mv vmware-player-distrib/lib vmroot/lib/vmware + mv vmware-player-distrib/bin vmroot/ + if [ "${vmplversion}" != "vmpl1.0" ]; then + mv vmware-player-distrib/sbin vmroot/ + fi + mv vmware-player-distrib/doc vmroot/ + rm -rf vmware-player-distrib/ + rm -rf vmroot/lib/vmware/modules/binary + + echo " * fixing file permission" + chmod 04755 vmroot/lib/vmware/bin/vmware-vmx + + # I don't want to understand what vmware is doing, but without this + # step we need to have LD_LIBRARY_PATH with 53 entrys. welcome to + # library hell + echo " * fixing librarys..." + cd vmroot/lib/vmware/lib + mkdir test + mv lib* test + mv test/lib*/* . + rm -rf test + cd ../../../.. + + echo " * fixing gdk and pango config files" + sed -i \ + "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ + vmroot/lib/vmware/libconf/etc/gtk-2.0/gdk-pixbuf.loaders + sed -i \ + "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ + vmroot/lib/vmware/libconf/etc/gtk-2.0/gtk.immodules + sed -i \ + "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ + vmroot/lib/vmware/libconf/etc/pango/pango.modules + sed -i \ + "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ + vmroot/lib/vmware/libconf/etc/pango/pangorc + sed -i \ + "s,/etc/pango/pango/,/etc/pango/," \ + vmroot/lib/vmware/libconf/etc/pango/pangorc + + echo " * creating /etc/vmware" + mkdir -p /etc/vmware + + echo " * unpacking kernel modules" + cd vmroot/lib/vmware/modules/source + tar xf vmnet.tar + tar xf vmmon.tar + if [ "${vmplversion}" != "vmpl1.0" ]; then + tar xf vmblock.tar + fi -echo " * building vmblock module" -if [ "${vmplversion}" != "vmpl1.0" ]; then - cd vmblock-only/ + echo " * building vmblock module" + if [ "${vmplversion}" != "vmpl1.0" ]; then + cd vmblock-only/ + sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile + make -s + mv vmblock.ko vmblock.o ../../../../../modules + cd .. + fi + + echo " * building vmmon module" + cd vmmon-only sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile make -s - mv vmblock.ko vmblock.o ../../../../../modules + mv vmmon.ko vmmon.o ../../../../../modules cd .. -fi - -echo " * building vmmon module" -cd vmmon-only -sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile -make -s -mv vmmon.ko vmmon.o ../../../../../modules -cd .. -echo " * building vmnet module" -cd vmnet-only -sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile -make -s -mv vmnet.ko vmnet.o ../../../../../modules -cd ../../../../../.. + echo " * building vmnet module" + cd vmnet-only + sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile + make -s + mv vmnet.ko vmnet.o ../../../../../modules + cd ../../../../../.. -echo " * setting up EULA" -mv vmroot/doc/EULA vmroot/lib/vmware/share/EULA.txt + echo " * setting up EULA" + mv vmroot/doc/EULA vmroot/lib/vmware/share/EULA.txt + + echo " * finishing installation" + -echo " * finishing installation" +else + # bundle Installation of vmpl2.5 + # note: the rpm just include the stupid .bundle file... + cd ${vmplversion} + + echo " * Manipulating and extracting vmplayer ${vmplversion} package. this may take a while" + # VMware is ..... they dont get ride about + # ${vmplversion} --help if you're not running X, even + # if the output is in console. Only sudo or root login + # works to get attributes..... grrrrr + # and, of course, it want to deinstall its old crap first + # we need to remove the deinstallation shit and take care + # that there's no char more or less as in the original! + # of course, their extraction needs root priv... senceless + + # fool non-root user extraction... for testing + sed -i 's/ exit 1/ echo 1/' ../${tgzfile} + sed -i 's/ migrate_networks/ echo te_networks/' ../${tgzfile} + sed -i 's/ uninstall_legacy/ echo tall_legacy/' ../${tgzfile} + sed -i 's/ uninstall_rpm/ echo tall_rpm/' ../${tgzfile} + sed -i 's/ uninstall_bundle/ echo tall_bundle/' ../${tgzfile} + # this won't work as root on our clients... I hope it don't break + # anything on our clients in stage1 + sh ../${tgzfile} -x temp + # TODO: errorcheck if rpm wasnt downloaded properly. + # ask on mailinglist if theres a way how to handle it + # in preInstallation() "exit 1" is enough. Perhaps it will work + # here, too. Try first, and then document it in the wiki + + # reduce some errors + echo " * deleting old files if available" + rm -rf vmroot + + echo " * copying files..." + mkdir vmroot + mkdir -p vmroot/modules + mkdir -p vmroot/lib + mv temp/vmware-player/lib vmroot/lib/vmware + mv temp/vmware-player/bin vmroot/ + mv temp/vmware-player/sbin vmroot/ + mv temp/vmware-player/doc vmroot/ +# rm -rf vmware-player-distrib/ + rm -rf vmroot/lib/vmware/modules/binary + +# echo " * fixing file permission" +# chmod 04755 vmroot/lib/vmware/bin/vmware-vmx +# +# # I don't want to understand what vmware is doing, but without this +# # step we need to have LD_LIBRARY_PATH with 53 entrys. welcome to +# # library hell +# echo " * fixing librarys..." +# cd vmroot/lib/vmware/lib +# mkdir test +# mv lib* test +# mv test/lib*/* . +# rm -rf test +# cd ../../../.. +# +# echo " * fixing gdk and pango config files" +# sed -i \ +# "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ +# vmroot/lib/vmware/libconf/etc/gtk-2.0/gdk-pixbuf.loaders +# sed -i \ +# "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ +# vmroot/lib/vmware/libconf/etc/gtk-2.0/gtk.immodules +# sed -i \ +# "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ +# vmroot/lib/vmware/libconf/etc/pango/pango.modules +# sed -i \ +# "s,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/${vmplversion}/vmroot/lib/vmware/libconf," \ +# vmroot/lib/vmware/libconf/etc/pango/pangorc +# sed -i \ +# "s,/etc/pango/pango/,/etc/pango/," \ +# vmroot/lib/vmware/libconf/etc/pango/pangorc +# +# echo " * creating /etc/vmware" +# mkdir -p /etc/vmware +# +# echo " * unpacking kernel modules" +# cd vmroot/lib/vmware/modules/source +# tar xf vmnet.tar +# tar xf vmmon.tar +# if [ "${vmplversion}" != "vmpl1.0" ]; then +# tar xf vmblock.tar +# fi +# +# echo " * building vmblock module" +# if [ "${vmplversion}" != "vmpl1.0" ]; then +# cd vmblock-only/ +# sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile +# make -s +# mv vmblock.ko vmblock.o ../../../../../modules +# cd .. +# fi +# +# echo " * building vmmon module" +# cd vmmon-only +# sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile +# make -s +# mv vmmon.ko vmmon.o ../../../../../modules +# cd .. +# +# echo " * building vmnet module" +# cd vmnet-only +# sed -i "s%^VM_UNAME = .*%VM_UNAME = $(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1)%" Makefile +# make -s +# mv vmnet.ko vmnet.o ../../../../../modules +# cd ../../../../../.. +# +# echo " * setting up EULA" +# mv vmroot/doc/EULA vmroot/lib/vmware/share/EULA.txt +# +# echo " * finishing installation" + + +fi |