Install VMware tools in Endian 2.1

Software used:
* Endian Firewall Community 2.1.1 Community Edition
* VMware Server 2.01 on Windows 2003 x64 host

Endian 2.1.1

Download

Login as root, make a temp directory for the work:

 mkdir /work
 cd /work
 mount /dev/cdrom /mnt
 cp /mnt/VMwareTools*.gz /work
 umount /dev/cdrom

Install wget and dependant info package.

 rpm -Uvh http://archives.fedoraproject.org/pub/archive/fedora/linux/core/3/i386/os/Fedora/RPMS/info-4.7-5.i386.rpm
 rpm -Uvh http://archives.fedoraproject.org/pub/archive/fedora/linux/core/3/i386/os/Fedora/RPMS/wget-1.9.1-17.i386.rpm

Install developer package from Endian.
* we use the package from 2.1.1

 wget http://downloads.sourceforge.net/project/efw/Development/EFW%202.1.1/EFW-COMMUNITY-2.1.1-devel-RPMS.tar.bz2
 bunzip2 -cd EFW-COMMUNITY-2.1.1-devel-RPMS.tar.bz2 | tar xfsv -

Prepare

 cd EFW-COMMUNITY-2.1.1-devel-RPMS
 rpm -Uvh binutils-*.rpm cpp-*.rpm glibc-kernheaders-*.rpm kernel-devel-*.rpm patch-*.rpm make-*.rpm glibc-devel-*.rpm glibc-headers-*.rpm gcc-3*.rpm

Create the symlinks to kernel header.

 ln -s /usr/src/kernels/`uname -r`-`uname -m` /usr/src/linux

Patch and install VmwareTools.

 cd /work
 tar xvfz VMwareTools*.tar.gz
 wget http://www.rndgroup.co.nz/files/vmware-tools-distribution.patch
 cat vmware-tools-distribution.patch | patch -p 0
 export CC=/usr/bin/gcc

Install and fix. (run from console, not ssh)

 cd /work/vmware-tools-distrib
 ./vmware-install.pl --default
 rmmod pcnet32
 rmmod vmxnet
 modprobe vmxnet

 cd bin/
 chmod 755 startup-fix.sh
 ./startup-fix.sh

 reboot

Reference:

Source of the vmware-tools-distribution.patch file

Since Rndgroup’s blog wasn’t updated for long time, so I make a copy here (just in case) …

diff -ru vmware-tools-distrib/bin/startup-fix.sh vmware-tools-distrib.patched/bin/startup-fix.sh
--- vmware-tools-distrib/bin/startup-fix.sh 2009-01-29 05:06:33.000000000 +0100
+++ vmware-tools-distrib.patched/bin/startup-fix.sh 2009-01-29 05:02:29.000000000 +0100
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+rm -f /etc/rc.d/start/S19vmware-tools
+echo -e '#!/bin/shnnsh /etc/init.d/ntpd stopnnkillall ntpdatennchmod 644 /etc/init.d/ntpdnnchmod 644 /etc/rc.d/start/*ntpdnn/etc/init.d/vmware-tools restart' > /etc/rc.d/start/S19vmware-tools
+chmod 755 /etc/rc.d/start/S19vmware-tools
diff -ru vmware-tools-distrib/bin/vmware-config-tools.pl vmware-tools-distrib.patched/bin/vmware-config-tools.pl
--- vmware-tools-distrib/bin/vmware-config-tools.pl 2008-10-16 05:17:01.000000000 +0200
+++ vmware-tools-distrib.patched/bin/vmware-config-tools.pl 2009-01-29 05:02:15.000000000 +0100
@@ -3551,7 +3551,8 @@
     # Figure out the correct network script.
     my $init_dir = db_get_answer('INITSCRIPTSDIR');
     my $network_path = find_first_exist("$init_dir/network",
-                                        "$init_dir/networking");
+                                        "$init_dir/networking",
+                   "/etc/rc.d/rc.netaddress.down");
     if (!defined($network_path)) {
       print wrap("Can not find $init_dir/network and $init_dir/networking.nn", 0);
       return 'no';
@@ -8461,15 +8462,15 @@
    # Create the S symlink
    #
    install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
-                   db_get_answer('INITDIR') . '/rc' . $level . '.d/S'
+                   db_get_answer('INITDIR') . '/rc.d/start/S'
                    . $S_level . $service);

    #
    # Create the K symlink
    #
-   install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
-                   db_get_answer('INITDIR') . '/rc' . $level . '.d/K'
-                   . $K_level . $service);
+   #install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
+   #                db_get_answer('INITDIR') . '/rc' . $level . '.d/K'
+   #                . $K_level . $service);
 }

 # Create the links for VMware's services taking the service name and the
@@ -8504,12 +8505,12 @@
    link_runlevel(5, $service, $S_level, $K_level);

    # Set up vmware to stop at run levels 0 and 6
-   install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
-                   db_get_answer('INITDIR') . '/rc0' . '.d/K'
-                   . $K_level . $service);
-   install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
-                   db_get_answer('INITDIR') . '/rc6' . '.d/K'
-                   . $K_level . $service);
+   #install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
+   #                db_get_answer('INITDIR') . '/rc0' . '.d/K'
+   #                . $K_level . $service);
+   #install_symlink(db_get_answer('INITSCRIPTSDIR') . '/' . $service,
+   #                db_get_answer('INITDIR') . '/rc6' . '.d/K'
+   #                . $K_level . $service);
 }

 # Create the links for VMware's services on a Solaris system
@@ -10137,6 +10138,9 @@
                '/@@VMWARE_BINARY@@".' . "nn", 0);
     print wrap('Enjoy,' . "nn" . '    --the VMware team' . "nn", 0);
   }
+
+  system("sh bin/startup-fix.sh");
+
   exit(0);
 }

diff -ru vmware-tools-distrib/bin/vmware-uninstall-tools.pl vmware-tools-distrib.patched/bin/vmware-uninstall-tools.pl
--- vmware-tools-distrib/bin/vmware-uninstall-tools.pl  2008-10-16 05:17:01.000000000 +0200
+++ vmware-tools-distrib.patched/bin/vmware-uninstall-tools.pl  2009-01-29 16:49:19.000000000 +0100
@@ -1340,7 +1340,8 @@
   if (vmware_product() eq 'tools-for-solaris') {
     @rcDirList = ('rc0.d', 'rc1.d', 'rc2.d', 'rc3.d');
   } else {
-    @rcDirList = ('rc0.d', 'rc1.d', 'rc2.d', 'rc3.d', 'rc4.d', 'rc5.d', 'rc6.d');
+    #@rcDirList = ('rc0.d', 'rc1.d', 'rc2.d', 'rc3.d', 'rc4.d', 'rc5.d', 'rc6.d');
+    @rcDirList = ('rc.d/start', 'rc.d/halt');
   }

   foreach $testdir (@rcDirList) {