summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins
diff options
context:
space:
mode:
authorVolker Uhrig2008-08-08 00:57:25 +0200
committerVolker Uhrig2008-08-08 00:57:25 +0200
commit18cbb94a0c1352967b8e90b487d1d1ef0c78c1db (patch)
tree9eb83fb55c809d793598f9f3754eaddaafa01cd8 /os-plugins/plugins
parent* fixed list-attributes command to support being given attribute names, too (diff)
downloadcore-18cbb94a0c1352967b8e90b487d1d1ef0c78c1db.tar.gz
core-18cbb94a0c1352967b8e90b487d1d1ef0c78c1db.tar.xz
core-18cbb94a0c1352967b8e90b487d1d1ef0c78c1db.zip
* copy a directory with vmware binarys from the server system
to stage1 via preInstallationPhase() while using slxos-plugin install vendorOS vmware vmware::vmpl1.0=1 vmware::pkgpath=/path/to/tgz * EULA Information at installation got removed * No automatic download anymore git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1989 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins')
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm43
-rw-r--r--os-plugins/plugins/vmware/files/install-vmpl.sh255
2 files changed, 160 insertions, 138 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
index 0014a04b..b24d9386 100644
--- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
@@ -179,6 +179,18 @@ sub getAttrInfo
content_descr => '1 means active - 0 means inactive',
default => '0',
},
+ 'vmware::pkgpath' => {
+ applies_to_vendor_os => 1,
+ applies_to_system => 0,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Path to VMware packages
+ End-of-Here
+ #TODO
+ #content_regex => qr{^(1|0)$},
+ content_descr => '1 means active - 0 means inactive',
+ default => '0',
+ },
# ** set of attributes for the installation of VM Workstation/Player
# versions. More than one package could be installed in parallel.
# To be matched to/triggerd by 'vmware::kind'
@@ -186,6 +198,34 @@ sub getAttrInfo
}
+sub preInstallationPhase()
+{
+ my $self = shift;
+ my $info = shift;
+
+ $self->{pluginRepositoryPath} = $info->{'plugin-repo-path'};
+ $self->{pluginTempPath} = $info->{'plugin-temp-path'};
+ $self->{openslxBasePath} = $info->{'openslx-base-path'};
+ $self->{openslxConfigPath} = $info->{'openslx-config-path'};
+ $self->{attrs} = $info->{'plugin-attrs'};
+ $self->{vendorOsPath} = $info->{'vendor-os-path'};
+
+ my $pkgpath = $self->{attrs}->{'vmware::pkgpath'};
+
+ if (! -d $pkgpath) {
+ print "\n\npkgpath: no such directory!\n\n";
+ exit 1;
+ }
+
+ # todo: ask oliver about a similiar function
+ # like copyFile() just for directorys
+ # or fix the manual after checked the source of
+ # copyFile() function. check if copyFile etc. perldoc
+ # is somewhere in the wiki documented else do it!
+ system("cp -r $pkgpath $self->{pluginRepositoryPath}/packages");
+}
+
+
sub installationPhase
{
my $self = shift;
@@ -505,11 +545,12 @@ sub _vmpl2Installation {
foreach my $file (@files) {
copyFile("$pluginFilesPath/$file", "$installationPath");
}
+
# copy on depending runvmware file
copyFile("$pluginFilesPath/runvmware-player-v2", "$installationPath", "runvmware");
##
- ## Download and install the binarys
+ ## Install the binarys from given pkgpath
system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/$kind/install-vmpl.sh $kind");
##
diff --git a/os-plugins/plugins/vmware/files/install-vmpl.sh b/os-plugins/plugins/vmware/files/install-vmpl.sh
index c45dbd68..0708de8c 100644
--- a/os-plugins/plugins/vmware/files/install-vmpl.sh
+++ b/os-plugins/plugins/vmware/files/install-vmpl.sh
@@ -1,151 +1,132 @@
#!/bin/sh
+cd /opt/openslx/plugin-repo/vmware/
+
### Check if player are still installed
-if [ -d /opt/openslx/plugin-repo/vmware/$1/vmroot ]; then
- echo " * $1 seems to be installed. There shouldn't be a need for a new installation."
- echo " If you want to reinstall $1 press \"y\" else we will exit"
- read
- if [ "${REPLY}" != "y" ]; then
- echo " * $1 is already installed. Nothing to do."
- exit
- fi
- echo " * $1 will be reinstalled"
+if [ -d vmroot/ ]; then
+ echo " * $1 seems to be installed. There shouldn't be a need for a new installation."
+ echo " If you want to reinstall $1 press \"y\" else we will exit"
+ read
+ if [ "${REPLY}" != "y" ]; then
+ echo " * $1 is already installed. Nothing to do."
+ exit
+ fi
+ echo " * $1 will be reinstalled"
fi
### Now define values
if [ "$1" == "vmpl1.0" ]; then
- vmplversion="vmpl1.0"
- url=http://download3.vmware.com/software/vmplayer/VMware-player-1.0.7-91707.tar.gz
- tgzfile=VMware-player-1.0.7-91707.tar.gz
-else if [ "$1" == "vmpl2.0" ]; then
- vmplversion="vmpl2.0"
- url=http://download3.vmware.com/software/vmplayer/VMware-player-2.0.4-93057.i386.tar.gz
- tgzfile=VMware-player-2.0.4-93057.i386.tar.gz
- fi
+ vmplversion="vmpl1.0"
+ tgzfile=$(ls packages/VMware-player-1.0.*|sort|tail -n 1)
+elif [ "$1" == "vmpl2.0" ]; then
+ vmplversion="vmpl2.0"
+ tgzfile=$(ls packages/VMware-player-2.0.*|sort|tail -n 1)
+else
+ echo "Attribute of install-vmpl.sh isn't valid!"
+ echo "This shouldn't happen! Fix vmware.pm!"
+ exit 1;
+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/
+
+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"
+# TODO: check if /boot/vmlinuz is available if we get the kernel version this way
+# perhaps we don't need a check... perhaps openslx always use
+# /boot/vmlinuz
+# This problem happens 3 times. see below!
+# TODO: error check if build environment isn't installed...
+#TODO: vmblock only v2
+if [ "${vmplversion}" != "vmpl1.0" ]; then
+ cd vmblock-only/
+ sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
+ make -s
+ cp vmblock.ko vmblock.o ../../../../../modules
+ cd ..
+fi
-### Give informations about the EULA
-echo ""
-echo "EULA information for $vmplversion"
-echo ""
-echo "This script will download and install vmplayer from http://www.vmware.com/"
-echo "Please go to http://vmware.com/download/player/player_reg.html"
-echo "and ..."
-echo " * complete this registration form"
-echo " * click on \"Download Now\""
-echo " * read and decide if you want to accept the VMware master end user license agreement"
-echo
-echo "If you have done this and accepted the enduser licence type in yes in uppercase."
-echo "This will install vmplayer on your vendor-os. If you don't agree this license"
-echo "vmplayer won't be installed."
-echo
-read
-echo
-
-
-### EULA information passed, install depending player now
-if [ "${REPLY}" == "YES" ]; then
-
- echo " * Downloading vmplayer as ${vmplversion} now. This may take a while"
- cd /opt/openslx/plugin-repo/vmware/${vmplversion}
- wget -c ${url}
-
- echo " * Unpacking vmplayer ${vmplversion}"
- tar xfz ${tgzfile}
-
- # 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/
-
- 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*/* .
- 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"
- # TODO: check if /boot/vmlinuz is available if we get the kernel version this way
- # perhaps we don't need a check... perhaps openslx always use
- # /boot/vmlinuz
- # This problem happens 3 times. see below!
- # TODO: error check if build environment isn't installed...
- #TODO: vmblock only v2
- if [ "${vmplversion}" != "vmpl1.0" ]; then
- cd vmblock-only/
- sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
- make -s
- cp vmblock.ko vmblock.o ../../../../../modules
- cd ..
- fi
-
- echo " * building vmmon module"
- cd vmmon-only
- sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
- make -s
- cp vmmon.ko vmmon.o ../../../../../modules
- cd ..
+echo " * building vmmon module"
+cd vmmon-only
+sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
+make -s
+cp vmmon.ko vmmon.o ../../../../../modules
+cd ..
- echo " * building vmnet module"
- cd vmnet-only
- sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
- make -s
- cp vmnet.ko vmnet.o ../../../../../modules
- cd ../../../../../..
+echo " * building vmnet module"
+cd vmnet-only
+sed -i "s%^VM_UNAME = .*%VM_UNAME = $(ls /boot/vmlinuz*|grep -v -e "^/boot/vmlinuz$$"|sed 's,/boot/vmlinuz-,,'|sort|tail -n 1)%" Makefile
+make -s
+cp vmnet.ko vmnet.o ../../../../../modules
+cd ../../../../../..
- echo " * setting up EULA"
- mv vmroot/doc/EULA vmroot/lib/vmware/share/EULA.txt
-
- echo " * finishing installation"
+echo " * setting up EULA"
+mv vmroot/doc/EULA vmroot/lib/vmware/share/EULA.txt
-else
- echo "You didnt't accept the end user license. vmplayer is not installed."
-fi
+echo " * finishing installation"