summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmware/files/install-vmpl2.0.sh
blob: 2a65a79068e286a075896d36460f28c988ee96f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh

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 

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

	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

	echo "   * copying files..."
	mkdir root
	mkdir -p root/lib
	mv vmware-player-distrib/lib root/lib/vmware
	mv vmware-player-distrib/bin root/
	mv vmware-player-distrib/sbin root/
	mv vmware-player-distrib/doc root/
    rm -rf vmware-player-distrib/

    # 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 root/lib/vmware/lib
    mkdir test
    mv lib* test
    mv test/lib*/* .
    cd ../../../..

    echo "   * fixing gdk config file"
    sed -i \
      's,/build/mts/.*/vmui/../libdir/libconf,/opt/openslx/plugin-repo/vmware/vmpl2.0/root/lib/vmware/libconf,' \
      root/lib/vmware/libconf/etc/gtk-2.0/gdk-pixbuf.loaders

	echo "   * creating /etc/vmware"
	mkdir -p /etc/vmware

    echo "   * unpacking kernel modules"
    cd root/lib/vmware/modules/source
    tar xf vmnet.tar
    tar xf vmmon.tar
    tar xf vmblock.tar

    echo "   * building vmblock module"
    cd vmblock-only/
    # 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...
    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
    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
    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
    cd ..

    # TODO: remove. just for debug reasons
    echo "Press any return to process"
    read

	echo "   * finishing installation"
	
else
	echo "You didnt't accept the end user license. vmplayer is not installed."
fi