Index: head/emulators/open-vm-tools/Makefile =================================================================== --- head/emulators/open-vm-tools/Makefile (revision 448928) +++ head/emulators/open-vm-tools/Makefile (revision 448929) @@ -1,100 +1,99 @@ # Created by: mbr@FreeBSD.org # $FreeBSD$ PORTNAME= open-vm-tools PORTVERSION= ${RELEASE_VER} DISTVERSIONPREFIX= stable- PORTEPOCH= 2 -PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= jpaetzel@FreeBSD.org COMMENT?= Open VMware tools for FreeBSD VMware guests LICENSE= LGPL21 LICENSE_FILE= ${WRKSRC}/COPYING +ONLY_FOR_ARCHS= amd64 i386 + LIB_DEPENDS= libmspack.so:archivers/libmspack \ libxerces-c.so:textproc/xerces-c3 \ libxml-security-c.so:security/apache-xml-security-c -RELEASE_VER= 10.1.5 -BUILD_VER= 5055683 +RELEASE_VER= 10.1.10 +BUILD_VER= 6082533 OPTIONS_DEFINE= DNET ICU LIBNOTIFY OPENSSL X11 OPTIONS_DEFAULT= DNET ICU LIBNOTIFY OPENSSL X11 OPTIONS_SUB= DNET_DESC= libdnet support LIBNOTIFY_DESC= Desktop notification support X11_CONFIGURE_WITH= x gtk2 gtkmm X11_USE= xorg=ice,sm,x11,xext,xi,xinerama,xineramaproto,xrandr,xrender,xtst \ gnome=gdkpixbuf2,gtk20,gtkmm24 X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 LIBNOTIFY_LIB_DEPENDS= libnotify.so:devel/libnotify DNET_CONFIGURE_WITH= dnet DNET_LIB_DEPENDS= libdnet.so:net/libdnet ICU_CONFIGURE_WITH= icu ICU_LIB_DEPENDS= libicuuc.so:devel/icu OPENSSL_CONFIGURE_WITH= ssl WRKSRC_SUBDIR= open-vm-tools GNU_CONFIGURE= yes -USE_GNOME= glib20 USES= autoreconf:-iv fuse gettext-runtime kmod libtool localbase pathfix pkgconfig +USE_GNOME= glib20 USE_GITHUB= yes GH_ACCOUNT= vmware USE_LDCONFIG= yes CPPFLAGS+= -Wno-deprecated-declarations SSP_UNSAFE= kernel module does not support ssp CONFIGURE_ARGS+= --disable-grabbitmqproxy \ --disable-vgauth --without-procps \ --sysconfdir=${PREFIX}/etc CONFLICTS+= vmware-guestd[0-9]* vmware-tools[0-9]* USE_RC_SUBR= vmware-guestd vmware-kmod INSTALL_TARGET= install-strip .include .if ${PORT_OPTIONS:MX11} CONFLICTS= open-vm-tools-nox11-[0-9]* .else CONFLICTS= open-vm-tools-[0-9]* .endif - -ONLY_FOR_ARCHS= i386 amd64 CONFIGURE_ENV+= SYSDIR=${SRC_BASE}/sys .include post-patch: @${REINPLACE_CMD} -e "s@%%PREFIX%%@${PREFIX}@"\ ${WRKSRC}/lib/guestApp/guestApp.c post-build: cd ${WRKSRC}/modules && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/input ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmblock.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmblock.ko ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmmemctl.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmmemctl.ko ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmxnet.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmxnet.ko ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/vmware/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/tests/ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.conf.d .include Index: head/emulators/open-vm-tools/distinfo =================================================================== --- head/emulators/open-vm-tools/distinfo (revision 448928) +++ head/emulators/open-vm-tools/distinfo (revision 448929) @@ -1,3 +1,3 @@ -TIMESTAMP = 1501156965 -SHA256 (vmware-open-vm-tools-stable-10.1.5_GH0.tar.gz) = aba7bf570b8951b61784941460659c204359d98fcbfb164df3c30d468a19fb1c -SIZE (vmware-open-vm-tools-stable-10.1.5_GH0.tar.gz) = 3540164 +TIMESTAMP = 1503010753 +SHA256 (vmware-open-vm-tools-stable-10.1.10_GH0.tar.gz) = ce03c8827389ea272a5c072366b6bff381b2eddad94750c6a9433a0dea61c762 +SIZE (vmware-open-vm-tools-stable-10.1.10_GH0.tar.gz) = 3543342 Index: head/emulators/open-vm-tools/files/patch-scripts_freebsd_network =================================================================== --- head/emulators/open-vm-tools/files/patch-scripts_freebsd_network (revision 448928) +++ head/emulators/open-vm-tools/files/patch-scripts_freebsd_network (nonexistent) @@ -1,10 +0,0 @@ ---- scripts/freebsd/network.orig 2017-02-24 22:15:37 UTC -+++ scripts/freebsd/network -@@ -59,6 +59,7 @@ ToggleNetwork() { - - for intf in `list_net_interfaces dhcp`; do - /etc/rc.d/netif $1 $intf -+ /etc/rc.d/dhclient $1 $intf - ec=$? - - # Failure to stop an interface should not interfere with suspend. Property changes on: head/emulators/open-vm-tools/files/patch-scripts_freebsd_network ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_hgfsServer_hgfsServerLinux.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_hgfsServer_hgfsServerLinux.c (nonexistent) +++ head/emulators/open-vm-tools/files/patch-lib_hgfsServer_hgfsServerLinux.c (revision 448929) @@ -0,0 +1,15 @@ +--- lib/hgfsServer/hgfsServerLinux.c.orig 2017-07-28 21:59:15 UTC ++++ lib/hgfsServer/hgfsServerLinux.c +@@ -178,6 +178,12 @@ getdents_linux(unsigned int fd, + # endif + } + # define getdents getdents_linux ++#elif defined(__FreeBSD__) && defined(__INO64) ++#define getdents(fd, dirp, count) \ ++({ \ ++ off_t basep; \ ++ getdirentries(fd, dirp, count, &basep); \ ++}) + #elif defined(__FreeBSD__) + #define getdents(fd, dirp, count) \ + ({ \ Property changes on: head/emulators/open-vm-tools/files/patch-lib_hgfsServer_hgfsServerLinux.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_include_guest__os.h =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_include_guest__os.h (nonexistent) +++ head/emulators/open-vm-tools/files/patch-lib_include_guest__os.h (revision 448929) @@ -0,0 +1,12 @@ +--- lib/include/guest_os.h.orig 2017-07-28 21:59:15 UTC ++++ lib/include/guest_os.h +@@ -493,7 +493,8 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set); + #define STR_OS_WIN_64_BIT_EXTENSION ", 64-bit" + + /* FreeBSD */ +-#define STR_OS_FREEBSD "freeBSD" ++#define STR_OS_FREEBSD "freeBSD" ++#define STR_OS_FREEBSD11 "freeBSD11" + + /* Solaris */ + #define STR_OS_SOLARIS "solaris" Property changes on: head/emulators/open-vm-tools/files/patch-lib_include_guest__os.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-lib_misc_hostinfoPosix.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_misc_hostinfoPosix.c (nonexistent) +++ head/emulators/open-vm-tools/files/patch-lib_misc_hostinfoPosix.c (revision 448929) @@ -0,0 +1,53 @@ +--- lib/misc/hostinfoPosix.c.orig 2017-07-28 21:59:15 UTC ++++ lib/misc/hostinfoPosix.c +@@ -1,5 +1,5 @@ + /********************************************************* +- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved. ++ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published +@@ -1080,28 +1080,32 @@ HostinfoOSData(void) + + Str_Strcpy(osName, distroShort, sizeof osName); + } else if (strstr(osNameFull, "FreeBSD")) { +- size_t nameLen = sizeof STR_OS_FREEBSD - 1; +- size_t releaseLen = 0; +- char *dashPtr; ++ char distroShort[DISTRO_BUF_SIZE]; ++ int majorVersion; + + /* +- * FreeBSD releases report their version as "x.y-RELEASE". We'll be +- * naive look for the first dash, and use everything before it as the +- * version number. ++ * FreeBSD releases report their version as "x.y-RELEASE". + */ + +- dashPtr = Str_Strchr(buf.release, '-'); +- if (dashPtr != NULL) { +- releaseLen = dashPtr - buf.release; ++ majorVersion = Hostinfo_OSVersion(0); ++ ++ /* ++ * FreeBSD 11 and later are identified using ++ * a different guestId. ++ */ ++ if (majorVersion >= 11) { ++ Str_Strcpy(distroShort, STR_OS_FREEBSD11, sizeof distroShort); ++ } else { ++ Str_Strcpy(distroShort, STR_OS_FREEBSD, sizeof distroShort); + } + +- if (nameLen + releaseLen + 1 > sizeof osName) { ++ if (strlen(distroShort) + 1 > sizeof osName) { + Warning("%s: Error: buffer too small\n", __FUNCTION__); + + return FALSE; + } + +- Str_Strcpy(osName, STR_OS_FREEBSD, sizeof osName); ++ Str_Strcpy(osName, distroShort, sizeof osName); + } else if (strstr(osNameFull, "SunOS")) { + size_t nameLen = sizeof STR_OS_SOLARIS - 1; + size_t releaseLen = 0; Property changes on: head/emulators/open-vm-tools/files/patch-lib_misc_hostinfoPosix.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c =================================================================== --- head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c (revision 448928) +++ head/emulators/open-vm-tools/files/patch-modules_freebsd_vmmemctl_os.c (revision 448929) @@ -1,129 +1,112 @@ ---- modules/freebsd/vmmemctl/os.c.orig 2017-02-24 14:15:37.000000000 -0800 -+++ modules/freebsd/vmmemctl/os.c 2017-08-15 13:54:03.813152000 -0700 +--- modules/freebsd/vmmemctl/os.c.orig 2017-07-28 21:59:15 UTC ++++ modules/freebsd/vmmemctl/os.c @@ -37,9 +37,11 @@ #include #include #include +#include #include #include #include +#include #include #include -@@ -223,7 +225,11 @@ static __inline__ unsigned long os_ffz(u - unsigned long - OS_ReservedPageGetLimit(void) - { +@@ -83,6 +85,30 @@ typedef struct { + MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl metadata"); + + /* ++ * FreeBSD version specific MACROS ++ */ ++#if __FreeBSD_version >= 900000 ++ #define VM_PAGE_LOCK(page) vm_page_lock(page); ++ #define VM_PAGE_UNLOCK(page) vm_page_unlock(page) ++#else ++ #define VM_PAGE_LOCK(page) vm_page_lock_queues() ++ #define VM_PAGE_UNLOCK(page) vm_page_unlock_queues() ++#endif ++ ++#if __FreeBSD_version > 1000029 ++ #define VM_OBJ_LOCK(object) VM_OBJECT_WLOCK(object) ++ #define VM_OBJ_UNLOCK(object) VM_OBJECT_WUNLOCK(object); ++#else ++ #define VM_OBJ_LOCK(object) VM_OBJECT_LOCK(object); ++ #define VM_OBJ_UNLOCK(object) VM_OBJECT_UNLOCK(object); ++#endif ++ +#if __FreeBSD_version < 1100015 - return cnt.v_page_count; ++ #define VM_SYS_PAGES cnt.v_page_count +#else -+ return vm_cnt.v_page_count; ++ #define VM_SYS_PAGES vm_cnt.v_page_count +#endif ++/* + * Globals + */ + +@@ -223,7 +249,7 @@ static __inline__ unsigned long os_ffz(unsigned long w + unsigned long + OS_ReservedPageGetLimit(void) + { +- return cnt.v_page_count; ++ return VM_SYS_PAGES; } -@@ -369,7 +375,11 @@ static void +@@ -369,7 +395,7 @@ static void os_pmap_alloc(os_pmap *p) // IN { /* number of pages (div. 8) */ -+#if __FreeBSD_version < 1100015 - p->size = (cnt.v_page_count + 7) / 8; -+#else -+ p->size = (vm_cnt.v_page_count + 7) / 8; -+#endif +- p->size = (cnt.v_page_count + 7) / 8; ++ p->size = (VM_SYS_PAGES + 7) / 8; /* * expand to nearest word boundary -@@ -392,6 +402,7 @@ os_pmap_free(os_pmap *p) // IN - #if __FreeBSD_version < 1000000 - kmem_free(kernel_map, (vm_offset_t)p->bitmap, p->size); - #else -+// kva_free((vm_offset_t)p->bitmap, p->size); - kmem_free(kernel_arena, (vm_offset_t)p->bitmap, p->size); - #endif - p->size = 0; -@@ -466,12 +477,36 @@ os_kmem_free(vm_page_t page) // IN +@@ -466,12 +492,14 @@ os_kmem_free(vm_page_t page) // IN os_state *state = &global_state; os_pmap *pmap = &state->pmap; - if ( !vm_page_lookup(state->vmobject, page->pindex) ) { - return; -+// if ( !vm_page_lookup(state->vmobject, page->pindex) ) { -+// return; -+// } -+ -+// os_pmap_putindex(pmap, page->pindex); -+// vm_page_free(page); -+#if __FreeBSD_version > 1000029 -+ VM_OBJECT_WLOCK(state->vmobject); -+#else -+ VM_OBJECT_LOCK(state->vmobject); -+#endif ++ VM_OBJ_LOCK(state->vmobject); + if ( vm_page_lookup(state->vmobject, page->pindex) ) { -+ os_pmap_putindex(pmap, page->pindex); -+#if __FreeBSD_version >= 900000 -+ vm_page_lock(page); -+#else -+ vm_page_lock_queues(); -+#endif -+ vm_page_free(page); -+#if __FreeBSD_version >= 900000 -+ vm_page_unlock(page); -+#else -+ vm_page_unlock_queues(); -+#endif ++ os_pmap_putindex(pmap, page->pindex); ++ VM_PAGE_LOCK(page); ++ vm_page_free(page); ++ VM_PAGE_UNLOCK(page); } - - os_pmap_putindex(pmap, page->pindex); - vm_page_free(page); -+#if __FreeBSD_version > 1000029 -+ VM_OBJECT_WUNLOCK(state->vmobject); -+#else -+ VM_OBJECT_UNLOCK(state->vmobject); -+#endif ++ VM_OBJ_UNLOCK(state->vmobject); } -@@ -483,8 +518,19 @@ os_kmem_alloc(int alloc_normal_failed) / +@@ -483,8 +511,11 @@ os_kmem_alloc(int alloc_normal_failed) // IN os_state *state = &global_state; os_pmap *pmap = &state->pmap; -+#if __FreeBSD_version > 1000029 -+ VM_OBJECT_WLOCK(state->vmobject); -+#else -+ VM_OBJECT_LOCK(state->vmobject); -+#endif ++ VM_OBJ_LOCK(state->vmobject); + pindex = os_pmap_getindex(pmap); if (pindex == (vm_pindex_t)-1) { -+#if __FreeBSD_version > 1000029 -+ VM_OBJECT_WUNLOCK(state->vmobject); -+#else -+ VM_OBJECT_UNLOCK(state->vmobject); -+#endif ++ VM_OBJ_UNLOCK(state->vmobject); return NULL; } -@@ -505,6 +551,11 @@ os_kmem_alloc(int alloc_normal_failed) / +@@ -505,6 +536,7 @@ os_kmem_alloc(int alloc_normal_failed) // IN if (!page) { os_pmap_putindex(pmap, pindex); } -+#if __FreeBSD_version > 1000029 -+ VM_OBJECT_WUNLOCK(state->vmobject); -+#else -+ VM_OBJECT_UNLOCK(state->vmobject); -+#endif ++ VM_OBJ_UNLOCK(state->vmobject); return page; } -@@ -847,7 +898,7 @@ vmmemctl_sysctl(SYSCTL_HANDLER_ARGS) +@@ -847,7 +879,7 @@ vmmemctl_sysctl(SYSCTL_HANDLER_ARGS) static void vmmemctl_init_sysctl(void) { - oid = sysctl_add_oid(NULL, SYSCTL_STATIC_CHILDREN(_vm), OID_AUTO, + oid = SYSCTL_ADD_OID(NULL, SYSCTL_STATIC_CHILDREN(_vm), OID_AUTO, BALLOON_NAME, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, vmmemctl_sysctl, "A", BALLOON_NAME_VERBOSE);