├── .gitignore ├── README.md ├── additional-files ├── etc │ ├── init.d │ │ └── open-vm-tools │ └── vmware-tools │ │ ├── scripts │ │ ├── poweroff-vm-default.d │ │ │ └── 01-log.sh │ │ ├── poweron-vm-default.d │ │ │ └── 01-log.sh │ │ ├── resume-vm-default.d │ │ │ └── 01-log.sh │ │ └── suspend-vm-default.d │ │ │ └── 01-log.sh │ │ └── tools.conf └── tce.installed │ └── open-vm-tools ├── build-and-install.sh ├── build-dependencies ├── create-patch.sh ├── ezremaster.cfg ├── open-vm-tools-9.10.2-2822639.patch ├── open-vm-tools.tcz.dep ├── open-vm-tools.version └── prepare-tcl-to-build.sh /.gitignore: -------------------------------------------------------------------------------- 1 | open-vm-tools-?.?.?-??????? 2 | open-vm-tools-*.tar.gz 3 | open-vm-tools-*-patched 4 | *.tcz* 5 | *.iso 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | tcl-open-vm-tools 2 | ================= 3 | 4 | Tools to build open-vm-tools for TinyCoreLinux 6.3 5 | 6 | The fast track building instructions 7 | ------------------------------------ 8 | 1. Boot a system with tcl6.3 and least 1GB of RAM. 9 | 1. Install tce package for git 10 | ``` 11 | tce-load -iw git 12 | ``` 13 | 1. Clone git repository with building instructions and tools 14 | ``` 15 | git clone https://github.com/lapawa/tc5-open-vm-tools.git && 16 | cd tc5-open-vm-tools 17 | ``` 18 | 1. Prepare the tiny core machine for building the tools 19 | ``` 20 | ./prepare-tcl-to-build.sh 21 | ``` 22 | This script will install additional tce packages and get the open-vm-tools tarball from sourceforge.net. 23 | 1. Change user to root. 24 | ``` 25 | sudo -s 26 | ``` 27 | 1. Start build script 28 | ./build-and-install.sh 29 | 1. Good luck 30 | 1. The build script will spit out two tinycore extensions: 31 | open-vm-tools.tcz 32 | and 33 | open-vm-tools-modules-KERNEL.tcz 34 | 35 | 36 | Putting it al in one line 37 | --------------------------- 38 | ``` 39 | tce-load -iw git && git clone https://github.com/lapawa/tc5-open-vm-tools.git && cd tc5-open-vm-tools && ./prepare-tcl-to-build.sh && sudo ./build-and-install.sh 40 | ``` 41 | 42 | Tested with these versions 43 | ------------------------- 44 | 45 | - TinyCore : v5.2 i686 46 | http://www.tinycorelinux.com 47 | - open-vm-tools : 9.4.0-1208544 48 | http://open-vm-tools.sf.net 49 | - linux kernel : 3.8.13-tinycore 50 | The build script is kernel version independent and uses `uname -r` 51 | to find kernel header files 52 | 53 | 54 | Build dependencies 55 | ------------------ 56 | 57 | - git # To clone repository from github.com/lapawa/tc5-open-vm-tools 58 | - compiletc # this meta package pulls in a lot of necessary development tools 59 | - linux-kernel-sources-env # Installs the shell script /usr/local/bin/linux-kernel-sources-env.sh which will prepare kernel sources/headers 60 | - glibc_apps # /usr/bin/rpcgen is in this packet 61 | - squashfs-tools-4.x # Tools to build the .tcz file 62 | - glib2-dev # 63 | - libtirpc-dev # libary for remote procedure calls. The xdr_ datatype are define in there. 64 | - Xorg-7.7-dev 65 | - gtk2-dev # because of a missing parameter in lib/appUtil/Makefile.am file it is not possible to compile with X and without gtk2 66 | - libGL-dev # gtk2 and cairo expect these header files. 67 | - gtkmm-dev 68 | - fuse 69 | 70 | 71 | Instructions used to configure 72 | ------------------------------ 73 | 74 | Set these environment variables before starting configure script: 75 | ``` 76 | export RPCGENFLAGS="-Y /usr/local/bin" 77 | export CFLAGS="-march=i486 -mtune=i686 -Os -pipe -Wno-error=deprecated-declarations -I/usr/local/include/tirpci -DHAVE_TIRPC" 78 | export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" 79 | export LDFLAGS="-Wl,-O1 -ltirpc" 80 | ``` 81 | 82 | Additional configure options: 83 | * --with-x 84 | * --without-pam 85 | * --without-gtkmm 86 | * --without-procps 87 | * --without-dnet 88 | * --without-icu 89 | 90 | 91 | Look into build-and-install.sh for details. 92 | 93 | -------------------------------------------------------------------------------- /additional-files/etc/init.d/open-vm-tools: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Start, stop, and restart vmtoolsd 3 | echo "`date` started '$0'" > /var/log/vmtools.init.sh 4 | 5 | OPT="--background /var/run/vmtoolsd.pid" 6 | 7 | unload_module() { 8 | lsmod|grep -q ^$1 && rmmod $1 9 | #/sbin/udevadm settle 10 | } 11 | 12 | load_module() { 13 | lsmod|grep -q ^$1 || modprobe $1 14 | #/sbin/udevadm settle 15 | } 16 | 17 | case "$1" in 18 | start) 19 | # Ensure kernel modules can be loaded 20 | depmod -a 21 | 22 | # Interface check 23 | NIF1=$(wc -l < /proc/net/dev) 24 | 25 | # Load vmhgfs module 26 | load_module vmhgfs 27 | 28 | # Mount vmhgfs 29 | vmhgfs_mnt=/mnt/hgfs 30 | if [ ! -e $vmhgfs_mnt ]; then mkdir $vmhgfs_mnt; fi 31 | sed /hgfs/d -i /etc/fstab 32 | echo ".host:/ /mnt/hgfs vmhgfs defaults,user,ttl=5,uid=root,gid=root,fmask=0133,dmask=0022 0 0" >> /etc/fstab 33 | grep -q vmhgfs /etc/mtab || mount $vmhgfs_mnt &>/dev/null 34 | 35 | # Load vmmemctl 36 | # load_module vmmemctl 37 | 38 | # Load vmxnet 39 | load_module vmxnet 40 | 41 | # Load vmxnet3 42 | load_module vmxnet3 43 | 44 | # Load vmci 45 | load_module vmci 46 | 47 | # Load vsock 48 | load_module vsock 49 | 50 | # Load vmblock 51 | vmblock_dev=/tmp/VMwareDnd 52 | mkdir -p $vmblock_dev 53 | chmod 1777 $vmblock_dev 54 | load_module vmblock 55 | vmware-vmblock-fuse /tmp/VMwareDnd 56 | 57 | # Load vmsync 58 | #load_module vmsync 59 | 60 | # Start vmtoolsd 61 | if pidof vmtoolsd &>/dev/null; then 62 | echo vmtoolsd already running 63 | else 64 | rm -f /var/run/vmtoolsd.pid 65 | /usr/local/bin/vmtoolsd $OPT 66 | fi 67 | 68 | # Start DHCP client for new interfaces 69 | if ! grep -q nodhcp /proc/cmdline; then 70 | NIF2=$(wc -l < /proc/net/dev) 71 | if [ $NIF2 -gt $NIF1 ]; then 72 | /etc/init.d/dhcp.sh 73 | fi 74 | fi 75 | ;; 76 | stop) 77 | if pidof vmtoolsd &>/dev/null; then 78 | killall vmtoolsd 79 | echo stopped vmtoolsd 80 | else 81 | echo vmtoolsd is not running 82 | fi 83 | ;; 84 | restart) 85 | $0 stop 86 | $0 start 87 | ;; 88 | *) 89 | echo "Usage: $0 (start|stop|restart)" 90 | exit 1 91 | ;; 92 | esac 93 | -------------------------------------------------------------------------------- /additional-files/etc/vmware-tools/scripts/poweroff-vm-default.d/01-log.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "execution of $0 at `date`" >> /tmp/vmware-user-script.log 3 | filetool.sh -b 4 | poweroff 5 | 6 | 7 | -------------------------------------------------------------------------------- /additional-files/etc/vmware-tools/scripts/poweron-vm-default.d/01-log.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "execution of $0 at `date`" >> /tmp/vmware-user-script.log 3 | 4 | -------------------------------------------------------------------------------- /additional-files/etc/vmware-tools/scripts/resume-vm-default.d/01-log.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "execution of $0 at `date`" >> /tmp/vmware-user-script.log 3 | 4 | -------------------------------------------------------------------------------- /additional-files/etc/vmware-tools/scripts/suspend-vm-default.d/01-log.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "execution of $0 at `date`" >> /tmp/vmware-user-script.log 3 | 4 | -------------------------------------------------------------------------------- /additional-files/etc/vmware-tools/tools.conf: -------------------------------------------------------------------------------- 1 | 2 | # configuration file for open-vm-tools 3 | # desription taken from http://kb.vmware.com/kb/1007873 4 | 5 | [logging] 6 | log = true 7 | 8 | # Enable tools service logging to a file. 9 | vmtoolsd.level = debug 10 | vmtoolsd.handler = file 11 | vmtoolsd.data = /var/log/vmtoold.log 12 | 13 | # Enable 'vmsvc' service logging to a file. 14 | vmsvc.level = debug 15 | vmsvc.handler = file 16 | vmsvc.data = /var/log/vmsvc.log 17 | 18 | # Enable new "vmusr" service logging to a file. 19 | vmusr.level = debug 20 | vmusr.handler = file 21 | vmusr.data = /var/log/vmusr.${USER}.log 22 | 23 | -------------------------------------------------------------------------------- /additional-files/tce.installed/open-vm-tools: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # TinyCoreLinux will start this script after installing the extension 5 | # 6 | echo "`date` Executing '$0'" > /var/log/open-vm-tools.tce.installed.log 7 | 8 | # 9 | # vmtoolsd wants to read this file 10 | # -> create it 11 | if [ ! -e /etc/release ]; then 12 | echo "TinyCore `/usr/bin/version`" > /etc/release 13 | fi 14 | 15 | # 16 | # copy default etc files to root 17 | # 18 | cp -r --dereference /usr/local/etc/vmware-tools /etc/ 19 | /usr/local/etc/init.d/open-vm-tools start 20 | 21 | -------------------------------------------------------------------------------- /build-and-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # set some environment variables 5 | # 6 | 7 | # version number of vmware tools and source package 8 | read -r " 84 | if [ $FORCE ]; then 85 | echo "rm -r '$T'" 86 | rm -r "$T" 87 | else 88 | echo "Use option -f to overwrite or move file away. exit(3)" 89 | exit 3 90 | fi 91 | fi 92 | done 93 | 94 | 95 | ## 96 | ## Start compiling the source package 97 | ## 98 | set -e 99 | 100 | # extract source archive 101 | tar xfz $SRC.tar.gz 102 | if [ -r "${SRC}.patch" ]; then 103 | echo "### apply patch $SRC.patch" 104 | patch -p0 < $SRC.patch 105 | fi 106 | 107 | cd $SRC 108 | 109 | 110 | # configure, make, make install 111 | export RPCGENFLAGS="-Y /usr/local/bin" 112 | export CFLAGS="-march=i486 -mtune=i686 -Os -pipe -Wno-error=deprecated-declarations -DHAVE_TIRPC -I/usr/local/include/tirpc" 113 | export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" 114 | export LDFLAGS="-Wl,-O1 -L/usr/local/lib -ltirpc" 115 | 116 | echo "## configure $CONFIGFLAGS" 117 | /bin/sh configure $CONFIGFLAGS 118 | echo "## make $MAKEFLAGS" 119 | make $MAKEFLAGS 120 | 121 | mkdir "${INSTDIR}" 122 | make DESTDIR=${INSTDIR} install-strip 123 | cd .. 124 | 125 | 126 | ## 127 | ## Cleanup and remove unneccessary files 128 | ## 129 | 130 | # these directories are relevant for -dev extension 131 | find "$INSTDIR" -type d -name pkgconfig -print | xargs rm -r 132 | find "$INSTDIR" -type d -name include -print | xargs rm -r 133 | # language packs 134 | find "$INSTDIR" -type d -name messages -print | xargs rm -r 135 | 136 | # This script relies on several OS scripts and is not working with TinyCore 137 | rm "$INSTDIR/etc/vmware-tools/scripts/vmware/network" 138 | 139 | 140 | ## 141 | ## Create tcz extensions 142 | ## 143 | 144 | # build extension for kernel modules 145 | mkdir -p "$INSTDIR_MODULES/usr/local/" 146 | mv "$INSTDIR/lib" "$INSTDIR_MODULES/usr/local" 147 | mksquashfs "$INSTDIR_MODULES" "$TCZ_MODULES" -noappend 148 | md5sum "$TCZ_MODULES" > "$TCZ_MODULES.md5.txt" 149 | 150 | 151 | # move some directories into usr/local 152 | mkdir -p $INSTDIR/usr/local/etc/init.d 153 | mv $INSTDIR/etc/* $INSTDIR/usr/local/etc/ 154 | rm -r $INSTDIR/etc 155 | 156 | rm -r $INSTDIR/sbin 157 | 158 | # add additional tinycore specific file to installation directory 159 | #rsync -rlpv --executability "$ADDITIONAL/" $INSTDIR/usr/local 160 | #tar -xf $ADDITIONAL -C $INSTDIR/usr/local 161 | cp -ra $ADDITIONAL/* $INSTDIR/usr/local/ 162 | 163 | #cp $INIT $INSTDIR/usr/local/etc/init.d/open-vm-tools 164 | chmod +x $INSTDIR/usr/local/etc/init.d/open-vm-tools 165 | # set suid flag on vmware-user-suid-wrapper 166 | chmod +s $INSTDIR/usr/local/bin/vmware-user-suid-wrapper 167 | 168 | 169 | ## 170 | ## create tinycore extension 'open-vm-tools' with md5sum file 171 | ## 172 | mksquashfs $INSTDIR $TCZ -noappend 173 | md5sum $TCZ > $TCZ.md5.txt 174 | 175 | 176 | ## 177 | ## create list files 178 | ## 179 | WD=`pwd` 180 | cd "$INSTDIR" 181 | find usr -not -type d > "$WD/$TCZ.list" 182 | cd "$INSDIR_MODULES" 183 | find usr -not -type d > "$WD/$TCZ_MODULES.list" 184 | cd "$WD" 185 | 186 | # create dummy dependencies file for kernel modules 187 | touch "${TCZ_MODULES}.dep" 188 | 189 | ## 190 | ## copy extension to persistance datastore if exists 191 | ## 192 | if [ -d "$APPBROWSER" ]; then 193 | for PKG in $BUILD_PKGS; do 194 | cp "$PKG" "${APPBROWSER}/" 195 | for EXT in $PKG_EXTS; do 196 | cp "${PKG}${EXT}" "${APPBROWSER}/" 197 | done 198 | done 199 | fi 200 | 201 | # clean up 202 | if [ -n "$KEEP" ] 203 | then 204 | echo -n 'Cleaning up temporary files...' 205 | rm -r $SRC 206 | rm -r $INSTDIR 207 | rm -r $INSTDIR_MODULES 208 | echo 'done' 209 | 210 | else 211 | echo 'Skipping deletion of temporary files.' 212 | fi 213 | 214 | 215 | # build iso image 216 | if [ -r ezremaster.cfg -a -x "$REMASTER" ]; then 217 | grep sr0 /etc/mtab > /dev/null 218 | if [ $? -ne 0 ]; 219 | then 220 | mount /mnt/sr0 221 | fi 222 | 223 | echo 'Creating iso image...' 224 | $REMASTER `pwd`/ezremaster.cfg rebuild 225 | mv /tmp/ezremaster/ezremaster.iso "${ISOIMAGE}" 226 | else 227 | echo "Skipping iso image creation due to missing config file 'ezremaster.cfg'" 228 | 229 | fi 230 | 231 | -------------------------------------------------------------------------------- /build-dependencies: -------------------------------------------------------------------------------- 1 | compiletc 2 | linux-kernel-sources-env 3 | glibc_apps 4 | squashfs-tools 5 | glib2-dev 6 | libtirpc-dev 7 | Xorg-7.7-dev 8 | gtk2-dev 9 | libGL-dev 10 | gtkmm-dev 11 | openssl-dev 12 | fuse 13 | ezremaster 14 | -------------------------------------------------------------------------------- /create-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | read -r $SRC.patch 9 | -------------------------------------------------------------------------------- /ezremaster.cfg: -------------------------------------------------------------------------------- 1 | cd_location = /mnt/sr0 2 | temp_dir = /tmp/ezremaster 3 | cc = blacklist=pcnet32 4 | app_outside_initrd_onboot = open-vm-tools-modules-3.16.6-tinycore.tcz 5 | app_outside_initrd_onboot = libffi.tcz 6 | app_outside_initrd_onboot = fuse.tcz 7 | app_outside_initrd_onboot = glib2.tcz 8 | app_outside_initrd_onboot = open-vm-tools.tcz 9 | -------------------------------------------------------------------------------- /open-vm-tools-9.10.2-2822639.patch: -------------------------------------------------------------------------------- 1 | diff -rupN open-vm-tools-9.10.2-2822639/lib/dynxdr/dynxdr.c open-vm-tools-9.10.2-2822639-patched/lib/dynxdr/dynxdr.c 2 | --- open-vm-tools-9.10.2-2822639/lib/dynxdr/dynxdr.c 2013-09-23 15:51:10.000000000 +0000 3 | +++ open-vm-tools-9.10.2-2822639-patched/lib/dynxdr/dynxdr.c 2014-04-08 14:23:43.436880845 +0000 4 | @@ -54,7 +54,7 @@ typedef struct DynXdrData { 5 | * Mac OS X, FreeBSD and Solaris don't take a const parameter to the 6 | * "x_getpostn" function. 7 | */ 8 | -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) 9 | +#if defined(HAVE_TIRPC) || defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) 10 | # define DYNXDR_GETPOS_CONST 11 | #else 12 | # define DYNXDR_GETPOS_CONST const 13 | @@ -171,7 +171,7 @@ DynXdrSetPos(XDR *xdrs, // IN 14 | } 15 | 16 | 17 | -#if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL))) 18 | +#if !defined(HAVE_TIRPC) && (defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL)))) 19 | /* 20 | *----------------------------------------------------------------------------- 21 | * 22 | @@ -321,7 +321,7 @@ DynXdr_Create(XDR *in) // IN 23 | DynXdrSetPos, /* x_setpostn */ 24 | DynXdrInline, /* x_inline */ 25 | NULL, /* x_destroy */ 26 | -#if defined(__GLIBC__) 27 | +#if !defined(HAVE_TIRPC) && defined(__GLIBC__) 28 | NULL, /* x_getint32 */ 29 | DynXdrPutInt32, /* x_putint32 */ 30 | #elif defined(__APPLE__) 31 | @@ -330,6 +330,8 @@ DynXdr_Create(XDR *in) // IN 32 | NULL, /* x_control */ 33 | NULL, /* x_getint32 */ 34 | DynXdrPutInt32, /* x_putint32 */ 35 | +#elif defined(HAVE_TIRPC) 36 | + NULL /* x_control */ 37 | #endif 38 | }; 39 | 40 | diff -rupN open-vm-tools-9.10.2-2822639/lib/include/vmxrpc.h open-vm-tools-9.10.2-2822639-patched/lib/include/vmxrpc.h 41 | --- open-vm-tools-9.10.2-2822639/lib/include/vmxrpc.h 2013-09-23 15:51:10.000000000 +0000 42 | +++ open-vm-tools-9.10.2-2822639-patched/lib/include/vmxrpc.h 2014-04-08 14:07:34.250212542 +0000 43 | @@ -35,7 +35,7 @@ 44 | * slightly different names than all other platforms. Provide macros to 45 | * translate the names to the more common ones. 46 | */ 47 | -#if defined(__GLIBC__) || defined(sun) 48 | +#if !defined(HAVE_TIRPC) && (defined(__GLIBC__) || defined(sun)) 49 | # define xdr_u_int16_t(x, i) xdr_uint16_t(x, i) 50 | # define xdr_u_int32_t(x, i) xdr_uint32_t(x, i) 51 | # define xdr_u_int64_t(x, i) xdr_uint64_t(x, i) 52 | -------------------------------------------------------------------------------- /open-vm-tools.tcz.dep: -------------------------------------------------------------------------------- 1 | glib2.tcz 2 | libdnet.tcz 3 | libtirpc.tcz 4 | openssl.tcz 5 | open-vm-tools-modules-KERNEL.tcz 6 | -------------------------------------------------------------------------------- /open-vm-tools.version: -------------------------------------------------------------------------------- 1 | 9.10.2-2822639 2 | -------------------------------------------------------------------------------- /prepare-tcl-to-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | #set -e 4 | 5 | # 6 | # Setting some environment variables 7 | # 8 | read -r