diff options
Diffstat (limited to 'testing/open-vm-tools')
-rw-r--r-- | testing/open-vm-tools/APKBUILD | 109 | ||||
-rw-r--r-- | testing/open-vm-tools/checkvm-pie-safety.patch | 67 | ||||
-rw-r--r-- | testing/open-vm-tools/codeset-uclibc.patch | 20 | ||||
-rw-r--r-- | testing/open-vm-tools/ecvt.patch | 205 | ||||
-rw-r--r-- | testing/open-vm-tools/getloadavg-uclibc.patch | 22 | ||||
-rw-r--r-- | testing/open-vm-tools/iconv-uclibc.patch | 12 | ||||
-rw-r--r-- | testing/open-vm-tools/libm.patch | 18 | ||||
-rw-r--r-- | testing/open-vm-tools/open-vm-tools.desktop | 7 | ||||
-rw-r--r-- | testing/open-vm-tools/open-vm-tools.initd | 76 | ||||
-rw-r--r-- | testing/open-vm-tools/open-vm.confd | 2 | ||||
-rw-r--r-- | testing/open-vm-tools/open-vm.initd | 76 | ||||
-rw-r--r-- | testing/open-vm-tools/resume-vm-default.patch | 49 | ||||
-rw-r--r-- | testing/open-vm-tools/suspend-vm-default.patch | 49 |
13 files changed, 712 insertions, 0 deletions
diff --git a/testing/open-vm-tools/APKBUILD b/testing/open-vm-tools/APKBUILD new file mode 100644 index 000000000..97a3a7753 --- /dev/null +++ b/testing/open-vm-tools/APKBUILD @@ -0,0 +1,109 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=open-vm-tools +pkgver=8.4.2 +_pkgsubver=261024 +pkgrel=0 +pkgdesc="The Open Virtual Machine Tools are the open source implementation of VMware Tools." +url="http://open-vm-tools.sourceforge.net/" +license="LGPL" +subpackages="$pkgname-gtk" +makedepends="procps-dev libdnet-dev icu-dev glib-dev pkgconfig bash + libtirpc-dev rpcgen icu-dev automake autoconf + gtk+-dev libxext-dev libxinerama-dev libxtst-dev gtkmm-dev + libnotify-dev libxrandr-dev + " +source="http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$pkgver-$_pkgsubver.tar.gz + getloadavg-uclibc.patch + codeset-uclibc.patch + ecvt.patch + iconv-uclibc.patch + libm.patch + checkvm-pie-safety.patch + resume-vm-default.patch + suspend-vm-default.patch + open-vm-tools.initd + open-vm.initd + open-vm.confd + " + +_builddir="$srcdir"/$pkgname-$pkgver-$_pkgsubver + +prepare() { + cd "$_builddir" + for i in "$srcdir"/*.patch; do + [ -r "$i" ] || continue + patch -p1 -i "$i" || return 1 + done + + sed -i -e 's/__unused1/st_atim.tv_nsec/g' \ + -e 's/__unused2/st_mtim.tv_nsec/g' \ + -e 's/__unused3/st_ctim.tv_nsec/g' \ + lib/file/filePosix.c lib/hgfsServer/hgfsServerLinux.c \ + || return 1 + + # workaround automake-1.10 issue + # http://ramblingfoo.blogspot.com/2007/07/required-file-configrpath-not-found.html + touch config/config.rpath + aclocal -I m4 && autoconf && automake +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --disable-unity \ + --with-dnet \ + --with-icu \ + --with-procps \ + --with-x \ + --without-kernel-modules \ + --without-pam \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make install DESTDIR=$pkgdir || return 1 + + # one of the plugins seems to be linked to libhgfsServer + # create a link to abuild gets happy + ln -s open-vm-tools/plugins/vmsvc/libhgfsServer.so \ + "$pkgdir"/usr/lib/libhgfsServer.so.0 + + # dont bother create a -dev package + rm -f "$pkgdir"/usr/lib/*.a "$pkgdir"/usr/lib/*.la + + install -Dm644 "$srcdir"/open-vm-tools.desktop \ + "$pkgdir"/etc/xdg/open-vm-tools.desktop + install -Dm755 "$srcdir"/open-vm-tools.initd \ + "$pkgdir"/etc/init.d/open-vm-tools + install -Dm644 "$srcdir"/open-vm.confd "$pkgdir"/etc/conf.d/open-vm + install -Dm755 "$srcdir"/open-vm.initd "$pkgdir"/etc/init.d/open-vm +} + +gtk() { + pkgdesc="Xorg apps and plugins for open-vm-tools" + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/lib/open-vm-tools/plugins/vmusr \ + "$subpkgdir"/etc/ + mv "$pkgdir"/usr/bin/vmware-toolbox \ + "$pkgdir"/usr/bin/vmware-user \ + "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/lib/open-vm-tools/plugins/vmusr/libresolutionSet.so \ + "$pkgdir"/usr/lib/open-vm-tools/plugins/vmusr/libvixUser.so \ + "$subpkgdir"/usr/lib/open-vm-tools/plugins/vmusr/ + mv "$pkgdir"/etc/xdg "$subpkgdir"/etc/ +} + +md5sums="4d9ddc865b42fc6982c3078031500486 open-vm-tools-8.4.2-261024.tar.gz +bf2398b976d849bfd29a02763984a68a getloadavg-uclibc.patch +82840b6bed002284b9bd2358707ee826 codeset-uclibc.patch +840e4d6ff3f53fc22bdedf4d64aabc91 ecvt.patch +454827c50f5b1290dd647717e87d0f5a iconv-uclibc.patch +7d02fc25aba5c248f3d98dac238f175b libm.patch +7ba4dea8fc5c285e4837f9e33d835083 checkvm-pie-safety.patch +2606c0d5b180a77634ad26343d68852d resume-vm-default.patch +c6d7a6640bb26c22e632aea21b04227b suspend-vm-default.patch +c79ca03660fa75d00028325f53a37b4e open-vm-tools.initd +b56e3e6ebde04054b27e23e7c6d0d22c open-vm.initd +2570d31a242f40eae8f8f2517536dd5f open-vm.confd" diff --git a/testing/open-vm-tools/checkvm-pie-safety.patch b/testing/open-vm-tools/checkvm-pie-safety.patch new file mode 100644 index 000000000..5a879c94b --- /dev/null +++ b/testing/open-vm-tools/checkvm-pie-safety.patch @@ -0,0 +1,67 @@ +From: Gordon Malm <gengor@gentoo.org> + +Make inline asm PIC-safe (do not clobber ebx). + +Thanks and credit to Anthony Basile for all his help and testing. + +Reference: http://bugs.gentoo.org/200376 + +--- a/checkvm/checkvm.c ++++ b/checkvm/checkvm.c +@@ -79,8 +79,16 @@ + { + uint32 eax, ebx, ecx, edx; + +- __asm__ volatile("inl (%%dx)" : +- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++ __asm__ volatile( ++#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler. ++ "movl %%ebx, %3 \n\t" ++ "inl (%%dx) \n\t" ++ "xchgl %%ebx, %3 \n\t" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : ++#else ++ "inl (%%dx)" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++#endif + "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION), + "2"(BDOOR_PORT) : "memory"); + version[0] = eax; +@@ -96,8 +104,16 @@ + { + uint32 eax, ebx, ecx, edx; + +- __asm__ volatile("inl (%%dx)" : +- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++ __asm__ volatile( ++#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler. ++ "movl %%ebx, %3 \n\t" ++ "inl (%%dx) \n\t" ++ "xchgl %%ebx, %3 \n\t" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : ++#else ++ "inl (%%dx)" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++#endif + "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION), + "2"(BDOOR_PORT) : "memory"); + *hwVersion = eax; +@@ -112,8 +128,16 @@ + { + uint32 eax, ebx, ecx, edx; + +- __asm__ volatile("inl (%%dx)" : +- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++ __asm__ volatile( ++#if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler. ++ "movl %%ebx, %3 \n\t" ++ "inl (%%dx) \n\t" ++ "xchgl %%ebx, %3 \n\t" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=r"(ebx) : ++#else ++ "inl (%%dx)" : ++ "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : ++#endif + "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE), + "2"(BDOOR_PORT) : "memory"); + *screensize = eax; diff --git a/testing/open-vm-tools/codeset-uclibc.patch b/testing/open-vm-tools/codeset-uclibc.patch new file mode 100644 index 000000000..b26df1661 --- /dev/null +++ b/testing/open-vm-tools/codeset-uclibc.patch @@ -0,0 +1,20 @@ +--- ./lib/misc/codesetOld.c.orig ++++ ./lib/misc/codesetOld.c +@@ -723,7 +723,7 @@ + { + char *codeset; + +-#if defined(__linux__) ++#if defined(__linux__) && !defined(__UCLIBC__) + + locale_t new = newlocale(LC_CTYPE_MASK, "", NULL); + if (!new) { +@@ -739,7 +739,7 @@ + codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new)); + freelocale(new); + +-#elif defined(sun) ++#elif defined(sun) || defined(__UCLIBC__) + + char *locale = setlocale(LC_CTYPE, NULL); + if (!setlocale(LC_CTYPE, "")) { diff --git a/testing/open-vm-tools/ecvt.patch b/testing/open-vm-tools/ecvt.patch new file mode 100644 index 000000000..53e88e998 --- /dev/null +++ b/testing/open-vm-tools/ecvt.patch @@ -0,0 +1,205 @@ +commit e996e91ca5951c50769dcaa8e074daa973006849 +Author: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu Jul 8 06:39:36 2010 +0000 + + add ecvt() implementation + +diff --git a/lib/string/Makefile.am b/lib/string/Makefile.am +index 1edab81..5f2e7ab 100644 +--- a/lib/string/Makefile.am ++++ b/lib/string/Makefile.am +@@ -23,6 +23,7 @@ libString_la_SOURCES += bsd_vsnprintf.c + libString_la_SOURCES += bsd_vsnwprintf.c + libString_la_SOURCES += convertutf.c + libString_la_SOURCES += str.c ++libString_la_SOURCES += ecvt.c + + AM_CFLAGS = @LIB_STRING_CPPFLAGS@ + +diff --git a/lib/string/bsd_output_shared.c b/lib/string/bsd_output_shared.c +index 3616947..321d6f1 100644 +--- a/lib/string/bsd_output_shared.c ++++ b/lib/string/bsd_output_shared.c +@@ -64,6 +64,9 @@ + + #ifndef NO_FLOATING_POINT + ++extern char* ecvt(double arg, int ndigits, int *decptp, int *signp); ++extern char* fcvt(double arg, int ndigits, int *decptp, int *signp); ++ + /* + *----------------------------------------------------------------------------- + * +diff --git a/lib/string/ecvt.c b/lib/string/ecvt.c +new file mode 100644 +index 0000000..1979c3d +--- /dev/null ++++ b/lib/string/ecvt.c +@@ -0,0 +1,167 @@ ++/* ++ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ++ * ++ * @APPLE_LICENSE_HEADER_START@ ++ * ++ * This file contains Original Code and/or Modifications of Original Code ++ * as defined in and that are subject to the Apple Public Source License ++ * Version 2.0 (the 'License'). You may not use this file except in ++ * compliance with the License. Please obtain a copy of the License at ++ * http://www.opensource.apple.com/apsl/ and read it before using this ++ * file. ++ * ++ * The Original Code and all software distributed under the License are ++ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER ++ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ++ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. ++ * Please see the License for the specific language governing rights and ++ * limitations under the License. ++ * ++ * @APPLE_LICENSE_HEADER_END@ ++ */ ++/* ++ * ecvt converts to decimal ++ * the number of digits is specified by ndigit ++ * decptp is set to the position of the decimal point ++ * signp is set to 0 for positive, 1 for negative ++ */ ++ ++ ++static double ecvt_rint(double x); ++ ++static char *cvt(); ++ ++/* big enough to handle %.20f conversion of 1e308 */ ++#define NDIG 350 ++ ++char* ++ecvt(arg, ndigits, decptp, signp) ++double arg; ++int ndigits, *decptp, *signp; ++{ ++ return(cvt(arg, ndigits, decptp, signp, 1)); ++} ++ ++char* ++fcvt(arg, ndigits, decptp, signp) ++double arg; ++int ndigits, *decptp, *signp; ++{ ++ return(cvt(arg, ndigits, decptp, signp, 0)); ++} ++ ++static char* ++cvt(arg, ndigits, decptp, signp, eflag) ++double arg; ++int ndigits, *decptp, *signp; ++int eflag; ++{ ++ register int decpt; ++ double fi, fj; ++ register char *p, *p1; ++ static char buf[NDIG] = { 0 }; ++ double modf(); ++ ++ if (ndigits < 0) ++ ndigits = 0; ++ if (ndigits >= NDIG-1) ++ ndigits = NDIG-2; ++ ++ decpt = 0; ++ *signp = 0; ++ p = &buf[0]; ++ ++ if (arg == 0) { ++ *decptp = 0; ++ while (p < &buf[ndigits]) ++ *p++ = '0'; ++ *p = '\0'; ++ return(buf); ++ } else if (arg < 0) { ++ *signp = 1; ++ arg = -arg; ++ } ++ ++ arg = modf(arg, &fi); ++ p1 = &buf[NDIG]; ++ ++ /* ++ * Do integer part ++ */ ++ if (fi != 0) { ++ while (fi != 0) { ++ fj = modf(fi/10, &fi); ++ /**--p1 = (int)((fj+.03)*10) + '0';*/ ++ *--p1 = (int)ecvt_rint((fj)*10) + '0'; ++ decpt++; ++ } ++ while (p1 < &buf[NDIG]) ++ *p++ = *p1++; ++ } else if (arg > 0) { ++ while ((fj = arg*10) < 1) { ++ arg = fj; ++ decpt--; ++ } ++ } ++ *decptp = decpt; ++ ++ /* ++ * do fraction part ++ * p pts to where fraction should be concatenated ++ * p1 is how far conversion must go to ++ */ ++ p1 = &buf[ndigits]; ++ if (eflag==0) { ++ /* fcvt must provide ndigits after decimal pt */ ++ p1 += decpt; ++ /* if decpt was negative, we might done for fcvt */ ++ if (p1 < &buf[0]) { ++ buf[0] = '\0'; ++ return(buf); ++ } ++ } ++ while (p <= p1 && p < &buf[NDIG]) { ++ arg *= 10; ++ arg = modf(arg, &fj); ++ *p++ = (int)fj + '0'; ++ } ++ /* ++ * if we converted all the way to the end of the ++ * buf, don't mess with rounding since there's nothing ++ * significant out here anyway ++ */ ++ if (p1 >= &buf[NDIG]) { ++ buf[NDIG-1] = '\0'; ++ return(buf); ++ } ++ /* ++ * round by adding 5 to last digit and propagating ++ * carries ++ */ ++ p = p1; ++ *p1 += 5; ++ while (*p1 > '9') { ++ *p1 = '0'; ++ if (p1 > buf) ++ ++*--p1; ++ else { ++ *p1 = '1'; ++ (*decptp)++; ++ if (eflag == 0) { ++ if (p > buf) ++ *p = '0'; ++ p++; ++ } ++ } ++ } ++ *p = '\0'; ++ return(buf); ++} ++ ++static double ecvt_rint(double x) ++{ ++ asm("frndint" : "=t" (x) : "0" (x)); ++ return(x); ++} ++ diff --git a/testing/open-vm-tools/getloadavg-uclibc.patch b/testing/open-vm-tools/getloadavg-uclibc.patch new file mode 100644 index 000000000..247bd7037 --- /dev/null +++ b/testing/open-vm-tools/getloadavg-uclibc.patch @@ -0,0 +1,22 @@ +diff --git a/lib/misc/hostinfoPosix.c b/lib/misc/hostinfoPosix.c +index eeeb620..67387be 100644 +--- a/lib/misc/hostinfoPosix.c ++++ b/lib/misc/hostinfoPosix.c +@@ -1355,8 +1355,16 @@ HostinfoGetLoadAverage(float *avg0, // IN/OUT: + float *avg1, // IN/OUT: + float *avg2) // IN/OUT: + { ++#if defined(__UCLIBC__) ++ FILE *f; ++ if ((f = fopen("/proc/loadavg", "r")) == NULL) ++ return FALSE; ++ fscanf(f, "%f %f %f", avg0, avg1, avg2); ++ fclose(f); ++ return TRUE; ++ + /* getloadavg(3) was introduced with glibc 2.2 */ +-#if defined(GLIBC_VERSION_22) || defined(__APPLE__) ++#elif defined(GLIBC_VERSION_22) || defined(__APPLE__) + double avg[3]; + int res; + diff --git a/testing/open-vm-tools/iconv-uclibc.patch b/testing/open-vm-tools/iconv-uclibc.patch new file mode 100644 index 000000000..6b256db88 --- /dev/null +++ b/testing/open-vm-tools/iconv-uclibc.patch @@ -0,0 +1,12 @@ +--- ./configure.ac.orig ++++ ./configure.ac +@@ -1059,6 +1059,9 @@ + AC_DEFINE([NO_MULTIMON], 1, [Define to 1 if building without multimon support.]) + fi + ++AM_ICONV ++LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $LIBICONV" ++ + if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" + fi diff --git a/testing/open-vm-tools/libm.patch b/testing/open-vm-tools/libm.patch new file mode 100644 index 000000000..cd013f4d2 --- /dev/null +++ b/testing/open-vm-tools/libm.patch @@ -0,0 +1,18 @@ +--- a/hgfsmounter/Makefile.am ++++ b/hgfsmounter/Makefile.am +@@ -23,6 +23,7 @@ + mount_vmhgfs_LDADD += ../lib/panicDefault/libPanicDefault.la + mount_vmhgfs_LDADD += ../lib/panic/libPanic.la + mount_vmhgfs_LDADD += ../lib/stubs/libStubs.la ++mount_vmhgfs_LDADD += -lm + + mount_vmhgfs_SOURCES = + mount_vmhgfs_SOURCES += hgfsmounter.c +--- a/rpctool/Makefile.am ++++ b/rpctool/Makefile.am +@@ -25,4 +25,5 @@ + vmware_rpctool_LDADD += ../lib/message/libMessage.la + vmware_rpctool_LDADD += ../lib/backdoor/libBackdoor.la + vmware_rpctool_LDADD += ../lib/string/libString.la ++vmware_rpctool_LDADD += -lm + diff --git a/testing/open-vm-tools/open-vm-tools.desktop b/testing/open-vm-tools/open-vm-tools.desktop new file mode 100644 index 000000000..2107a62e0 --- /dev/null +++ b/testing/open-vm-tools/open-vm-tools.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Exec=vmware-user +Name=VMware User Agent +X-KDE-autostart-phase=1 +NoDisplay=true diff --git a/testing/open-vm-tools/open-vm-tools.initd b/testing/open-vm-tools/open-vm-tools.initd new file mode 100644 index 000000000..ee85c4d29 --- /dev/null +++ b/testing/open-vm-tools/open-vm-tools.initd @@ -0,0 +1,76 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/open-vm-tools/files/open-vm-tools.initd,v 1.2 2009/12/20 14:05:43 vadimk Exp $ + +DND_TMPDIR="/tmp/VMwareDnD" +USER_GROUP="root:vmware" +DND_TMPDIR_PERMS="1777" +GUESTD_BIN="/usr/bin/vmtoolsd" +PIDFILE="/var/run/vmtoolsd.pid" +MOUNTPOINT="/proc/fs/vmblock/mountPoint" + +depend() { + before checkfs fsck net X +} + +start() { + if [ "${VM_DRAG_AND_DROP}" == "yes" ]; + then + + if ! grep -q -w vmblock /proc/modules; + then + ebegin "Loading vmblock module" + modprobe vmblock + eend $? + sleep 0.25 + fi + + if [[ ! -d "${DND_TMPDIR}" ]]; + then + # einfo "Creating the VM drag and drop directory" + mkdir "${DND_TMPDIR}" + chown "${USER_GROUP}" "${DND_TMPDIR}" + chmod "${DND_TMPDIR_PERMS}" "${DND_TMPDIR}" + fi + + # DnD_TMPDIR must exist before vmblock can be mounted + ebegin "Mounting vmblock device" + mount -t vmblock none ${MOUNTPOINT} + eend $? + fi + + ebegin "Starting vmtoolsd" + start-stop-daemon --chuid "${USER_GROUP}" --start --quiet --background --make-pidfile --pidfile "${PIDFILE}" --exec ${GUESTD_BIN} + eend $? +} + +stop() { + local ret + + if [ "${VM_DRAG_AND_DROP}" == "yes" ]; + then + ebegin "Cleaning the contents of ${DND_TMPDIR}" + # First check, whether ${DND_TMPDIR} isn valid... we shouldn't risk deleting the content of ""/* + if [[ ! -z "${DND_TMPDIR}" ]] && [[ "${DND_TMPDIR}" != "/" ]]; + then + rm -rf ${DND_TMPDIR}/* + ret=0 + else + eerror "Not cleaning up ${DND_TMPDIR}, please check definition of variable" + ret=1 + fi + eend $ret + + ebegin "Unmounting vmblock device" + if grep -q -w "${MOUNTPOINT}" /proc/mounts; + then + umount ${MOUNTPOINT} 1>&2 > /dev/null + fi + eend 0 + fi + + ebegin "Stopping vmtoolsd" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" + eend $? +} diff --git a/testing/open-vm-tools/open-vm.confd b/testing/open-vm-tools/open-vm.confd new file mode 100644 index 000000000..4414fabdb --- /dev/null +++ b/testing/open-vm-tools/open-vm.confd @@ -0,0 +1,2 @@ +# Set this to no to disable drag and drop (and vmblock) loading. +VM_DRAG_AND_DROP="yes" diff --git a/testing/open-vm-tools/open-vm.initd b/testing/open-vm-tools/open-vm.initd new file mode 100644 index 000000000..d4f96cc87 --- /dev/null +++ b/testing/open-vm-tools/open-vm.initd @@ -0,0 +1,76 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/open-vm-tools/files/open-vm.initd,v 1.2 2008/02/01 12:33:36 flameeyes Exp $ + +DND_TMPDIR="/tmp/VMwareDnD" +USER_GROUP="root:vmware" +DND_TMPDIR_PERMS="1777" +GUESTD_BIN="/usr/sbin/vmware-guestd" +PIDFILE="/var/run/vmware-guestd.pid" +MOUNTPOINT="/proc/fs/vmblock/mountPoint" + +depend() { + before checkfs fsck net X +} + +start() { + if [ "${VM_DRAG_AND_DROP}" == "yes" ]; + then + + if ! grep -q -w vmblock /proc/modules; + then + ebegin "Loading vmblock module" + modprobe vmblock + eend $? + sleep 0.25 + fi + + if [[ ! -d "${DND_TMPDIR}" ]]; + then + # einfo "Creating the VM drag and drop directory" + mkdir "${DND_TMPDIR}" + chown "${USER_GROUP}" "${DND_TMPDIR}" + chmod "${DND_TMPDIR_PERMS}" "${DND_TMPDIR}" + fi + + # DnD_TMPDIR must exist before vmblock can be mounted + ebegin "Mounting vmblock device" + mount -t vmblock none ${MOUNTPOINT} + eend $? + fi + + ebegin "Starting vmware-guestd" + start-stop-daemon --chuid "${USER_GROUP}" --start --quiet --exec ${GUESTD_BIN} -- --background "${PIDFILE}" + eend $? +} + +stop() { + local ret + + if [ "${VM_DRAG_AND_DROP}" == "yes" ]; + then + ebegin "Cleaning the contents of ${DND_TMPDIR}" + # First check, whether ${DND_TMPDIR} isn valid... we shouldn't risk deleting the content of ""/* + if [[ ! -z "${DND_TMPDIR}" ]] && [[ "${DND_TMPDIR}" != "/" ]]; + then + rm -rf ${DND_TMPDIR}/* + ret=0 + else + eerror "Not cleaning up ${DND_TMPDIR}, please check definition of variable" + ret=1 + fi + eend $ret + + ebegin "Unmounting vmblock device" + if grep -q -w "${MOUNTPOINT}" /proc/mounts; + then + umount ${MOUNTPOINT} 1>&2 > /dev/null + fi + eend 0 + fi + + ebegin "Stopping vmware-guestd" + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" + eend $? +} diff --git a/testing/open-vm-tools/resume-vm-default.patch b/testing/open-vm-tools/resume-vm-default.patch new file mode 100644 index 000000000..4d89a47f5 --- /dev/null +++ b/testing/open-vm-tools/resume-vm-default.patch @@ -0,0 +1,49 @@ +--- ./scripts/linux/resume-vm-default.orig ++++ ./scripts/linux/resume-vm-default +@@ -25,37 +25,6 @@ + echo `date` ": Executing '$0'" + echo + +-find_networking_script() { +- local script="error" +- for dir in "/etc/init.d" "/sbin/init.d" "/etc" "/etc/rc.d" ; do +- if [ -d "$dir/rc0.d" ] && +- [ -d "$dir/rc1.d" ] && +- [ -d "$dir/rc2.d" ] && +- [ -d "$dir/rc3.d" ] && +- [ -d "$dir/rc4.d" ] && +- [ -d "$dir/rc5.d" ] && +- [ -d "$dir/rc6.d" ]; then +- +- # Now find the appropriate networking script. +- if [ -d "$dir/init.d" ]; then +- if [ -x "$dir/init.d/network" ]; then +- script="$dir/init.d/network" +- elif [ -x "$dir/init.d/networking" ]; then +- script="$dir/init.d/networking" +- fi +- else +- if [ -x "$dir/network" ]; then +- script="$dir/network" +- elif [ -x "$dir/networking" ]; then +- script="$dir/networking" +- fi +- fi +- fi +- done +- +- echo "$script" +-} +- + rescue_NIC() { + niclist="/var/run/vmware-active-nics" + +@@ -121,7 +90,7 @@ + + wakeNetworkManager + +-network=`find_networking_script` ++network=/etc/init.d/networking + if [ "$network" != "error" ]; then + "$network" restart + # Continue even if the networking init script wasn't successful. diff --git a/testing/open-vm-tools/suspend-vm-default.patch b/testing/open-vm-tools/suspend-vm-default.patch new file mode 100644 index 000000000..38f8ae71d --- /dev/null +++ b/testing/open-vm-tools/suspend-vm-default.patch @@ -0,0 +1,49 @@ +--- a/scripts/linux/suspend-vm-default.org 2009-05-13 15:02:03.000000000 +0400 ++++ b/scripts/linux/suspend-vm-default 2009-05-13 15:05:18.394228810 +0400 +@@ -25,37 +25,6 @@ + echo `date` ": Executing '$0'" + echo + +-find_networking_script() { +- local script="error" +- for dir in "/etc/init.d" "/sbin/init.d" "/etc" "/etc/rc.d" ; do +- if [ -d "$dir/rc0.d" ] && +- [ -d "$dir/rc1.d" ] && +- [ -d "$dir/rc2.d" ] && +- [ -d "$dir/rc3.d" ] && +- [ -d "$dir/rc4.d" ] && +- [ -d "$dir/rc5.d" ] && +- [ -d "$dir/rc6.d" ]; then +- +- # Now find the appropriate networking script. +- if [ -d "$dir/init.d" ]; then +- if [ -x "$dir/init.d/network" ]; then +- script="$dir/init.d/network" +- elif [ -x "$dir/init.d/networking" ]; then +- script="$dir/init.d/networking" +- fi +- else +- if [ -x "$dir/network" ]; then +- script="$dir/network" +- elif [ -x "$dir/networking" ]; then +- script="$dir/networking" +- fi +- fi +- fi +- done +- +- echo "$script" +-} +- + save_active_NIC_list() { + ifconfig_path=`which ifconfig 2>/dev/null` + if [ $? ]; then +@@ -76,7 +45,7 @@ + + save_active_NIC_list + +-network=`find_networking_script` ++network=/etc/init.d/networking + if [ "$network" != "error" ]; then + "$network" stop + # If the network is down, this may fail but that's not a good reason |