summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2016-10-09 03:41:56 +0000
committerryoon <ryoon@pkgsrc.org>2016-10-09 03:41:56 +0000
commit0e7513b42db2233773d38ffab80e2a00b07beed9 (patch)
tree48067a220cdf5ec7c67e2d985f14235aa1df464d /sysutils
parentfc56c0645e2c1f82a5bc0095f5bec60608d907da (diff)
downloadpkgsrc-0e7513b42db2233773d38ffab80e2a00b07beed9.tar.gz
Update to 10.0.7
The only following features are tested on NetBSD/amd64 7.99.39 without vmt(4) on VMware Workstation 12 Player 12.0.5 for Windows or ESXi 6.0u2. * Hostname and IP address report * Shutdown and reboot operations from host * Copy and paste of text string between host and guest * Guest clock sync The other features are not tested. For example, * Drag and drop between host and guest * VM HA, heartbeat * HGFS, shared folder Changelog: What's New VMware Tools is a suite of utilities that enhances the performance of the virtual machine's guest operating system and improves management of the virtual machine. Read about the new and enhanced features in this release below: Common versioning: Infrastructure changes to enable reporting of the true version of open-vm-tools. This feature is dependent on host support. Quiesced snapshots enhancements for Linux guests running IO workload: Robustness related enhancements in quiesced snapshot operation. The vmtoolsd service supports caching of log messages when guest IO has been quiesced. Enhancements in the vmbackup plugin use a separate thread to quiesce the guest OS to avoid timeout issues due to heavy I/O in the guest. Shared Folders: For Linux distributions with kernel version 4.0.0 and higher, there is a new FUSE based Shared Folders client which is used as a replacement for the kernel mode client. ESXi Serviceability: Default vmtoolsd logging is directed to a file instead of syslog. vmware-toolbox-cmd is enhanced for setting vmtoolsd logging levels. GuestInfo Enhancements: Plugin enhancements to report more than 64 IP addresses from the guest. These enhancements will be available only after upgrading the host because the guest IP addresses limit also exists on the host side. Internationalization open-vm-tools 10.0.0 supports the following languages: English French German Spanish Italian Japanese Korean Simplified Chinese Traditional Chinese Compatibility open-vm-tools 10.0.0 is compatible with all supported versions of VMware vSphere, VMware Workstation 12.0 and VMware Fusion 8.0.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/open-vm-tools/Makefile23
-rw-r--r--sysutils/open-vm-tools/PLIST.common42
-rw-r--r--sysutils/open-vm-tools/PLIST.x119
-rw-r--r--sysutils/open-vm-tools/distinfo120
-rwxr-xr-xsysutils/open-vm-tools/files/vmtools.sh4
-rw-r--r--sysutils/open-vm-tools/options.mk9
-rw-r--r--sysutils/open-vm-tools/patches/patch-ac23
-rw-r--r--sysutils/open-vm-tools/patches/patch-ad22
-rw-r--r--sysutils/open-vm-tools/patches/patch-ae49
-rw-r--r--sysutils/open-vm-tools/patches/patch-ag6
-rw-r--r--sysutils/open-vm-tools/patches/patch-ah47
-rw-r--r--sysutils/open-vm-tools/patches/patch-ai24
-rw-r--r--sysutils/open-vm-tools/patches/patch-aj14
-rw-r--r--sysutils/open-vm-tools/patches/patch-ak58
-rw-r--r--sysutils/open-vm-tools/patches/patch-am20
-rw-r--r--sysutils/open-vm-tools/patches/patch-an72
-rw-r--r--sysutils/open-vm-tools/patches/patch-ao14
-rw-r--r--sysutils/open-vm-tools/patches/patch-ap14
-rw-r--r--sysutils/open-vm-tools/patches/patch-aq27
-rw-r--r--sysutils/open-vm-tools/patches/patch-ar10
-rw-r--r--sysutils/open-vm-tools/patches/patch-as47
-rw-r--r--sysutils/open-vm-tools/patches/patch-at34
-rw-r--r--sysutils/open-vm-tools/patches/patch-au38
-rw-r--r--sysutils/open-vm-tools/patches/patch-av30
-rw-r--r--sysutils/open-vm-tools/patches/patch-aw31
-rw-r--r--sysutils/open-vm-tools/patches/patch-ax50
-rw-r--r--sysutils/open-vm-tools/patches/patch-ay18
-rw-r--r--sysutils/open-vm-tools/patches/patch-az42
-rw-r--r--sysutils/open-vm-tools/patches/patch-ba17
-rw-r--r--sysutils/open-vm-tools/patches/patch-bb89
-rw-r--r--sysutils/open-vm-tools/patches/patch-bc75
-rw-r--r--sysutils/open-vm-tools/patches/patch-bd32
-rw-r--r--sysutils/open-vm-tools/patches/patch-be31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bf202
-rw-r--r--sysutils/open-vm-tools/patches/patch-bg24
-rw-r--r--sysutils/open-vm-tools/patches/patch-bh22
-rw-r--r--sysutils/open-vm-tools/patches/patch-bi13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bj38
-rw-r--r--sysutils/open-vm-tools/patches/patch-bk31
-rw-r--r--sysutils/open-vm-tools/patches/patch-bl67
-rw-r--r--sysutils/open-vm-tools/patches/patch-bm79
-rw-r--r--sysutils/open-vm-tools/patches/patch-bn37
-rw-r--r--sysutils/open-vm-tools/patches/patch-bo37
-rw-r--r--sysutils/open-vm-tools/patches/patch-bp40
-rw-r--r--sysutils/open-vm-tools/patches/patch-bq42
-rw-r--r--sysutils/open-vm-tools/patches/patch-br16
-rw-r--r--sysutils/open-vm-tools/patches/patch-bs13
-rw-r--r--sysutils/open-vm-tools/patches/patch-bu12
-rw-r--r--sysutils/open-vm-tools/patches/patch-bv23
-rw-r--r--sysutils/open-vm-tools/patches/patch-bw22
-rw-r--r--sysutils/open-vm-tools/patches/patch-bx33
-rw-r--r--sysutils/open-vm-tools/patches/patch-by60
-rw-r--r--sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c62
-rw-r--r--sysutils/open-vm-tools/patches/patch-configure.ac45
-rw-r--r--sysutils/open-vm-tools/patches/patch-guestd_Makefile.am39
-rw-r--r--sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am15
-rw-r--r--sysutils/open-vm-tools/patches/patch-libDeployPkg_linuxDeployment.c26
-rw-r--r--sysutils/open-vm-tools/patches/patch-libDeployPkg_processPosix.c12
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_dynxdr_xdrutil.c16
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_file_file.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_guestApp_Makefile.am12
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_hgfsHelper_hgfsHelperPosix.c22
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c24
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_hgfsUri_hgfsUriPosix.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_include_sigPosixRegs.h41
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_include_vmblock__user.h24
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets.h13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_misc_hostinfoPosix.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoInt.h13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoPosix.c74
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_panic_panic.c22
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_user_util.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_user_utilBacktrace.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am14
-rw-r--r--sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am15
-rw-r--r--sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am20
-rw-r--r--sysutils/open-vm-tools/patches/patch-scripts_Makefile.am19
-rw-r--r--sysutils/open-vm-tools/patches/patch-scripts_netbsd_network108
-rw-r--r--sysutils/open-vm-tools/patches/patch-services_plugins_dndcp_dnd_dndLinux.c (renamed from sysutils/open-vm-tools/patches/patch-af)12
-rw-r--r--sysutils/open-vm-tools/patches/patch-services_plugins_timeSync_Makefile.am15
-rw-r--r--sysutils/open-vm-tools/patches/patch-services_vmtoolsd_Makefile.am25
-rw-r--r--sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am15
-rw-r--r--sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c37
-rw-r--r--sysutils/open-vm-tools/patches/patch-vgauth_common_VGAuthLog.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-vgauth_lib_common.c22
-rw-r--r--sysutils/open-vm-tools/patches/patch-vgauth_lib_impersonateLinux.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-vmblockmounter_vmblockmounter.c13
-rw-r--r--sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am15
-rw-r--r--sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c31
-rw-r--r--sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c32
91 files changed, 1128 insertions, 1781 deletions
diff --git a/sysutils/open-vm-tools/Makefile b/sysutils/open-vm-tools/Makefile
index cf7cff8c47f..583fb1ebaf4 100644
--- a/sysutils/open-vm-tools/Makefile
+++ b/sysutils/open-vm-tools/Makefile
@@ -1,17 +1,20 @@
-# $NetBSD: Makefile,v 1.58 2016/08/03 10:23:25 adam Exp $
+# $NetBSD: Makefile,v 1.59 2016/10/09 03:41:56 ryoon Exp $
-DISTNAME= open-vm-tools-2008.08.08-109361
-PKGNAME= open-vm-tools-2008.08.08.109361
-PKGREVISION= 45
+DISTNAME= open-vm-tools-10.0.7-3227872
+PKGNAME= open-vm-tools-10.0.7
CATEGORIES= sysutils
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=open-vm-tools/}
+MASTER_SITES= https://github.com/vmware/open-vm-tools/files/133266/
MAINTAINER= agc@NetBSD.org
-HOMEPAGE= http://open-vm-tools.sourceforge.net/
+HOMEPAGE= https://github.com/vmware/open-vm-tools
COMMENT= Open source VMware tools
+LICENSE= gnu-lgpl-v2.1
ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-x86_64
+CXXFLAGS+= -std=gnu++11
+BUILDLINK_TRANSFORM.NetBSD+= rm:-Werror
+
GNU_CONFIGURE= yes
USE_LANGUAGES+= c c++
USE_LIBTOOL= yes
@@ -20,6 +23,9 @@ USE_TOOLS+= pkg-config autoconf automake
PLIST_SRC= PLIST.common
CONFIGURE_ARGS+= --disable-unity --sysconfdir=${PKG_SYSCONFDIR:Q}
+CONFIGURE_ARGS+= --disable-vgauth
+CONFIGURE_ARGS+= --disable-grabbitmqproxy
+CONFIGURE_ARGS+= --disable-docs # Requires doxygen
INSTALLATION_DIRS+= ${PKG_SYSCONFDIR} share/examples/vmware-tools
@@ -28,8 +34,8 @@ EGDIR= ${PREFIX}/share/examples/vmware-tools
CONF_FILES_PERMS+= ${EGDIR}/poweroff-vm-default ${PKG_SYSCONFDIR}/poweroff-vm-default ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/poweron-vm-default ${PKG_SYSCONFDIR}/poweron-vm-default ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/resume-vm-default ${PKG_SYSCONFDIR}/resume-vm-default ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
+CONF_FILES_PERMS+= ${EGDIR}/statechange.subr ${PKG_SYSCONFDIR}/statechange.subr ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
CONF_FILES_PERMS+= ${EGDIR}/suspend-vm-default ${PKG_SYSCONFDIR}/suspend-vm-default ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
-CONF_FILES_PERMS+= ${EGDIR}/tools.conf ${PKG_SYSCONFDIR}/tools.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 644
RCD_SCRIPTS= vmtools
pre-configure:
@@ -44,8 +50,11 @@ _WRAP_EXTRA_ARGS.CC+= -Wno-error=unused-local-typedefs -Wno-error=unused-but-set
CWRAPPERS_APPEND.cc+= -Wno-error=unused-local-typedefs -Wno-error=unused-but-set-variable
.endif
+.include "../../archivers/libmspack/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
.include "../../net/libdnet/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
+.include "../../security/xml-security-c/buildlink3.mk"
.include "../../textproc/icu/buildlink3.mk"
.include "options.mk"
diff --git a/sysutils/open-vm-tools/PLIST.common b/sysutils/open-vm-tools/PLIST.common
index 416d82a5759..9b497086897 100644
--- a/sysutils/open-vm-tools/PLIST.common
+++ b/sysutils/open-vm-tools/PLIST.common
@@ -1,12 +1,48 @@
-@comment $NetBSD: PLIST.common,v 1.2 2014/03/11 14:05:15 jperkin Exp $
+@comment $NetBSD: PLIST.common,v 1.3 2016/10/09 03:41:56 ryoon Exp $
+bin/vmtoolsd
bin/vmware-checkvm
bin/vmware-hgfsclient
+bin/vmware-namespace-cmd
+bin/vmware-rpctool
bin/vmware-toolbox-cmd
bin/vmware-xferlogs
+include/libDeployPkg/guestcust-events.h
+include/libDeployPkg/imgcust-api.h
+include/libDeployPkg/includeCheck.h
+include/libDeployPkg/linuxDeployment.h
+include/libDeployPkg/log.h
+include/libDeployPkg/process.h
+include/libDeployPkg/rpcout.h
+include/libDeployPkg/vm_basic_types.h
+include/vmGuestLib/includeCheck.h
+include/vmGuestLib/vmGuestLib.h
+include/vmGuestLib/vmSessionId.h
+include/vmGuestLib/vm_basic_types.h
+lib/libDeployPkg.la
lib/libguestlib.la
-sbin/vmware-guestd
+lib/libhgfs.la
+lib/libvmtools.la
+lib/open-vm-tools/plugins/common/libhgfsServer.la
+lib/open-vm-tools/plugins/common/libvix.la
+lib/open-vm-tools/plugins/vmsvc/libdeployPkgPlugin.so
+lib/open-vm-tools/plugins/vmsvc/libguestInfo.so
+lib/open-vm-tools/plugins/vmsvc/libpowerOps.so
+lib/open-vm-tools/plugins/vmsvc/libtimeSync.so
+lib/open-vm-tools/plugins/vmsvc/libvmbackup.so
+lib/pkgconfig/libDeployPkg.pc
+lib/pkgconfig/vmguestlib.pc
+sbin/mount.vmblock
+share/examples/vmware-tools/pam.d/vmtoolsd
share/examples/vmware-tools/poweroff-vm-default
share/examples/vmware-tools/poweron-vm-default
share/examples/vmware-tools/resume-vm-default
+share/examples/vmware-tools/scripts/vmware/network
+share/examples/vmware-tools/statechange.subr
share/examples/vmware-tools/suspend-vm-default
-share/examples/vmware-tools/tools.conf
+share/open-vm-tools/messages/de/toolboxcmd.vmsg
+share/open-vm-tools/messages/de/vmtoolsd.vmsg
+share/open-vm-tools/messages/ja/toolboxcmd.vmsg
+share/open-vm-tools/messages/ja/vmtoolsd.vmsg
+share/open-vm-tools/messages/ko/toolboxcmd.vmsg
+share/open-vm-tools/messages/ko/vmtoolsd.vmsg
+share/open-vm-tools/messages/zh_CN/toolboxcmd.vmsg
diff --git a/sysutils/open-vm-tools/PLIST.x11 b/sysutils/open-vm-tools/PLIST.x11
index 2e235b5d120..d6c434cbb55 100644
--- a/sysutils/open-vm-tools/PLIST.x11
+++ b/sysutils/open-vm-tools/PLIST.x11
@@ -1,5 +1,6 @@
-@comment $NetBSD: PLIST.x11,v 1.1 2008/08/31 06:36:47 scottr Exp $
-bin/vmware-toolbox
-bin/vmware-user
+@comment $NetBSD: PLIST.x11,v 1.2 2016/10/09 03:41:56 ryoon Exp $
bin/vmware-user-suid-wrapper
-share/applications/vmware-user.desktop
+etc/vmware-tools/xdg/autostart/vmware-user.desktop
+lib/open-vm-tools/plugins/vmusr/libdesktopEvents.so
+lib/open-vm-tools/plugins/vmusr/libdndcp.so
+lib/open-vm-tools/plugins/vmusr/libresolutionSet.so
diff --git a/sysutils/open-vm-tools/distinfo b/sysutils/open-vm-tools/distinfo
index 4c0891f03a5..077992db60d 100644
--- a/sysutils/open-vm-tools/distinfo
+++ b/sysutils/open-vm-tools/distinfo
@@ -1,72 +1,52 @@
-$NetBSD: distinfo,v 1.11 2016/05/07 10:10:09 joerg Exp $
+$NetBSD: distinfo,v 1.12 2016/10/09 03:41:56 ryoon Exp $
-SHA1 (open-vm-tools-2008.08.08-109361.tar.gz) = 1c44c3524cd9cbc5870f1c6065b03a6b31859a25
-RMD160 (open-vm-tools-2008.08.08-109361.tar.gz) = 4ea0a6aa2edda2bc404c865dc5b58f3a177ae411
-SHA512 (open-vm-tools-2008.08.08-109361.tar.gz) = 52e4c453aa22f0efa4df36bd2f5fc08414da741e83c91d7d17102b914fc513370914801d66fdfd498b0947132c3967b82db027a5ea8341f7b87e50f070174c29
-Size (open-vm-tools-2008.08.08-109361.tar.gz) = 2971141 bytes
-SHA1 (patch-ac) = 141db2136d1068408ca3470e11d35233f936a11c
-SHA1 (patch-ad) = 4ec9292667918c23ef182ae05d5f8417d9af7673
-SHA1 (patch-ae) = 785a5d5d27ce6f8281caa56a27f90a3b200ac082
-SHA1 (patch-af) = 7ead621ec1b8987e64ceaa73909c74927e50330f
-SHA1 (patch-ag) = 6d5d462934942ec8b7439e2e51d179e627833111
-SHA1 (patch-ah) = 18577d28bea81a036495d3f86b4713b8a1003fdc
-SHA1 (patch-ai) = 59cdf9ae813aa9ac0cf5920e19cbfd23b720b50b
-SHA1 (patch-aj) = ee2e2bfc5f976d00fb4a830184e37427852a90d3
-SHA1 (patch-ak) = d27cd0cbbf2db45a07a8bf4a006ad5e28feb8b3a
-SHA1 (patch-am) = a4d678ad7e163de381a547cad1c24bca08c72a73
-SHA1 (patch-an) = abd94ec83c54e4ee1e64a34996db21ce86cf7ae3
-SHA1 (patch-ao) = 5d6457e994f559fd826811644d2e77f46ce10d1e
-SHA1 (patch-ap) = ca1a6efeaa90cf6e759e2d27ff3b2da8ffef63d0
-SHA1 (patch-aq) = 18a3072f2c307ed35e5c2356e5656c0ce5f19dc0
-SHA1 (patch-ar) = aa98d78890c9fb46c18f727ba3609ad562c01480
-SHA1 (patch-as) = 45e3957d07227c8fb1741fcf6b15c982e9b52bfd
-SHA1 (patch-at) = 659b97c50168fa74f3e6a8ffe2bafae0420f0d49
-SHA1 (patch-au) = 31eeee4521020952ef51b29351802efd9fe4297f
-SHA1 (patch-av) = b61f165fd9a6e5241795e2e69aa73caba32539a8
-SHA1 (patch-aw) = 82788d7ab312ee07abf3e159028b440d41912a14
-SHA1 (patch-ax) = 70633d0675b11aea8a8c12edbb765ad7d230276f
-SHA1 (patch-ay) = c9c7a7f9871fdc3213bafce05a7433db862ac4a4
-SHA1 (patch-az) = 2a8494c8cbfb0270a5fdd46e0c5ccaf19fc5f94f
-SHA1 (patch-ba) = cb0433af4a7c5c9a9010edbc15998577c44c92ae
-SHA1 (patch-bb) = 2dc1b2281eff27965fc83ca20e9c026287227287
-SHA1 (patch-bc) = d806bf75979d870db8616fa212e3f619d4508249
-SHA1 (patch-bd) = 0af45ab34089ea1d47b15f9dc3ddec129ab98b1a
-SHA1 (patch-be) = 29d8fd6b32d622b4ed03efecb4aeb2a35a7c254b
-SHA1 (patch-bf) = c14f4c641f6f1536d8ae7cd20995506bb59470b4
-SHA1 (patch-bg) = e129e88832690763e4b34cc59c614cf31e79802a
-SHA1 (patch-bh) = 723d8bc1a2064572e7ff4768c137830fbb6773d6
-SHA1 (patch-bi) = d3749e561947e32b5de2af3acb3ff7c26a47ccb4
-SHA1 (patch-bj) = b3c6961c4e8ec54ed2a1c608a8d04e0d38c4176c
-SHA1 (patch-bk) = 48d44394dc31d50dc1ffebfac10c813a18a8f094
-SHA1 (patch-bl) = 651f31b2c1d056e5090b893d1db7badfdb592561
-SHA1 (patch-bm) = 4a0235a64263b1f56a357fe5106a40269a2a11e1
-SHA1 (patch-bn) = 12e1bbd0aea73a2df4fd36e7a8ad8006327404ea
-SHA1 (patch-bo) = 7480a6016308049eef86aeec8103ccf12733133c
-SHA1 (patch-bp) = c577501c0c00dcb8d4b6b8aec8347879aabc0330
-SHA1 (patch-bq) = 121e5db459e1e0f5f5dbaa5e0e3a40e7bc8a74a7
-SHA1 (patch-br) = 7c14091b3f7a7e75e0d7db654cff1e0476e36888
-SHA1 (patch-bs) = 4b2a334ed4611c87b90f2e092cffb88aae058928
+SHA1 (open-vm-tools-10.0.7-3227872.tar.gz) = cd22a3d79d68de46647e8add78bcaf829bb0598d
+RMD160 (open-vm-tools-10.0.7-3227872.tar.gz) = df8cfa62ffd0fbba0432cb0deac0f202b2278625
+SHA512 (open-vm-tools-10.0.7-3227872.tar.gz) = 5838c971a41540cb54ddf83400d2b728bae3245765b6e7d80e7f4be4035308f045ea4a735abafb2a7accbd90c6fe4c381dabd102a98be08a7ee08feab03bfa8b
+Size (open-vm-tools-10.0.7-3227872.tar.gz) = 4009790 bytes
+SHA1 (patch-ag) = 67ce2bcba5cfcbd48f4d2345d5529329424952b3
+SHA1 (patch-ah) = bdee6d92cdfe64f1ab513876ccd9d01f6fda6882
+SHA1 (patch-ai) = 3e8c67a33f6072319f1741bda960377fc2663b06
+SHA1 (patch-aj) = e0bba963e3eed96cf7ae5b0e439a16524194e4df
+SHA1 (patch-ak) = c74a8185508d34cb35fbf14b638fab59661e191f
+SHA1 (patch-aq) = 512a662530ef96c905eb61f6f9e459d6cd1c4b8e
+SHA1 (patch-ar) = b06873f37ac826912e647f2349dc88053bf2cb67
+SHA1 (patch-as) = b029c646cb49ee15a92827f100470489106a2f2f
+SHA1 (patch-at) = 6dbe029926e18075eedf9e2947807f8a4d593136
+SHA1 (patch-au) = 518ca50f944fad718a5e8deb66e83a405ce88159
+SHA1 (patch-av) = 9a1a7daf9fdd2c60119e0a59063aff4e74ad10f1
+SHA1 (patch-ay) = ff2f26b43c5d74c3d6e6d816d5ac3177cfbe505d
+SHA1 (patch-az) = 971e3389db9d5d0a758ebe5b75cb45b419d50ba7
+SHA1 (patch-ba) = 77a57e736f3b02b8f942ae3543cee065a4c4e732
+SHA1 (patch-bb) = e22d082689016d81add208e1d3b31d9d897d36e8
+SHA1 (patch-bc) = c2f316cd9035648676fd9d0d7e40fc7f6bf5c8d4
+SHA1 (patch-bd) = eacc267fad7021a96ee435e8fc41c82fb49d9c5f
+SHA1 (patch-be) = 4e4f88df81daf40769b38d1ddd49fbf5e8d8d1eb
+SHA1 (patch-bf) = 674f18131037a3aa5f01371edb9e576c39a9ecaf
+SHA1 (patch-bh) = 86793b6411a64d3189f47d5236f2a6f4c9fff05c
+SHA1 (patch-bm) = 219f196fc07e3746e9e6eb340be5e647544a255a
SHA1 (patch-bt) = 34c85d8d994c33fb4e18f76bb8b6baa41098f23e
-SHA1 (patch-bu) = 9e2533d967cfb1cdc780516359ab8e7c373b70f5
-SHA1 (patch-bv) = 180df7c4a5fb7544b6d9014f567a4f31e6c2a38d
-SHA1 (patch-bw) = c242890caa3cc720d18eec612aca6e46c69c5b04
-SHA1 (patch-bx) = deeea5eefae750b046d7a9c81679125e26fb82fa
-SHA1 (patch-by) = c6018a330fdabefd3fc60d3e6e6c95bdf4f7f2bc
-SHA1 (patch-checkvm_checkvm.c) = 1da596cf11ccb9af1ba39013775a3a6b3a85345f
-SHA1 (patch-configure.ac) = d39767cc2006088203341782fca7895c2710fd55
-SHA1 (patch-guestd_Makefile.am) = 4855efa62b6633e23c11e3ea184f60f4c6952244
-SHA1 (patch-hgfsclient_Makefile.am) = 3b6adf9e4d88bcce2c191260b669615537927e28
-SHA1 (patch-lib_guestApp_Makefile.am) = b6fb86b15fa58ff87285ab591be1870cf79a5d18
-SHA1 (patch-lib_hgfsServer_hgfsServer.c) = 68a3102d4f53626717f64284eb5e51bfb584e783
-SHA1 (patch-lib_hgfsServer_hgfsServerLinux.c) = ef5a3135a8e4dc9f16d93d6eb7d88b8194aa0907
-SHA1 (patch-lib_panic_panic.c) = f784479ef9000e67389c04ca80ad22da5e3a2165
-SHA1 (patch-lib_user_util.c) = 7048484864fb5f7a66a61dc2234b1ea8359328ae
-SHA1 (patch-lib_vmCheck_Makefile.am) = 5956c6e81d6ea5679d949083fcf60066d8374672
-SHA1 (patch-lib_vmSignal_Makefile.am) = 6c562e558f846666ed9da3298f15a9cd489bd75f
-SHA1 (patch-libguestlib_Makefile.am) = d46ae6b600831b3f7ecd39f675fbf480a7882e60
-SHA1 (patch-scripts_Makefile.am) = 18bac57a5bfed9883734fdc58a4d6214b6614d92
-SHA1 (patch-toolbox_Makefile.am) = cc0d0f3a0b2b269da903ff6918d329ce74158d17
-SHA1 (patch-toolbox_toolboxcmd-stat.c) = 17d1188de53cea4897fc1d08a02d9db06f6bbc28
-SHA1 (patch-vmware-user_Makefile.am) = 20c389aa42c5419106e1d6619e812725602ead6c
-SHA1 (patch-vmware-user_copyPaste.c) = 58286d54e72d9290fc9392212d37c0c406a4e6f8
-SHA1 (patch-vmware-user_dnd.c) = 9d2b242b5e5042f12440ccbf44b10367a8184b0b
+SHA1 (patch-bu) = 33da24db6d7e3dd75ee6f4f1249772de506ab64d
+SHA1 (patch-configure.ac) = cf2c2bb8526ee4916a1a81059b9b776cec97b877
+SHA1 (patch-libDeployPkg_linuxDeployment.c) = f50c7ff2fa07ab15716128654cc814a81cb924af
+SHA1 (patch-libDeployPkg_processPosix.c) = 9f62110eb903eec85e51d8e579abc3d36e54fe7e
+SHA1 (patch-lib_dynxdr_xdrutil.c) = 2a644aeb47bcef7f4db953250b116ec700940531
+SHA1 (patch-lib_file_file.c) = e9ee13e3f5dcdabdf3013095e2af31a65d5afaab
+SHA1 (patch-lib_hgfsHelper_hgfsHelperPosix.c) = 9299f0a781d11689b04223a1dfd1c4725912f863
+SHA1 (patch-lib_hgfsUri_hgfsUriPosix.c) = f98eab5cb5885a9c2e258bf072b24d8806b20fd4
+SHA1 (patch-lib_include_sigPosixRegs.h) = 634e12414f004671c1b2855764970e5d16ef4ef8
+SHA1 (patch-lib_include_vmblock__user.h) = 05ed8a0cdd481b759643ea47e27ef6e223a835d8
+SHA1 (patch-lib_include_vmci__sockets.h) = fba82038daf87a08f04ddd541281122f0047e968
+SHA1 (patch-lib_misc_hostinfoPosix.c) = 4daea6167cee2be57cc3acc0caa710ca940d1eb7
+SHA1 (patch-lib_nicInfo_nicInfoInt.h) = 81d5e8625496218a679c0a87f30a08cc2e3af7a7
+SHA1 (patch-lib_nicInfo_nicInfoPosix.c) = 0f44134e1e256a46b5ce35fff91d0568649c1bad
+SHA1 (patch-lib_user_utilBacktrace.c) = 741cc72d64f962fa0aa48e90b1f912f422c5dd8b
+SHA1 (patch-scripts_Makefile.am) = 5238c5cabf1125f9cd334349e5f67f1b7a568428
+SHA1 (patch-scripts_netbsd_network) = cf4c47e337b0d1f8bba3d4e87678924f85dd635e
+SHA1 (patch-services_plugins_dndcp_dnd_dndLinux.c) = 61acce40961ac82b48e055c159efd0c3b7a8899c
+SHA1 (patch-services_plugins_timeSync_Makefile.am) = 45a9c9044f1e4274c173d822a74dfc63bde0f5e9
+SHA1 (patch-services_vmtoolsd_Makefile.am) = 8a34599f5bd9722333de1ecf741a27a0636104c5
+SHA1 (patch-vgauth_common_VGAuthLog.c) = e64fc476b80015759cca3aafc8b48a3c4daa6dde
+SHA1 (patch-vgauth_lib_common.c) = 0d949bc3c4a00a92f89177e4f20ef2f848f78532
+SHA1 (patch-vgauth_lib_impersonateLinux.c) = 1c925eab81525df06e4ebf906f835170b4320768
+SHA1 (patch-vmblockmounter_vmblockmounter.c) = 4287303b188f4df7a2785fe72bbab820e33d6a07
diff --git a/sysutils/open-vm-tools/files/vmtools.sh b/sysutils/open-vm-tools/files/vmtools.sh
index d1c6bee33ea..62814a0b519 100755
--- a/sysutils/open-vm-tools/files/vmtools.sh
+++ b/sysutils/open-vm-tools/files/vmtools.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: vmtools.sh,v 1.1 2008/08/31 06:36:47 scottr Exp $
+# $NetBSD: vmtools.sh,v 1.2 2016/10/09 03:41:56 ryoon Exp $
#
# PROVIDE: vmtools
@@ -11,7 +11,7 @@ $_rc_subr_loaded . /etc/rc.subr
name="vmtools"
rcvar="vmtools"
pidfile="/var/run/vmware-guestd.pid"
-command="@PREFIX@/sbin/vmware-guestd"
+command="@PREFIX@/bin/vmtoolsd"
command_args="--background ${pidfile}"
load_rc_config $name
diff --git a/sysutils/open-vm-tools/options.mk b/sysutils/open-vm-tools/options.mk
index 4445978205e..a7011ffa245 100644
--- a/sysutils/open-vm-tools/options.mk
+++ b/sysutils/open-vm-tools/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2010/12/16 11:52:15 obache Exp $
+# $NetBSD: options.mk,v 1.3 2016/10/09 03:41:56 ryoon Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.open-vm-tools
PKG_SUPPORTED_OPTIONS= x11
@@ -8,11 +8,8 @@ PKG_SUGGESTED_OPTIONS= x11
.if !empty(PKG_OPTIONS:Mx11)
PLIST_SRC+= PLIST.x11
-. include "../../x11/gtk2/buildlink3.mk"
-. include "../../x11/libXinerama/buildlink3.mk"
-. include "../../x11/libXrandr/buildlink3.mk"
-. include "../../x11/libXrender/buildlink3.mk"
-. include "../../x11/libXtst/buildlink3.mk"
+. include "../../graphics/gdk-pixbuf2-xlib/buildlink3.mk"
+. include "../../x11/gtkmm/buildlink3.mk"
. include "../../sysutils/desktop-file-utils/desktopdb.mk"
.else
CONFIGURE_ARGS+= --without-x
diff --git a/sysutils/open-vm-tools/patches/patch-ac b/sysutils/open-vm-tools/patches/patch-ac
deleted file mode 100644
index 61b50d91351..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ac
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-ac,v 1.3 2012/12/25 21:02:15 joerg Exp $
-
---- guestd/foreignVMToolsDaemon.c.orig 2008-08-08 07:01:56.000000000 +0000
-+++ guestd/foreignVMToolsDaemon.c
-@@ -55,7 +55,7 @@
- #include <netinet/tcp.h>
- #include <arpa/inet.h>
- #include <fcntl.h>
--#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__)
- #include <unistd.h>
- #else
- #include <linux/unistd.h>
-@@ -833,8 +833,7 @@ ForeignToolsSetProperties(ForeignVMTools
- * Do some validation
- */
- if ((NULL == asyncCommand)
-- || (NULL == requestMsg)
-- || (0 > requestMsg->bufferSize)) {
-+ || (NULL == requestMsg)) {
- err = VIX_E_INVALID_ARG;
- goto abort;
- }
diff --git a/sysutils/open-vm-tools/patches/patch-ad b/sysutils/open-vm-tools/patches/patch-ad
deleted file mode 100644
index 8fa426dd26e..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ad
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ad,v 1.3 2012/12/25 21:02:15 joerg Exp $
-
---- guestd/foreignVMToolsDaemon.h.orig 2008-08-08 07:01:56.000000000 +0000
-+++ guestd/foreignVMToolsDaemon.h
-@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
-
- #ifdef __APPLE__
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
--#elif defined(__FreeBSD__) || defined(sun)
-+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- #include <unistd.h>
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
- #else
-@@ -72,7 +72,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
-
- typedef pthread_mutex_t VixLockType;
- static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr);
--VixError VIX_INIT_LOCK(VixLockType *lockPtr)
-+static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr)
- {
- int result;
- pthread_mutexattr_t attr;
diff --git a/sysutils/open-vm-tools/patches/patch-ae b/sysutils/open-vm-tools/patches/patch-ae
deleted file mode 100644
index 53a7943b905..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ae
+++ /dev/null
@@ -1,49 +0,0 @@
-$NetBSD: patch-ae,v 1.2 2008/08/31 06:36:47 scottr Exp $
-
---- guestd/main.c.orig 2008-08-08 02:01:56.000000000 -0500
-+++ guestd/main.c
-@@ -59,7 +59,7 @@
- #include "vmBackup.h"
- #include "codeset.h"
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- #include "socketMgr.h"
- #endif
-
-@@ -864,7 +864,7 @@ GuestdSleep(uint64 numUsecs,
- int maxFd; /* Max fd of all Fd sets */
- fd_set readFds; /* Read fd set to select on */
- fd_set writeFds;
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- SocketSelectable *sockReadFds = NULL;
- SocketSelectable *sockWriteFds = NULL;
- int numSockReadFds = 0;
-@@ -911,7 +911,7 @@ GuestdSleep(uint64 numUsecs,
- }
- #endif
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- SocketMgr_GetSelectables(SOCKETMGR_IN,
- &sockReadFds,
- &numSockReadFds);
-@@ -969,7 +969,7 @@ GuestdSleep(uint64 numUsecs,
- curAsyncProc = NULL;
- }
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- for (index = 0; index < numSockReadFds; index++) {
- if (FD_ISSET(sockReadFds[index], &readFds)) {
- SocketMgr_ProcessSelectable(sockReadFds[index], SOCKETMGR_IN);
-@@ -984,7 +984,7 @@ GuestdSleep(uint64 numUsecs,
- #endif
- }
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- free((void *) sockReadFds);
- free((void *) sockWriteFds);
- #endif
diff --git a/sysutils/open-vm-tools/patches/patch-ag b/sysutils/open-vm-tools/patches/patch-ag
index 73350d5f3e5..b3eae11886f 100644
--- a/sysutils/open-vm-tools/patches/patch-ag
+++ b/sysutils/open-vm-tools/patches/patch-ag
@@ -1,13 +1,13 @@
-$NetBSD: patch-ag,v 1.2 2008/08/31 06:36:47 scottr Exp $
+$NetBSD: patch-ag,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/dynxdr/dynxdr.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/dynxdr/dynxdr.c.orig 2016-02-16 20:06:45.000000000 +0000
+++ lib/dynxdr/dynxdr.c
@@ -54,7 +54,7 @@ typedef struct DynXdrData {
* Mac OS X, FreeBSD and Solaris don't take a const parameter to the
* "x_getpostn" function.
*/
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun)
-+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) | defined(__NetBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
# define DYNXDR_GETPOS_CONST
#else
# define DYNXDR_GETPOS_CONST const
diff --git a/sysutils/open-vm-tools/patches/patch-ah b/sysutils/open-vm-tools/patches/patch-ah
index 377a2fb310f..0871916a641 100644
--- a/sysutils/open-vm-tools/patches/patch-ah
+++ b/sysutils/open-vm-tools/patches/patch-ah
@@ -1,49 +1,22 @@
-$NetBSD: patch-ah,v 1.2 2008/08/31 06:36:47 scottr Exp $
+$NetBSD: patch-ah,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/file/fileIO.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/file/fileIO.c.orig 2016-02-16 20:06:45.000000000 +0000
+++ lib/file/fileIO.c
-@@ -254,7 +254,7 @@ FileIO_Lock(FileIODescriptor *file, // I
-
- ASSERT(file);
+@@ -325,7 +325,7 @@ FileIO_Lock(FileIODescriptor *file, //
+ FileIOResolveLockBits(&access);
+ ASSERT((access & FILEIO_OPEN_LOCKED) == 0);
-#if !defined(__FreeBSD__) && !defined(sun)
+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- if (access & FILEIO_OPEN_LOCKED) {
- int err;
-
-@@ -286,7 +286,7 @@ FileIO_Lock(FileIODescriptor *file, // I
- }
- #else
- ASSERT(file->lockToken == NULL);
--#endif // !__FreeBSD__ && !sun
-+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
-
- return ret;
- }
-@@ -316,7 +316,7 @@ FileIO_Unlock(FileIODescriptor *file)
+ if ((access & FILEIO_OPEN_LOCK_MANDATORY) != 0) {
+ /* Mandatory file locks are available only when opening a file */
+ ret = FILEIO_LOCK_FAILED;
+@@ -394,7 +394,7 @@ FileIO_Unlock(FileIODescriptor *file) /
ASSERT(file);
-#if !defined(__FreeBSD__) && !defined(sun)
+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
if (file->lockToken != NULL) {
- int err;
-
-@@ -333,7 +333,7 @@ FileIO_Unlock(FileIODescriptor *file)
- }
- #else
- ASSERT(file->lockToken == NULL);
--#endif // !__FreeBSD__ && !sun
-+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__)
+ int err = 0;
- return ret;
- }
-@@ -449,7 +449,7 @@ FileIO_StatsExit(const FileIODescriptor
- /*
- * Pwrite & Pread are not available in the FreeBSD tools build VM
- */
--#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__)
-+#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) && !defined(__NetBSD__)
- #if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__)
- /*
- *----------------------------------------------------------------------
diff --git a/sysutils/open-vm-tools/patches/patch-ai b/sysutils/open-vm-tools/patches/patch-ai
index 06d6d8c698f..6fd32b9a2f1 100644
--- a/sysutils/open-vm-tools/patches/patch-ai
+++ b/sysutils/open-vm-tools/patches/patch-ai
@@ -1,8 +1,8 @@
-$NetBSD: patch-ai,v 1.2 2008/08/31 06:36:47 scottr Exp $
+$NetBSD: patch-ai,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/file/fileIOPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/file/fileIOPosix.c.orig 2016-02-16 20:06:45.000000000 +0000
+++ lib/file/fileIOPosix.c
-@@ -62,7 +62,7 @@
+@@ -66,7 +66,7 @@
#include <dlfcn.h>
#include <sys/xattr.h>
#else
@@ -11,21 +11,3 @@ $NetBSD: patch-ai,v 1.2 2008/08/31 06:36:47 scottr Exp $
#include <sys/param.h>
#include <sys/mount.h>
#else
-@@ -720,7 +720,7 @@ FileIO_Create(FileIODescriptor *file,
- ASSERT(file->lockToken == NULL);
- ASSERT_ON_COMPILE(FILEIO_ERROR_LAST < 16); /* See comment in fileIO.h */
-
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) && !defined(__NetBSD__)
- /*
- * If FILEIO_OPEN_EXCLUSIVE_LOCK or FILEIO_OPEN_MULTIWRITER_LOCK or
- * (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_LOCKED) are passed, and we are
-@@ -1248,7 +1248,7 @@ FileIO_Sync(const FileIODescriptor *file
- /*
- * readv & writev are not available in the FreeBSD or Solaris Tools builds
- */
--#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun))
-+#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__))
-
-
- /*
diff --git a/sysutils/open-vm-tools/patches/patch-aj b/sysutils/open-vm-tools/patches/patch-aj
index f10f61e0ab6..d5659f7f616 100644
--- a/sysutils/open-vm-tools/patches/patch-aj
+++ b/sysutils/open-vm-tools/patches/patch-aj
@@ -1,6 +1,6 @@
-$NetBSD: patch-aj,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-aj,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/file/fileLockPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/file/fileLockPosix.c.orig 2016-02-16 20:06:45.000000000 +0000
+++ lib/file/fileLockPosix.c
@@ -26,7 +26,7 @@
#include <stdlib.h>
@@ -9,11 +9,11 @@ $NetBSD: patch-aj,v 1.2 2008/08/31 06:36:48 scottr Exp $
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
#if defined(__APPLE__)
- #include <sys/param.h>
- #include <sys/mount.h>
-@@ -121,7 +121,7 @@ FileLock_Init(int lockerPid,
- fileLockOptions.userWorld = userWorld;
- }
+ #include <sys/param.h>
+ #include <sys/mount.h>
+@@ -76,7 +76,7 @@
+ * into the log file.
+ */
-#if !defined(__FreeBSD__) && !defined(sun)
+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
diff --git a/sysutils/open-vm-tools/patches/patch-ak b/sysutils/open-vm-tools/patches/patch-ak
index 6d84204ee23..1fcb4745df3 100644
--- a/sysutils/open-vm-tools/patches/patch-ak
+++ b/sysutils/open-vm-tools/patches/patch-ak
@@ -1,17 +1,17 @@
-$NetBSD: patch-ak,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-ak,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/file/filePosix.c.orig 2008-08-08 02:01:54.000000000 -0500
+--- lib/file/filePosix.c.orig 2016-02-16 20:06:45.000000000 +0000
+++ lib/file/filePosix.c
@@ -24,7 +24,7 @@
#include <sys/types.h> /* Needed before sys/vfs.h with glibc 2.0 --hpreg */
--#if !__FreeBSD__
-+#if !__FreeBSD__ && !__NetBSD__
- # if !__APPLE__
- # include <sys/vfs.h>
- # endif
-@@ -64,7 +64,7 @@
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ # include <sys/param.h>
+ # include <sys/mount.h>
+ #else
+@@ -73,7 +73,7 @@
#include "unicodeOperations.h"
@@ -20,25 +20,16 @@ $NetBSD: patch-ak,v 1.2 2008/08/31 06:36:48 scottr Exp $
#if !defined(__APPLE__)
static char *FilePosixLookupMountPoint(char const *canPath, Bool *bind);
#endif
-@@ -320,7 +320,7 @@ FileAttributes(ConstUnicode pathName, /
+@@ -360,7 +360,7 @@ FileAttributes(const char *pathName, //
*----------------------------------------------------------------------
*/
-#if !defined(__FreeBSD__) && !defined(sun)
+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
Bool
- File_IsRemote(ConstUnicode pathName) // IN: Path name
+ File_IsRemote(const char *pathName) // IN: Path name
{
-@@ -626,7 +626,7 @@ File_GetTimes(ConstUnicode pathName,
- * XXX atime is almost always MAX.
- */
-
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- /*
- * FreeBSD: All supported versions have timestamps with nanosecond resolution.
- * FreeBSD 5+ has also file creation time.
-@@ -788,7 +788,7 @@ File_SetTimes(ConstUnicode pathName,
+@@ -909,7 +909,7 @@ File_SetFilePermissions(const char *path
}
@@ -47,12 +38,21 @@ $NetBSD: patch-ak,v 1.2 2008/08/31 06:36:48 scottr Exp $
/*
*-----------------------------------------------------------------------------
*
-@@ -1747,7 +1747,7 @@ File_IsSameFile(ConstUnicode path1, //
- }
-
-
--#endif /* !FreeBSD && !sun */
-+#endif /* !FreeBSD && !sun && !NetBSD */
-
-
- /*
+@@ -2006,7 +2006,7 @@ File_IsSameFile(const char *path1, // I
+ {
+ struct stat st1;
+ struct stat st2;
+-#if !defined(sun) // Solaris does not have statfs
++#if !defined(sun) && !defined(__NetBSD__) // Solaris does not have statfs
+ struct statfs stfs1;
+ struct statfs stfs2;
+ #endif
+@@ -2049,7 +2049,7 @@ File_IsSameFile(const char *path1, // I
+ return TRUE;
+ }
+
+-#if !defined(sun) // Solaris does not have statfs
++#if !defined(sun) && !defined(__NetBSD__) // Solaris does not have statfs
+ if (Posix_Statfs(path1, &stfs1) != 0) {
+ return FALSE;
+ }
diff --git a/sysutils/open-vm-tools/patches/patch-am b/sysutils/open-vm-tools/patches/patch-am
deleted file mode 100644
index aa564a860d6..00000000000
--- a/sysutils/open-vm-tools/patches/patch-am
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-am,v 1.2 2008/08/31 06:36:48 scottr Exp $
-
---- lib/guestApp/guestApp.c.orig 2008-08-08 02:01:53.000000000 -0500
-+++ lib/guestApp/guestApp.c
-@@ -72,6 +72,7 @@ extern "C" {
- * intelligent for that platform as well.
- */
-
-+#if !defined(GUESTAPP_TOOLS_INSTALL_PATH)
- #if defined(N_PLAT_NLM)
- #define GUESTAPP_TOOLS_INSTALL_PATH "SYS:\\ETC\\VMWTOOL"
- #elif defined(_WIN32)
-@@ -79,6 +80,7 @@ extern "C" {
- #else
- #define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools"
- #endif
-+#endif
-
- /*
- * An option name/value pair stored locally in the guest app.
diff --git a/sysutils/open-vm-tools/patches/patch-an b/sysutils/open-vm-tools/patches/patch-an
deleted file mode 100644
index fdee9bf65ad..00000000000
--- a/sysutils/open-vm-tools/patches/patch-an
+++ /dev/null
@@ -1,72 +0,0 @@
-$NetBSD: patch-an,v 1.3 2012/12/25 21:02:15 joerg Exp $
-
---- lib/guestInfo/guestInfoPosix.c.orig 2008-08-08 07:01:52.000000000 +0000
-+++ lib/guestInfo/guestInfoPosix.c
-@@ -38,10 +38,11 @@
- #endif
- #include <unistd.h>
- #include <sys/types.h>
-+#include <sys/param.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
- #include <errno.h>
--#if defined(__FreeBSD__) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- # include <sys/sysctl.h>
- #endif
- #ifndef NO_DNET
-@@ -200,7 +201,7 @@ ReadInterfaceDetails(const struct intf_e
- char ipAddress[NICINFO_MAX_IP_LEN];
-
- Str_Sprintf(macAddress, sizeof macAddress,
-- addr_ntoa(&entry->intf_link_addr));
-+ "%s", addr_ntoa(&entry->intf_link_addr));
- nic = GuestInfoAddNicEntry(nicInfo, macAddress);
-
- if (nic == NULL) {
-@@ -229,6 +230,7 @@ ReadInterfaceDetails(const struct intf_e
- if (ip) {
- GuestInfoAddSubnetMask(ip, entry->intf_addr.addr_bits);
- }
-+#if !defined(__NetBSD__) /* libdnet addr_ntoa() breaks with IPv6 on NetBSD */
- } else if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP6) {
- memcpy(ipAddress,
- addr_ntoa(&entry->intf_alias_addrs[i]),
-@@ -236,6 +238,7 @@ ReadInterfaceDetails(const struct intf_e
- GuestInfoAddIpAddress(nic,
- ipAddress,
- INFO_IP_ADDRESS_FAMILY_IPV6);
-+#endif /* defined(__NetBSD__) */
- }
- }
- }
-@@ -697,6 +700,20 @@ GuestInfoGetOSName(unsigned int outBufFu
- if (releaseLen != 0) {
- Str_Strncat(osName, outBufLen, buf.release, releaseLen);
- }
-+ } else if (strstr(osNameFull, "NetBSD")) {
-+ size_t nameLen = sizeof STR_OS_NETBSD - 1;
-+ size_t releaseLen = 0;
-+
-+ /* NetBSD, as usual, just DTRT */
-+ releaseLen = strlen(buf.release);
-+
-+ if (nameLen + releaseLen + 1 > outBufLen) {
-+ Debug("GuestInfoGetOSName: Error: buffer too small\n");
-+ return FALSE;
-+ }
-+
-+ Str_Strcpy(osName, STR_OS_NETBSD, outBufLen);
-+ Str_Strncat(osName, outBufLen, buf.release, releaseLen);
- } else if (strstr(osNameFull, "SunOS")) {
- size_t nameLen = sizeof STR_OS_SOLARIS - 1;
- size_t releaseLen = 0;
-@@ -766,7 +783,7 @@ int
- GuestInfo_GetSystemBitness(void)
- {
- char buf[MAX_ARCH_NAME_LEN] = { 0 };
--#if defined(__FreeBSD__) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- int mib[2];
- size_t len;
-
diff --git a/sysutils/open-vm-tools/patches/patch-ao b/sysutils/open-vm-tools/patches/patch-ao
deleted file mode 100644
index b6d83edbc87..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ao
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ao,v 1.2 2008/08/31 06:36:48 scottr Exp $
-
---- lib/include/conf.h.orig 2008-08-08 02:01:52.000000000 -0500
-+++ lib/include/conf.h
-@@ -41,6 +41,9 @@
- # ifdef sun
- # define CONFVAL_HALT_DEFAULT "/usr/sbin/init 5"
- # define CONFVAL_REBOOT_DEFAULT "/usr/sbin/init 6"
-+# elif defined(__NetBSD__)
-+# define CONFVAL_HALT_DEFAULT "/sbin/shutdown -p now"
-+# define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now"
- # else
- # define CONFVAL_HALT_DEFAULT "/sbin/shutdown -h now"
- # define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now"
diff --git a/sysutils/open-vm-tools/patches/patch-ap b/sysutils/open-vm-tools/patches/patch-ap
deleted file mode 100644
index f564e9acb05..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ap
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-ap,v 1.2 2008/08/31 06:36:48 scottr Exp $
-
---- lib/include/guest_os.h.orig 2008-08-08 02:01:52.000000000 -0500
-+++ lib/include/guest_os.h
-@@ -298,6 +298,9 @@ typedef enum GuestOSFamilyType {
- /* FreeBSD */
- #define STR_OS_FREEBSD "FreeBSD"
-
-+/* NetBSD */
-+#define STR_OS_NETBSD "NetBSD"
-+
- /* Solaris */
- #define STR_OS_SOLARIS "Solaris"
-
diff --git a/sysutils/open-vm-tools/patches/patch-aq b/sysutils/open-vm-tools/patches/patch-aq
index ba7bb04dc6f..6e37a5b5f93 100644
--- a/sysutils/open-vm-tools/patches/patch-aq
+++ b/sysutils/open-vm-tools/patches/patch-aq
@@ -1,21 +1,14 @@
-$NetBSD: patch-aq,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-aq,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/hgfsUtil.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/hgfsUtil.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/hgfsUtil.h
-@@ -44,6 +44,7 @@
- !defined(__timespec_defined) && \
- !defined(sun) && \
- !defined(__FreeBSD__) && \
-+ !defined(__NetBSD__) && \
+@@ -59,7 +59,8 @@
+ !defined sun && \
+ !defined __FreeBSD__ && \
!__APPLE__ && \
- !defined(_WIN32)
+- !defined _WIN32
++ !defined _WIN32 && \
++ !defined __NetBSD__
struct timespec {
-@@ -96,7 +97,7 @@ struct timespec {
- /*
- * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code.
- */
--#if defined(__FreeBSD__) && !defined(EPROTO)
-+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(EPROTO)
- #define EPROTO (ELAST + 1)
- #endif
-
+ time_t tv_sec;
+ long tv_nsec;
diff --git a/sysutils/open-vm-tools/patches/patch-ar b/sysutils/open-vm-tools/patches/patch-ar
index f32511c8916..0b68fdac0a7 100644
--- a/sysutils/open-vm-tools/patches/patch-ar
+++ b/sysutils/open-vm-tools/patches/patch-ar
@@ -1,13 +1,13 @@
-$NetBSD: patch-ar,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-ar,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/iovector.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/iovector.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/iovector.h
@@ -32,7 +32,7 @@
/*
* Ugly definition of struct iovec.
*/
--#if __linux__ || sun || __APPLE__
-+#if __linux__ || sun || __APPLE__ || __NetBSD__
+-#if defined(__linux__) || defined(sun) || defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/uio.h> // for struct iovec
- #else // if __linux__ || sun || __APPLE__
+ #else
diff --git a/sysutils/open-vm-tools/patches/patch-as b/sysutils/open-vm-tools/patches/patch-as
index 98b62ec74bc..f226880c40f 100644
--- a/sysutils/open-vm-tools/patches/patch-as
+++ b/sysutils/open-vm-tools/patches/patch-as
@@ -1,57 +1,58 @@
-$NetBSD: patch-as,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-as,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/mntinfo.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/mntinfo.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/mntinfo.h
-@@ -34,7 +34,7 @@
+@@ -34,8 +34,11 @@
# include <limits.h>
#elif defined(__linux__)
# include <mntent.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
# include <sys/mount.h>
++#if defined(__NetBSD__)
++# include <fstab.h>
++#endif
#endif
#include "posix.h"
-@@ -106,17 +106,27 @@
+
+@@ -106,17 +109,27 @@
# define MNTINFO_FSTYPE(mnt) mnt->mnt_type
# define MNTINFO_MNTPT(mnt) mnt->mnt_dir
# define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL)
-#elif defined(__FreeBSD__) || defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
struct mntHandle {
-+# if defined(__NetBSD__)
++#if defined(__NetBSD__)
+ struct statvfs *mountPoints; // array of mountpoints per getmntinfo(3)
-+# else
++#else
struct statfs *mountPoints; // array of mountpoints per getmntinfo(3)
-+# endif
++#endif
int numMountPoints; // number of elements in mntArray
int mountIndex; // current location within mountPoints array
};
# define MNTFILE _PATH_FSTAB
# define MNTHANDLE struct mntHandle *
--# define MNTINFO struct statfs
--# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
-+# if defined(__NetBSD__)
-+# define MNTINFO struct statvfs
-+# define DECLARE_MNTINFO(name) struct statvfs __ ## name; \
++#if defined(__NetBSD__)
++# define MNTINFO struct statvfs
++# define DECLARE_MNTINFO(name) struct statvfs __ ## name; \
+ struct statvfs *name = &__ ## name
-+# else
-+# define MNTINFO struct statfs
-+# define DECLARE_MNTINFO(name) struct statfs __ ## name; \
++#else
+ # define MNTINFO struct statfs
+ # define DECLARE_MNTINFO(name) struct statfs __ ## name; \
struct statfs *name = &__ ## name
-+# endif
++#endif
# define OPEN_MNTFILE(mode) \
({ \
-@@ -155,7 +165,11 @@ struct mntHandle {
+@@ -155,7 +168,11 @@ struct mntHandle {
# define MNTINFO_NAME(mnt) mnt->f_mntfromname
# define MNTINFO_FSTYPE(mnt) mnt->f_fstypename
# define MNTINFO_MNTPT(mnt) mnt->f_mntonname
--# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
-+# if defined(__NetBSD__)
-+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flag & MNT_RDONLY)
-+# else
-+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
-+# endif
++#if defined(__NetBSD__)
++# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flag & MNT_RDONLY)
++#else
+ # define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY)
++#endif
#else
# error "Define mount information macros for your OS type"
#endif
diff --git a/sysutils/open-vm-tools/patches/patch-at b/sysutils/open-vm-tools/patches/patch-at
index 5678ce15f26..bb9723dee0b 100644
--- a/sysutils/open-vm-tools/patches/patch-at
+++ b/sysutils/open-vm-tools/patches/patch-at
@@ -1,22 +1,22 @@
-$NetBSD: patch-at,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-at,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/posix.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/posix.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/posix.h
-@@ -151,7 +151,7 @@ int Posix_Getgrnam_r(ConstUnicode name,
- char *buf, size_t size, struct group **pgr);
+@@ -104,7 +104,7 @@ char *Posix_MkTemp(const char *pathName)
+ * Make them NULL wrappers for all other platforms.
+ */
+ #define Posix_GetHostName gethostname
+-#if defined(__APPLE__)
++#if defined(__APPLE__) || defined(__NetBSD__)
+ #define Posix_GetHostByName gethostbyname
+ #endif
+ #define Posix_GetAddrInfo getaddrinfo
+@@ -178,7 +178,7 @@ struct mntent *Posix_Getmntent_r(FILE *f
+ int Posix_Getmntent(FILE *fp, struct mnttab *mp);
- #if !defined(sun)
--#if !defined(__APPLE__) && !defined(__FreeBSD__)
-+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- int Posix_Mount(ConstUnicode source, ConstUnicode target,
- const char *filesystemtype, unsigned long mountflags,
- const void *data);
-@@ -161,7 +161,7 @@ struct mntent *Posix_Getmntent(FILE *fp)
- struct mntent *Posix_Getmntent_r(FILE *fp, struct mntent *m,
- char *buf, int size);
+ #endif // !defined(sun)
+-#if !defined(__APPLE__)
++#if !defined(__APPLE__) && !defined(__NetBSD__)
--#endif // !defined(__APPLE__) && !defined(__FreeBSD__)
-+#endif // !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- #else // !defined(sun)
- int Posix_Getmntent(FILE *fp, struct mnttab *mp);
+ /*
diff --git a/sysutils/open-vm-tools/patches/patch-au b/sysutils/open-vm-tools/patches/patch-au
index 2fa6964339c..9cfedd0ab12 100644
--- a/sysutils/open-vm-tools/patches/patch-au
+++ b/sysutils/open-vm-tools/patches/patch-au
@@ -1,37 +1,13 @@
-$NetBSD: patch-au,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-au,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/su.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/su.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/su.h
-@@ -51,7 +51,7 @@ Bool Id_AuthSet(void const *buf, size_t
- Bool Id_AuthCheck(char const *right,
- char const *localizedDescription);
+@@ -50,7 +50,7 @@ Bool Id_AuthCheck(char const *right,
+ char const *localizedDescription,
+ Bool showDialogIfNeeded);
--#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) && !defined(N_PLAT_NLM)
-+#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(N_PLAT_NLM)
+-#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__))
++#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__))
#include <sys/types.h>
#include <unistd.h>
-@@ -87,7 +87,11 @@ int Id_SetRESGid(gid_t rgid, gid_t egid,
- static INLINE int
- Id_SetEUid(uid_t euid)
- {
-+#if defined(__NetBSD__)
-+ return seteuid(euid);
-+#else
- return Id_SetRESUid((uid_t)-1, euid, (uid_t)-1);
-+#endif
- }
-
-
-@@ -111,7 +115,11 @@ Id_SetEUid(uid_t euid)
- static INLINE int
- Id_SetEGid(gid_t egid)
- {
-+#if defined(__NetBSD__)
-+ return setegid(egid);
-+#else
- return Id_SetRESGid((gid_t)-1, egid, (gid_t)-1);
-+#endif
- }
-
- #define IsSuperUser() (0 == geteuid())
diff --git a/sysutils/open-vm-tools/patches/patch-av b/sysutils/open-vm-tools/patches/patch-av
index 51cd63294f5..b2dd36b7326 100644
--- a/sysutils/open-vm-tools/patches/patch-av
+++ b/sysutils/open-vm-tools/patches/patch-av
@@ -1,22 +1,14 @@
-$NetBSD: patch-av,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-av,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/util.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/util.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/util.h
-@@ -55,7 +55,7 @@
- /*
- * Define the Util_ThreadID type.
- */
--#if defined(__APPLE__) || defined(__FreeBSD__)
-+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
- #include <pthread.h>
- typedef pthread_t Util_ThreadID;
- #elif defined(_WIN32)
-@@ -119,7 +119,7 @@ EXTERN char *Util_GetSafeTmpDir(Bool use
- EXTERN int Util_MakeSafeTemp(ConstUnicode tag,
- Unicode *presult);
-
--#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- EXTERN Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize);
+@@ -67,6 +67,9 @@
+ #elif defined(__FreeBSD__)
+ # include <pthread.h>
+ typedef pthread_t Util_ThreadID;
++#elif defined(__NetBSD__)
++# include <pthread.h>
++ typedef pthread_t Util_ThreadID;
+ #else
+ # error "Need typedef for Util_ThreadID"
#endif
-
diff --git a/sysutils/open-vm-tools/patches/patch-aw b/sysutils/open-vm-tools/patches/patch-aw
deleted file mode 100644
index 9ad26c51725..00000000000
--- a/sysutils/open-vm-tools/patches/patch-aw
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-aw,v 1.2 2008/08/31 06:36:48 scottr Exp $
-
---- lib/include/vm_atomic.h.orig 2008-08-08 02:01:52.000000000 -0500
-+++ lib/include/vm_atomic.h
-@@ -22,8 +22,8 @@
- * Atomic power
- */
-
--#ifndef _ATOMIC_H_
--#define _ATOMIC_H_
-+#ifndef _VM_ATOMIC_H_
-+#define _VM_ATOMIC_H_
-
- #define INCLUDE_ALLOW_USERLEVEL
- #define INCLUDE_ALLOW_VMMEXT
-@@ -154,7 +154,8 @@ Atomic_VolatileToAtomic(volatile uint32
- __GNUC__ >= 3 && \
- !defined(BSD_VERSION) && \
- (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \
-- !defined(__APPLE__) /* PR136775 */
-+ !defined(__APPLE__) /* PR136775 */ || \
-+ !defined(__NetBSD__)
- #define ATOMIC_USE_FENCE
- #endif
-
-@@ -2046,4 +2047,4 @@ Atomic_MFence(void)
- Atomic_Xor(&fence, 0x1);
- }
-
--#endif // ifndef _ATOMIC_H_
-+#endif // ifndef _VM_ATOMIC_H_
diff --git a/sysutils/open-vm-tools/patches/patch-ax b/sysutils/open-vm-tools/patches/patch-ax
deleted file mode 100644
index a9e948d3d6b..00000000000
--- a/sysutils/open-vm-tools/patches/patch-ax
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD: patch-ax,v 1.5 2012/12/25 21:02:15 joerg Exp $
-
---- lib/include/vm_basic_types.h.orig 2008-08-08 07:01:52.000000000 +0000
-+++ lib/include/vm_basic_types.h
-@@ -41,7 +41,7 @@
- #include "includeCheck.h"
-
- /* STRICT ANSI means the Xserver build and X defines Bool differently. */
--#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__)
-+#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) || defined(__NetBSD__)
- typedef char Bool;
- #endif
-
-@@ -151,7 +151,7 @@ typedef char int8;
- #endif
-
- #if !defined(USING_AUTOCONF)
--# if defined(__FreeBSD__) || defined(sun)
-+# if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- # ifdef KLD_MODULE
- # include <sys/types.h>
- # else
-@@ -244,7 +244,7 @@ typedef int64 VmTimeVirtualClock; /* Vi
- #define FMTSZ ""
- #define FMTPD ""
- #endif
-- #elif defined(__linux__) \
-+ #elif defined(__linux__) || defined(__NetBSD__) \
- || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \
- || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
- || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L)
-@@ -267,7 +267,7 @@ typedef int64 VmTimeVirtualClock; /* Vi
- #endif
- #ifdef VM_X86_64
- #define FMT64 "l"
-- #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__)
-+ #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
- #define FMT64 "ll"
- #else
- #define FMT64 "L"
-@@ -717,7 +717,8 @@ typedef void * UserVA;
- * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_
- * is defined. Use the same logic here so we don't define it twice. [greg]
- */
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
-+# include <sys/types.h>
- # ifdef _BSD_SIZE_T_
- # undef _BSD_SIZE_T_
- # ifdef VM_I386
diff --git a/sysutils/open-vm-tools/patches/patch-ay b/sysutils/open-vm-tools/patches/patch-ay
index f5fd9f421b5..30a1ccb0d14 100644
--- a/sysutils/open-vm-tools/patches/patch-ay
+++ b/sysutils/open-vm-tools/patches/patch-ay
@@ -1,13 +1,13 @@
-$NetBSD: patch-ay,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-ay,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/vm_product.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/vm_product.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/vm_product.h
-@@ -498,6 +498,8 @@
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows"
- #elif defined(__FreeBSD__)
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD"
+@@ -514,6 +514,8 @@
+ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Mac OS X"
+ #elif defined __ANDROID__
+ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Android"
+#elif defined(__NetBSD__)
+# define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetBSD"
- #elif defined(sun)
- # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris"
- #elif defined(__APPLE__)
+ #else
+ # ifdef VMX86_TOOLS
+ # error "Define a product string for this platform."
diff --git a/sysutils/open-vm-tools/patches/patch-az b/sysutils/open-vm-tools/patches/patch-az
index 3529c5d4c35..bee955b91fe 100644
--- a/sysutils/open-vm-tools/patches/patch-az
+++ b/sysutils/open-vm-tools/patches/patch-az
@@ -1,8 +1,8 @@
-$NetBSD: patch-az,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-az,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/include/vmblock.h.orig 2008-08-08 02:01:52.000000000 -0500
+--- lib/include/vmblock.h.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/include/vmblock.h
-@@ -25,12 +25,13 @@
+@@ -83,11 +83,11 @@
#ifndef _VMBLOCK_H_
#define _VMBLOCK_H_
@@ -14,25 +14,35 @@ $NetBSD: patch-az,v 1.2 2008/08/31 06:36:48 scottr Exp $
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
# include <sys/param.h>
-+# include <sys/ioctl.h>
#endif
- #define VMBLOCK_FS_NAME "vmblock"
-@@ -54,7 +55,7 @@
+@@ -164,7 +164,7 @@
+ "/" VMBLOCK_CONTROL_DEVNAME
# define VMBLOCK_DEVICE_MODE O_WRONLY
- # define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op)
-#elif defined(sun) || defined(__FreeBSD__)
+#elif defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ # define VMBLOCK_FS_NAME "vmblock"
# define VMBLOCK_MOUNT_POINT "/var/run/" VMBLOCK_FS_NAME
- # define VMBLOCK_DEVICE VMBLOCK_MOUNT_POINT
- # define VMBLOCK_DEVICE_MODE O_RDONLY
-@@ -71,7 +72,7 @@
+ # define VMBLOCK_FS_ROOT VMBLOCK_MOUNT_POINT
+@@ -196,6 +196,20 @@
+ # define VMBLOCK_LIST_FILEBLOCKS _IO('Z', 3)
+ # define VMBLOCK_PURGE_FILEBLOCKS _IO('Z', 4)
# endif
- # define VMBLOCK_CONTROL(fd, op, path) ioctl(fd, op, path)
++# elif defined(__NetBSD__) /* } else if (NetBSD) { */
++ /*
++ * Similar to Solaris, construct ioctl(2) commands for block operations.
++ * Since the FreeBSD implementation does not change the user's passed-in
++ * data (pathname), we use the _IOW macro to define commands which write
++ * to the kernel. (As opposed to _IOR or _IOWR.) Groups 'v' and 'V'
++ * are taken by terminal drivers, so I opted for group 'Z'.
++ */
++# define VMBLOCK_ADD_FILEBLOCK _IOW('z', 1, char[MAXPATHLEN] )
++# define VMBLOCK_DEL_FILEBLOCK _IOW('z', 2, char[MAXPATHLEN] )
++# ifdef VMX86_DEVEL
++# define VMBLOCK_LIST_FILEBLOCKS _IO('z', 3)
++# define VMBLOCK_PURGE_FILEBLOCKS _IO('z', 4)
++# endif
--# elif defined(__FreeBSD__) /* } else if (FreeBSD) { */
-+# elif defined(__FreeBSD__) || defined(__NetBSD__) /* } else if (FreeBSD) { */
- /*
- * Similar to Solaris, construct ioctl(2) commands for block operations.
- * Since the FreeBSD implementation does not change the user's passed-in
+ # endif /* } */
+ #else
diff --git a/sysutils/open-vm-tools/patches/patch-ba b/sysutils/open-vm-tools/patches/patch-ba
index 3b382edc07c..9aa799689b8 100644
--- a/sysutils/open-vm-tools/patches/patch-ba
+++ b/sysutils/open-vm-tools/patches/patch-ba
@@ -1,17 +1,8 @@
-$NetBSD: patch-ba,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-ba,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/misc/codesetOld.c.orig 2008-08-08 02:01:54.000000000 -0500
+--- lib/misc/codesetOld.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/misc/codesetOld.c
-@@ -70,7 +70,7 @@
- #endif
-
-
--#if defined(__FreeBSD__) || defined(sun)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- static const char nul[] = {'\0', '\0'};
- #else
- static const wchar_t nul = L'\0';
-@@ -735,7 +735,7 @@ CodeSetOldGetCodeSetFromLocale(void)
+@@ -670,7 +670,7 @@ CodeSetOldGetCodeSetFromLocale(void)
codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new));
freelocale(new);
@@ -19,4 +10,4 @@ $NetBSD: patch-ba,v 1.2 2008/08/31 06:36:48 scottr Exp $
+#elif defined(sun) || defined(__NetBSD__)
char *locale = setlocale(LC_CTYPE, NULL);
- if (!setlocale(LC_CTYPE, "")) {
+
diff --git a/sysutils/open-vm-tools/patches/patch-bb b/sysutils/open-vm-tools/patches/patch-bb
index 5205b355718..d40adbdb616 100644
--- a/sysutils/open-vm-tools/patches/patch-bb
+++ b/sysutils/open-vm-tools/patches/patch-bb
@@ -1,62 +1,49 @@
-$NetBSD: patch-bb,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-bb,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/misc/idLinux.c.orig 2008-08-08 02:01:54.000000000 -0500
+--- lib/misc/idLinux.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/misc/idLinux.c
-@@ -99,7 +99,7 @@ static AuthorizationRef IdAuthCreateWith
- #endif
-
-
--#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
-+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------------
- *
-@@ -163,6 +163,9 @@ Id_SetGid(gid_t egid) // IN: new egid
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
- #else
+@@ -119,7 +119,7 @@ static AuthorizationRef IdAuthCreateWith
+ int
+ Id_SetUid(uid_t euid) // IN: new euid
+ {
+-#if defined(__FreeBSD__) || defined(sun)
++#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ return setuid(euid);
+ #elif defined(linux) || defined __ANDROID__
if (uid32) {
- int r = syscall(SYS_setgid32, egid);
-@@ -207,6 +210,9 @@ Id_SetRESUid(uid_t uid, // IN: new uid
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+@@ -162,7 +162,7 @@ Id_SetGid(gid_t egid) // IN: new egid
+ Warning("XXXMACOS: implement %s\n", __func__);
+
return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
+-#elif defined(sun) || defined(__FreeBSD__)
++#elif defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ return setgid(egid);
#else
if (uid32) {
- int r = syscall(SYS_setresuid32, uid, euid, suid);
-@@ -249,6 +255,9 @@ Id_SetRESGid(gid_t gid, // IN: new gid
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
+@@ -365,7 +365,7 @@ Id_SetREUid(uid_t uid, // IN: new uid
+ #if defined(__APPLE__)
+ Warning("XXXMACOS: implement %s\n", __func__);
return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
+-#elif defined(sun) || defined(__FreeBSD__)
++#elif defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ return setreuid(uid, euid);
#else
if (uid32) {
- int r = syscall(SYS_setresgid32, gid, egid, sgid);
-@@ -295,6 +304,9 @@ Id_SetREUid(uid_t uid, // IN: new uid
- #elif defined(__FreeBSD__)
- Warning("XXXFreeBSD: implement %s\n", __FUNCTION__);
- return -1;
-+#elif defined(__NetBSD__)
-+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__);
-+ return -1;
+@@ -406,7 +406,7 @@ int
+ Id_SetREGid(gid_t gid, // IN: new gid
+ gid_t egid) // IN: new effective gid
+ {
+-#if defined(sun) || defined(__FreeBSD__)
++#if defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+ return setregid(gid, egid);
#else
if (uid32) {
- int r = syscall(SYS_setreuid32, uid, euid);
-@@ -308,7 +320,7 @@ Id_SetREUid(uid_t uid, // IN: new uid
- }
-
-
--#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__)
-+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------------
- *
+@@ -1057,7 +1057,7 @@ IdIsSetUGid(void)
+ Bool
+ Id_IsSetUGid(void)
+ {
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ uid_t ruid = getuid();
+ uid_t euid = geteuid();
+ gid_t rgid = getgid();
diff --git a/sysutils/open-vm-tools/patches/patch-bc b/sysutils/open-vm-tools/patches/patch-bc
index 8bf40f09ff3..8aa1d998e4a 100644
--- a/sysutils/open-vm-tools/patches/patch-bc
+++ b/sysutils/open-vm-tools/patches/patch-bc
@@ -1,8 +1,8 @@
-$NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-bc,v 1.3 2016/10/09 03:41:56 ryoon Exp $
---- lib/misc/posixPosix.c.orig 2008-08-08 02:01:54.000000000 -0500
+--- lib/misc/posixPosix.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/misc/posixPosix.c
-@@ -50,7 +50,7 @@
+@@ -47,7 +47,7 @@
#include <sys/param.h>
#include <sys/mount.h>
#include <CoreFoundation/CoreFoundation.h>
@@ -10,48 +10,17 @@ $NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/param.h>
#include <sys/mount.h>
- #elif !defined(N_PLAT_NLM)
-@@ -77,6 +77,7 @@
- # endif
-
- #include "vmware.h"
-+#include "vm_atomic.h"
- #include "posixInt.h"
- #if defined(sun)
- #include "hashTable.h" // For setenv emulation
-@@ -1578,7 +1579,7 @@ GetpwInternal(struct passwd *pw) // IN:
- spw.pw_gecos = NULL;
- free(spw.pw_shell);
- spw.pw_shell = NULL;
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- free(spw.pw_class);
- spw.pw_class = NULL;
- #endif
-@@ -1586,10 +1587,12 @@ GetpwInternal(struct passwd *pw) // IN:
- /* Fill out structure with new values. */
- spw.pw_uid = pw->pw_uid;
- spw.pw_gid = pw->pw_gid;
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- spw.pw_change = pw->pw_change;
- spw.pw_expire = pw->pw_expire;
-+# if defined(__FreeBSD__)
- spw.pw_fields = pw->pw_fields;
-+# endif
+ #elif defined(sun)
+@@ -65,7 +65,7 @@
+ #define VM_SYSTEM_HAS_GETGRNAM_R 1
#endif
- #if !defined(sun)
-@@ -1617,7 +1620,7 @@ GetpwInternal(struct passwd *pw) // IN:
- (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) {
- goto exit;
- }
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- if (pw->pw_class &&
- (spw.pw_class = Unicode_Alloc(pw->pw_class, STRING_ENCODING_DEFAULT)) == NULL) {
- goto exit;
-@@ -1634,7 +1637,7 @@ exit:
+-# if defined(__FreeBSD__)
++# if defined(__FreeBSD__) || defined(__NetBSD__)
+ # include <sys/syslimits.h> // PATH_MAX
+ # else
+ # include <limits.h> // PATH_MAX
+@@ -1585,7 +1585,7 @@ Posix_Putenv(char *name) // IN:
}
@@ -60,16 +29,7 @@ $NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $
/*
*----------------------------------------------------------------------
-@@ -1902,7 +1905,7 @@ PasswdCopy(struct passwd *orig, // IN
- if (!CopyFieldIntoBuf(orig->pw_shell, &new->pw_shell, &buf, &bufLen)) {
- return NULL;
- }
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- if (!CopyFieldIntoBuf(orig->pw_class, &new->pw_class, &buf, &bufLen)) {
- return NULL;
- }
-@@ -2647,7 +2650,7 @@ Posix_Getgrnam_r(ConstUnicode name, /
+@@ -1746,7 +1746,7 @@ Posix_Unsetenv(const char *name) // IN:
#if !defined(sun) // {
@@ -78,12 +38,3 @@ $NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $
/*
*----------------------------------------------------------------------
*
-@@ -3030,7 +3033,7 @@ Posix_Fprintf(FILE *stream,
- }
-
-
--#endif // } !defined(__APPLE__) && !defined(__FreeBSD)
-+#endif // } !defined(__APPLE__) && !defined(__FreeBSD) && !defined(__NetBSD__)
-
-
- #else // } !defined(sun) {
diff --git a/sysutils/open-vm-tools/patches/patch-bd b/sysutils/open-vm-tools/patches/patch-bd
index 22952c26866..1d5eb9a468c 100644
--- a/sysutils/open-vm-tools/patches/patch-bd
+++ b/sysutils/open-vm-tools/patches/patch-bd
@@ -1,22 +1,20 @@
-$NetBSD: patch-bd,v 1.1 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-bd,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- lib/misc/util_misc.c.orig 2008-08-08 02:01:54.000000000 -0500
+--- lib/misc/util_misc.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/misc/util_misc.c
-@@ -47,7 +47,7 @@
- # include <pwd.h>
- #endif
+@@ -488,6 +488,15 @@ Util_GetCurrentThreadId(void)
+ ASSERT_ON_COMPILE(sizeof(Util_ThreadID) >= sizeof(pthread_t));
--#if defined(__APPLE__) || defined(__FreeBSD__)
-+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
- #include <pthread.h>
- #endif
-
-@@ -481,7 +481,7 @@ Util_GetCurrentThreadId(void)
- tid = getpid();
- ASSERT(tid != (pid_t)-1);
- return tid;
--#elif defined(__APPLE__) || defined(__FreeBSD__)
-+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
- ASSERT_ON_COMPILE(sizeof(Util_ThreadID) == sizeof(pthread_t));
return pthread_self();
++#elif defined(__NetBSD__)
++ /*
++ * These OSes do not implement OS-native thread IDs. You probably
++ * didn't need one anyway, but guess that pthread_self works
++ * well enough.
++ */
++ ASSERT_ON_COMPILE(sizeof(Util_ThreadID) >= sizeof(pthread_t));
++
++ return pthread_self();
#elif defined(_WIN32)
+ return GetCurrentThreadId();
+ #else
diff --git a/sysutils/open-vm-tools/patches/patch-be b/sysutils/open-vm-tools/patches/patch-be
index 031ba551528..b070c9ef7b7 100644
--- a/sysutils/open-vm-tools/patches/patch-be
+++ b/sysutils/open-vm-tools/patches/patch-be
@@ -1,6 +1,6 @@
-$NetBSD: patch-be,v 1.1 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-be,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- lib/netUtil/netUtilLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/netUtil/netUtilLinux.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/netUtil/netUtilLinux.c
@@ -31,7 +31,7 @@
#endif
@@ -11,30 +11,3 @@ $NetBSD: patch-be,v 1.1 2008/08/31 06:36:48 scottr Exp $
# error This file should not be compiled
#endif
-@@ -58,7 +58,7 @@
- #include <net/if.h>
- #include <sys/ioctl.h>
-
--#if defined(__FreeBSD__) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- #include "ifaddrs.h"
- #endif
-
-@@ -94,7 +94,7 @@
- *----------------------------------------------------------------------
- */
-
--#if !defined(__FreeBSD__) && !defined(__APPLE__) /* { */
-+#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__) /* { */
- char *
- NetUtil_GetPrimaryIP(void)
- {
-@@ -168,7 +168,7 @@ error:
- return NULL;
- }
-
--#else /* } FreeBSD || APPLE { */
-+#else /* } FreeBSD || APPLE || NetBSD { */
-
- char *
- NetUtil_GetPrimaryIP(void)
diff --git a/sysutils/open-vm-tools/patches/patch-bf b/sysutils/open-vm-tools/patches/patch-bf
index f8608d3c23f..dadf2792d62 100644
--- a/sysutils/open-vm-tools/patches/patch-bf
+++ b/sysutils/open-vm-tools/patches/patch-bf
@@ -1,31 +1,197 @@
-$NetBSD: patch-bf,v 1.1 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-bf,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- lib/procMgr/procMgrPosix.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/procMgr/procMgrPosix.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/procMgr/procMgrPosix.c
-@@ -31,7 +31,7 @@
+@@ -27,7 +27,7 @@
// pull in setresuid()/setresgid() if possible
#define _GNU_SOURCE
#include <unistd.h>
-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
#include <asm/param.h>
- #include <locale.h>
- #include <sys/stat.h>
-@@ -158,7 +158,7 @@ ProcMgr_ProcList *
+ #endif
+ #if !defined(sun) && !defined(__APPLE__)
+@@ -47,13 +47,13 @@
+ #include <time.h>
+ #include <grp.h>
+ #include <sys/syscall.h>
+-#if defined(linux) || defined(__FreeBSD__) || defined(HAVE_SYS_USER_H)
++#if defined(linux) || defined(__FreeBSD__) || defined(HAVE_SYS_USER_H) || defined(__NetBSD__)
+ // sys/param.h is required on FreeBSD before sys/user.h
+ # include <sys/param.h>
+ // Pull in PAGE_SIZE/PAGE_SHIFT defines ahead of vm_basic_defs.h
+ # include <sys/user.h>
+ #endif
+-#if defined (__FreeBSD__)
++#if defined (__FreeBSD__) || defined(__NetBSD__)
+ #include <kvm.h>
+ #include <limits.h>
+ #include <paths.h>
+@@ -633,7 +633,7 @@ abort:
+ *----------------------------------------------------------------------
+ */
+
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ ProcMgrProcInfoArray *
ProcMgr_ListProcesses(void)
{
- ProcMgr_ProcList *procList = NULL;
--#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
- Bool failed = FALSE;
- DynBuf dbProcId;
- DynBuf dbProcCmd;
-@@ -453,7 +453,7 @@ abort:
- ProcMgr_FreeProcList(procList);
- procList = NULL;
- }
--#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
-+#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+@@ -641,7 +641,11 @@ ProcMgr_ListProcesses(void)
+ ProcMgrProcInfo procInfo;
+ Bool failed = TRUE;
+ static kvm_t *kd;
++#if defined(__NetBSD__)
++ struct kinfo_proc2 *kp;
++#else
+ struct kinfo_proc *kp;
++#endif
+ char errbuf[_POSIX2_LINE_MAX];
+ int i;
+ int nentries=-1;
+@@ -664,7 +668,12 @@ ProcMgr_ListProcesses(void)
+ /*
+ * Get the list of process info structs
+ */
++#if defined(__NetBSD__)
++ int temp;
++ kp = kvm_getproc2(kd, KERN_PROC_ALL, flag, temp, &nentries);
++#else
+ kp = kvm_getprocs(kd, KERN_PROC_PROC, flag, &nentries);
++#endif
+ if (kp == NULL || nentries <= 0) {
+ Warning("%s: failed to get proc infos with error: %s\n",
+ __FUNCTION__, kvm_geterr(kd));
+@@ -692,14 +701,26 @@ ProcMgr_ListProcesses(void)
+ /*
+ * Store the pid of the process.
+ */
++#if defined(__NetBSD__)
++ procInfo.procId = kp->p_pid;
++#else
+ procInfo.procId = kp->ki_pid;
++#endif
+
+ /*
+ * Store the owner of the process.
+ */
++#if defined(__NetBSD__)
++ pwd = getpwuid(kp->p_uid);
++#else
+ pwd = getpwuid(kp->ki_uid);
++#endif
+ procInfo.procOwner = (NULL == pwd)
++#if defined(__NetBSD__)
++ ? Str_SafeAsprintf(NULL, "%d", (int) kp->p_uid)
++#else
+ ? Str_SafeAsprintf(NULL, "%d", (int) kp->ki_uid)
++#endif
+ : Unicode_Alloc(pwd->pw_name, STRING_ENCODING_DEFAULT);
+
+ /*
+@@ -707,15 +728,24 @@ ProcMgr_ListProcesses(void)
+ * maximum allowed size, then we can save it right now. Else we shall
+ * need to try and parse it from the entire command line.
+ */
++#if defined(__NetBSD__)
++ if (strlen(kp->p_comm) + 1 < sizeof kp->p_comm) {
++ procInfo.procCmdName = Unicode_Alloc(kp->p_comm, STRING_ENCODING_DEFAULT);
++#else
+ if (strlen(kp->ki_comm) + 1 < sizeof kp->ki_comm) {
+ procInfo.procCmdName = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT);
++#endif
+ cmdNameLookup = FALSE;
+ }
+
+ /*
+ * Store the command line string of the process.
+ */
++#if defined(__NetBSD__)
++ cmdLineTemp = kvm_getargv2(kd, kp, 0);
++#else
+ cmdLineTemp = kvm_getargv(kd, kp, 0);
++#endif
+ if (cmdLineTemp != NULL) {
+ /*
+ * Flatten the argument list to get cmd & all params.
+@@ -771,9 +801,15 @@ ProcMgr_ListProcesses(void)
+ procInfo.procCmdLine = DynBuf_Detach(&dbuf);
+ DynBuf_Destroy(&dbuf);
+ } else {
++#if defined(__NetBSD__)
++ procInfo.procCmdLine = Unicode_Alloc(kp->p_comm, STRING_ENCODING_DEFAULT);
++ if (cmdNameLookup) {
++ procInfo.procCmdName = Unicode_Alloc(kp->p_comm, STRING_ENCODING_DEFAULT);
++#else
+ procInfo.procCmdLine = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT);
+ if (cmdNameLookup) {
+ procInfo.procCmdName = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT);
++#endif
+ cmdNameLookup = FALSE;
+ }
+ }
+@@ -781,7 +817,11 @@ ProcMgr_ListProcesses(void)
+ /*
+ * Store the start time of the process
+ */
++#if defined(__NetBSD__)
++ procInfo.procStartTime = kp->p_rtime_sec;
++#else
+ procInfo.procStartTime = kp->ki_start.tv_sec;
++#endif
+
+ /*
+ * Store the process info pointer into a list buffer.
+@@ -811,7 +851,7 @@ abort:
return procList;
}
+-#endif // defined(__FreeBSD__)
++#endif // defined(__NetBSD__)
+
+
+ #if defined(__APPLE__)
+@@ -2033,7 +2073,7 @@ ProcMgr_Free(ProcMgr_AsyncProc *asyncPro
+ free(asyncProc);
+ }
+
+-#if defined(linux) || defined(__FreeBSD__) || defined(__APPLE__)
++#if defined(linux) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+
+ /*
+ *----------------------------------------------------------------------
+@@ -2106,7 +2146,7 @@ ProcMgr_ImpersonateUserStart(const char
+ // first change group
+ #if defined(USERWORLD)
+ ret = Id_SetREGid(ppw->pw_gid, ppw->pw_gid);
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
+ ret = setregid(ppw->pw_gid, ppw->pw_gid);
+ #else
+ ret = setresgid(ppw->pw_gid, ppw->pw_gid, root_gid);
+@@ -2125,7 +2165,7 @@ ProcMgr_ImpersonateUserStart(const char
+ // now user
+ #if defined(USERWORLD)
+ ret = Id_SetREUid(ppw->pw_uid, ppw->pw_uid);
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
+ ret = setreuid(ppw->pw_uid, ppw->pw_uid);
+ #else
+ ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0);
+@@ -2187,7 +2227,7 @@ ProcMgr_ImpersonateUserStop(void)
+ // first change back user
+ #if defined(USERWORLD)
+ ret = Id_SetREUid(ppw->pw_uid, ppw->pw_uid);
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
+ ret = setreuid(ppw->pw_uid, ppw->pw_uid);
+ #else
+ ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0);
+@@ -2200,7 +2240,7 @@ ProcMgr_ImpersonateUserStop(void)
+ // now group
+ #if defined(USERWORLD)
+ ret = Id_SetREGid(ppw->pw_gid, ppw->pw_gid);
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__NetBSD__)
+ ret = setregid(ppw->pw_gid, ppw->pw_gid);
+ #else
+ ret = setresgid(ppw->pw_gid, ppw->pw_gid, ppw->pw_gid);
diff --git a/sysutils/open-vm-tools/patches/patch-bg b/sysutils/open-vm-tools/patches/patch-bg
deleted file mode 100644
index 755e93a5c1d..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bg
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-bg,v 1.1 2008/08/31 06:36:48 scottr Exp $
-
---- lib/string/str.c.orig 2008-08-08 02:01:55.000000000 -0500
-+++ lib/string/str.c
-@@ -37,6 +37,10 @@
- #endif
- #include "codeset.h"
-
-+#ifdef __NetBSD__
-+#include <wchar.h>
-+#endif
-+
- #if defined _WIN32 && !defined HAS_BSD_PRINTF
- #define vsnprintf _vsnprintf
- #endif
-@@ -604,7 +608,7 @@ Str_SafeVasprintf(size_t *length,
- return StrVasprintf_Internal(length, format, arguments, TRUE);
- }
-
--#if defined(_WIN32) || defined(GLIBC_VERSION_22)
-+#if defined(_WIN32) || (defined(GLIBC_VERSION_22) && !defined(__NetBSD__))
-
- /*
- *----------------------------------------------------------------------
diff --git a/sysutils/open-vm-tools/patches/patch-bh b/sysutils/open-vm-tools/patches/patch-bh
index 99814cf17d4..8499fd1d3fb 100644
--- a/sysutils/open-vm-tools/patches/patch-bh
+++ b/sysutils/open-vm-tools/patches/patch-bh
@@ -1,6 +1,6 @@
-$NetBSD: patch-bh,v 1.1 2008/08/31 06:36:48 scottr Exp $
+$NetBSD: patch-bh,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- lib/system/systemLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
+--- lib/system/systemLinux.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/system/systemLinux.c
@@ -26,7 +26,7 @@
*
@@ -11,21 +11,3 @@ $NetBSD: patch-bh,v 1.1 2008/08/31 06:36:48 scottr Exp $
# error This file should not be compiled
#endif
-@@ -55,7 +55,7 @@
- #include <net/if.h>
- #include <sys/ioctl.h>
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- #include "ifaddrs.h"
- #endif
-
-@@ -352,7 +352,7 @@ System_Shutdown(Bool reboot) // IN: "re
- if (reboot) {
- cmd = "shutdown -r now";
- } else {
--#if __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
- cmd = "shutdown -p now";
- #else
- cmd = "shutdown -h now";
diff --git a/sysutils/open-vm-tools/patches/patch-bi b/sysutils/open-vm-tools/patches/patch-bi
deleted file mode 100644
index 3edc79b3edd..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bi
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-bi,v 1.1 2008/08/31 06:36:48 scottr Exp $
-
---- lib/unicode/unicodeSimpleTypes.c.orig 2008-08-08 02:01:55.000000000 -0500
-+++ lib/unicode/unicodeSimpleTypes.c
-@@ -2198,7 +2198,7 @@ UnicodeNormalizeEncodingName(const char
-
- for (currentResult = result; *encodingName != '\0'; encodingName++) {
- if (isalnum((int) *encodingName)) {
-- *currentResult = tolower(*encodingName);
-+ *currentResult = tolower((int)(*encodingName));
- currentResult++;
- }
- }
diff --git a/sysutils/open-vm-tools/patches/patch-bj b/sysutils/open-vm-tools/patches/patch-bj
deleted file mode 100644
index 92b862629ce..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bj
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-bj,v 1.1 2008/08/31 06:36:48 scottr Exp $
-
---- lib/user/hostinfoPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
-+++ lib/user/hostinfoPosix.c
-@@ -894,8 +894,8 @@ HostinfoGetCpuInfo(int nCpu, //
- e = s + strlen(s);
-
- /* Skip leading and trailing while spaces */
-- for (; s < e && isspace(*s); s++);
-- for (; s < e && isspace(e[-1]); e--);
-+ for (; s < e && isspace((unsigned)*s); s++);
-+ for (; s < e && isspace((unsigned)e[-1]); e--);
- *e = 0;
-
- /* Free previous value */
-@@ -1224,7 +1224,9 @@ Hostinfo_ResetProcessState(const int *ke
- {
- int s, fd;
- struct sigaction sa;
-+#ifdef RLIMIT_AS
- struct rlimit rlim;
-+#endif
- #ifdef __linux__
- int err;
- uid_t euid;
-@@ -1260,10 +1262,12 @@ Hostinfo_ResetProcessState(const int *ke
- }
- }
-
-+#ifdef RLIMIT_AS
- if (getrlimit(RLIMIT_AS, &rlim) == 0) {
- rlim.rlim_cur = rlim.rlim_max;
- setrlimit(RLIMIT_AS, &rlim);
- }
-+#endif
-
- #ifdef __linux__
- /*
diff --git a/sysutils/open-vm-tools/patches/patch-bk b/sysutils/open-vm-tools/patches/patch-bk
deleted file mode 100644
index 6e46e0ede76..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bk
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-bk,v 1.1 2008/08/31 06:36:48 scottr Exp $
-
---- lib/user/utilPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
-+++ lib/user/utilPosix.c
-@@ -35,7 +35,7 @@
- #include <errno.h>
- #include <dirent.h>
-
--#if !__FreeBSD__ && !sun
-+#if !__FreeBSD__ && !sun && !__NetBSD__
- # include <pwd.h>
- #endif
-
-@@ -85,7 +85,7 @@
-
-
-
--#if !__FreeBSD__ && !sun
-+#if !__FreeBSD__ && !sun && !__NetBSD__
-
- /*
- *-----------------------------------------------------------------------------
-@@ -624,7 +624,7 @@ Util_GetSafeTmpDir(Bool useConf) // IN
- #endif // __linux__
-
-
--#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- /*
- *----------------------------------------------------------------------------
- *
diff --git a/sysutils/open-vm-tools/patches/patch-bl b/sysutils/open-vm-tools/patches/patch-bl
deleted file mode 100644
index 7d9661d4fdb..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bl
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD: patch-bl,v 1.1 2008/08/31 06:36:48 scottr Exp $
-
---- lib/vixTools/vixTools.c.orig 2008-08-08 02:01:53.000000000 -0500
-+++ lib/vixTools/vixTools.c
-@@ -74,7 +74,7 @@
- #endif
-
- /* Only Windows and Linux use impersonation functions. */
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- #include "impersonate.h"
- #endif
-
-@@ -702,7 +702,7 @@ VixTools_GetToolsPropertiesImpl(GuestApp
- VixPropertyListImpl propList;
- char *serializedBuffer = NULL;
- size_t serializedBufferLength = 0;
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- char guestName[512];
- int osFamily;
- char *packageList = NULL;
-@@ -937,7 +937,7 @@ VixToolsSetProperties(VixCommandRequestH
- GuestApp_Dict **confDictRef) // IN
- {
- VixError err = VIX_OK;
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- size_t serialBufferLength;
- char *serialBuffer = NULL;
- VixPropertyListImpl propList;
-@@ -1734,7 +1734,7 @@ VixToolsMoveFile(VixCommandRequestHeader
- * Be careful. Renaming a file to itself can cause it to be deleted.
- * This should be a no-op anyway.
- */
--#if !defined(sun) && !defined(__FreeBSD__)
-+#if !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- if (File_IsSameFile(srcFilePathName, destFilePathName)) {
- err = VIX_OK;
- goto abort;
-@@ -2716,7 +2716,7 @@ VixToolsImpersonateUserImplEx(char const
- }
-
- ///////////////////////////////////////////////////////////////////////
--#if defined(__FreeBSD__) || defined(sun)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- err = VIX_E_NOT_SUPPORTED;
- ///////////////////////////////////////////////////////////////////////
- #elif defined(_WIN32) || defined(linux)
-@@ -2913,7 +2913,7 @@ VixToolsLogoutUser(void *userToken) /
- return;
- }
-
--#if !defined(__FreeBSD__) && !defined(sun)
-+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
- if (NULL != userToken) {
- AuthToken authToken = (AuthToken) userToken;
- Auth_CloseToken(authToken);
-@@ -3105,7 +3105,7 @@ VixToolsProcessHgfsPacket(VixCommandHgfs
- hgfsPacket = ((char *) requestMsg) + sizeof(*requestMsg);
- hgfsPacketSize = requestMsg->hgfsPacketSize;
-
--#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__)
-+#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- /*
- * Impersonation was okay, so let's give our packet to
- * the HGFS server and forward the reply packet back.
diff --git a/sysutils/open-vm-tools/patches/patch-bm b/sysutils/open-vm-tools/patches/patch-bm
index 7e7ba29b09e..e6a4fe8d2dc 100644
--- a/sysutils/open-vm-tools/patches/patch-bm
+++ b/sysutils/open-vm-tools/patches/patch-bm
@@ -1,6 +1,6 @@
-$NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $
+$NetBSD: patch-bm,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- lib/wiper/wiperPosix.c.orig 2008-08-08 02:01:55.000000000 -0500
+--- lib/wiper/wiperPosix.c.orig 2016-02-16 20:06:46.000000000 +0000
+++ lib/wiper/wiperPosix.c
@@ -23,7 +23,7 @@
*
@@ -11,49 +11,42 @@ $NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $
#error This file should not be compiled on this platform.
#endif
-@@ -31,12 +31,12 @@
- #include <sys/stat.h>
- #if defined(__linux__) || defined(sun)
- # include <sys/vfs.h>
--#elif defined(__FreeBSD__) || defined(__APPLE__)
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
- # include <sys/param.h>
- # include <sys/ucred.h>
- # include <sys/mount.h>
- # include <fstab.h>
--# if __FreeBSD_version >= 500000
-+# if defined(__FreeBSD__) && __FreeBSD_version >= 500000
- # include <libgen.h>
- # endif /* __FreeBSD_version < 500000 */
- #endif
-@@ -66,7 +66,7 @@
+@@ -70,7 +70,7 @@
+ /* Number of device numbers to store for device-mapper */
+ #define WIPER_MAX_DM_NUMBERS 8
- #if defined(sun) || defined(__linux__)
+-#if defined(sun) || defined(__linux__)
++#if defined(sun) || defined(__linux__) || defined(__NetBSD__)
# define PROCFS "proc"
--#elif defined(__FreeBSD__) || defined(__APPLE__)
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
+ #elif defined(__FreeBSD__) || defined(__APPLE__)
# define PROCFS "procfs"
- #endif
+@@ -158,6 +158,16 @@ static unsigned char *WiperGetSpace(Wipe
+ static void WiperClean(WiperState *state);
+
-@@ -196,7 +196,7 @@ WiperIsDiskDevice(MNTINFO *mnt,
- return TRUE;
++#if defined(__NetBSD__)
++#define MAX_DISK_MAJORS 256 /* should be enough for now */
++#define NUM_PRESEEDED_MAJORS 10 /* must match the below */
++static unsigned int knownDiskMajor[MAX_DISK_MAJORS] = {
++16, 20, 18, 14, 4,
++0, 2, 19, 142, 168
++};
++static int numDiskMajors = NUM_PRESEEDED_MAJORS;
++#endif
++
+ #if defined(__linux__)
+
+ #define MAX_DISK_MAJORS 256 /* should be enough for now */
+@@ -310,7 +320,7 @@ WiperIsDiskDevice(MNTINFO *mnt,
+ return FALSE;
}
--#elif defined(__FreeBSD__) || defined(__APPLE__) /* } FreeBSD { */
-+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) /* } FreeBSD { */
+-#elif defined(__linux__) /* } linux { */
++#elif defined(__linux__) || defined(__NetBSD__) /* } linux { */
- static INLINE Bool
+ static Bool
WiperIsDiskDevice(MNTINFO *mnt, // IN: file system being considered
-@@ -210,7 +210,7 @@ WiperIsDiskDevice(MNTINFO *mnt,
- * function, as a whole, does not even apply to OS X, so this caveat is
- * only minor.
- */
--#if __FreeBSD_version < 500000
-+#if defined(__NetBSD__) || __FreeBSD_version < 500000
- /*
- * Before FreeBSD 5, device nodes had static major/minor numbers.
- * (FreeBSD 5 included devfs which got rid of this concept.) So
-@@ -511,14 +511,14 @@ WiperSinglePartition_GetSpace(const Wipe
+@@ -571,7 +581,7 @@ WiperSinglePartition_GetSpace(const Wipe
uint64 *free, // OUT
uint64 *total) // OUT
{
@@ -62,7 +55,8 @@ $NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $
struct statvfs statfsbuf;
#else
struct statfs statfsbuf;
- #endif
+@@ -580,7 +590,7 @@ WiperSinglePartition_GetSpace(const Wipe
+
ASSERT(p);
-#ifdef sun
@@ -70,3 +64,12 @@ $NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $
if (statvfs(p->mountPoint, &statfsbuf) < 0) {
#else
if (Posix_Statfs(p->mountPoint, &statfsbuf) < 0) {
+@@ -588,7 +598,7 @@ WiperSinglePartition_GetSpace(const Wipe
+ return "Unable to statfs() the mount point";
+ }
+
+-#ifdef sun
++#if defined(sun) || defined(__NetBSD__)
+ blockSize = statfsbuf.f_frsize;
+ #else
+ blockSize = statfsbuf.f_bsize;
diff --git a/sysutils/open-vm-tools/patches/patch-bn b/sysutils/open-vm-tools/patches/patch-bn
deleted file mode 100644
index 1a221d154f2..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bn
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-bn,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- scripts/netbsd/poweroff-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
-+++ scripts/netbsd/poweroff-vm-default
-@@ -0,0 +1,32 @@
-+#!/bin/sh
-+##########################################################
-+# Copyright (C) 2004-2008 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
-+# by the Free Software Foundation version 2.1 and no later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
-+# License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+##########################################################
-+
-+##########################################################################
-+# DO NOT modify this file directly as it will be overwritten the next
-+# time the VMware Tools are installed.
-+##########################################################################
-+
-+echo `date` ": Executing '$0'"
-+
-+scriptsdir="`dirname $0`/scripts/`basename $0`.d"
-+if [ -d "$scriptsdir" ]; then
-+ for scriptfile in "$scriptsdir"/*; do
-+ [ -x "$scriptfile" ] && "$scriptfile" poweroff-vm
-+ done
-+fi
diff --git a/sysutils/open-vm-tools/patches/patch-bo b/sysutils/open-vm-tools/patches/patch-bo
deleted file mode 100644
index 455b36bcf1f..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bo
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-bo,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- scripts/netbsd/poweron-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
-+++ scripts/netbsd/poweron-vm-default
-@@ -0,0 +1,32 @@
-+#!/bin/sh
-+##########################################################
-+# Copyright (C) 2004-2008 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
-+# by the Free Software Foundation version 2.1 and no later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
-+# License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+##########################################################
-+
-+##########################################################################
-+# DO NOT modify this file directly as it will be overwritten the next
-+# time the VMware Tools are installed.
-+##########################################################################
-+
-+echo `date` ": Executing '$0'"
-+
-+scriptsdir="`dirname $0`/scripts/`basename $0`.d"
-+if [ -d "$scriptsdir" ]; then
-+ for scriptfile in "$scriptsdir"/*; do
-+ [ -x "$scriptfile" ] && "$scriptfile" poweron-vm
-+ done
-+fi
diff --git a/sysutils/open-vm-tools/patches/patch-bp b/sysutils/open-vm-tools/patches/patch-bp
deleted file mode 100644
index 139b2617941..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bp
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-bp,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- scripts/netbsd/resume-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
-+++ scripts/netbsd/resume-vm-default
-@@ -0,0 +1,35 @@
-+#!/bin/sh
-+##########################################################
-+# Copyright (C) 2004-2008 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
-+# by the Free Software Foundation version 2.1 and no later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
-+# License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+##########################################################
-+
-+##########################################################################
-+# DO NOT modify this file directly as it will be overwritten the next
-+# time the VMware Tools are installed.
-+##########################################################################
-+
-+echo `date` ": Executing '$0'"
-+
-+scriptsdir="`dirname $0`/scripts/`basename $0`.d"
-+if [ -d "$scriptsdir" ]; then
-+ for scriptfile in "$scriptsdir"/*; do
-+ [ -x "$scriptfile" ] && "$scriptfile" resume-vm
-+ done
-+fi
-+
-+# Start the network.
-+/etc/rc.d/dhclient start
diff --git a/sysutils/open-vm-tools/patches/patch-bq b/sysutils/open-vm-tools/patches/patch-bq
deleted file mode 100644
index f05df9d2d37..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bq
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD: patch-bq,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- scripts/netbsd/suspend-vm-default.orig 2008-08-19 17:54:40.000000000 -0500
-+++ scripts/netbsd/suspend-vm-default
-@@ -0,0 +1,37 @@
-+#!/bin/sh
-+##########################################################
-+# Copyright (C) 2004-2008 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
-+# by the Free Software Foundation version 2.1 and no later version.
-+#
-+# This program is distributed in the hope that it will be useful, but
-+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
-+# License for more details.
-+#
-+# You should have received a copy of the GNU Lesser General Public License
-+# along with this program; if not, write to the Free Software Foundation, Inc.,
-+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-+#
-+##########################################################
-+
-+##########################################################################
-+# DO NOT modify this file directly as it will be overwritten the next
-+# time the VMware Tools are installed.
-+##########################################################################
-+
-+echo `date` ": Executing '$0'"
-+
-+scriptsdir="`dirname $0`/scripts/`basename $0`.d"
-+if [ -d "$scriptsdir" ]; then
-+ for scriptfile in "$scriptsdir"/*; do
-+ [ -x "$scriptfile" ] && "$scriptfile" suspend-vm
-+ done
-+fi
-+
-+ps auxw | grep -q dhclient
-+if [ "$?" -eq 0 ]; then
-+ dhclient -r
-+fi
diff --git a/sysutils/open-vm-tools/patches/patch-br b/sysutils/open-vm-tools/patches/patch-br
deleted file mode 100644
index e1b6c55fb3c..00000000000
--- a/sysutils/open-vm-tools/patches/patch-br
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-br,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- toolbox/toolbox-cmd.c.orig 2008-08-08 02:01:57.000000000 -0500
-+++ toolbox/toolbox-cmd.c
-@@ -43,7 +43,10 @@ typedef void (*ToolboxHelpFunc)(char *pr
- * Local Data
- */
-
--const typedef struct CmdTable {
-+#if !defined(__NetBSD__) || __NetBSD_Version__ >= 400000000 // Work around gcc? const-const issue
-+const
-+#endif
-+typedef struct CmdTable {
- const char *command; /* The name of the command. */
- ToolboxCmdFunc func; /* The function to execute. */
- Bool requireRoot; /* Indicates whether root is required. */
diff --git a/sysutils/open-vm-tools/patches/patch-bs b/sysutils/open-vm-tools/patches/patch-bs
deleted file mode 100644
index 0a266994fab..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bs
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-bs,v 1.1 2008/08/31 06:36:49 scottr Exp $
-
---- vmware-user-suid-wrapper/locationsdb.c.orig 2008-08-08 02:01:56.000000000 -0500
-+++ vmware-user-suid-wrapper/locationsdb.c
-@@ -26,7 +26,7 @@
- * link against lib/unixinstall.
- */
-
--#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux)
-+#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) && !defined(__NetBSD__)
- # error This program is not supported on your platform.
- #endif
-
diff --git a/sysutils/open-vm-tools/patches/patch-bu b/sysutils/open-vm-tools/patches/patch-bu
index 63400c0be36..bb8e9349233 100644
--- a/sysutils/open-vm-tools/patches/patch-bu
+++ b/sysutils/open-vm-tools/patches/patch-bu
@@ -1,10 +1,10 @@
-$NetBSD: patch-bu,v 1.1 2008/08/31 06:36:49 scottr Exp $
+$NetBSD: patch-bu,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- vmware-user-suid-wrapper/wrapper-netbsd.c.orig 2008-08-19 17:54:40.000000000 -0500
+--- vmware-user-suid-wrapper/wrapper-netbsd.c.orig 2016-10-04 11:37:33.890972836 +0000
+++ vmware-user-suid-wrapper/wrapper-netbsd.c
-@@ -0,0 +1,140 @@
+@@ -0,0 +1,136 @@
+/*********************************************************
-+ * Copyright (C) 2007 VMware, Inc. All rights reserved.
++ * Copyright (C) 2007-2015 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
@@ -28,10 +28,6 @@ $NetBSD: patch-bu,v 1.1 2008/08/31 06:36:49 scottr Exp $
+ */
+
+
-+#include <sys/param.h>
-+#include <sys/mount.h>
-+// #include <sys/uio.h> // for nmount(2)
-+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
diff --git a/sysutils/open-vm-tools/patches/patch-bv b/sysutils/open-vm-tools/patches/patch-bv
deleted file mode 100644
index ef4e6040f44..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bv
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-bv,v 1.2 2012/12/25 21:02:15 joerg Exp $
-
---- vmware-user/foreignVMToolsDaemon.c.orig 2008-08-08 07:01:56.000000000 +0000
-+++ vmware-user/foreignVMToolsDaemon.c
-@@ -55,7 +55,7 @@
- #include <netinet/tcp.h>
- #include <arpa/inet.h>
- #include <fcntl.h>
--#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__)
-+#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__)
- #include <unistd.h>
- #else
- #include <linux/unistd.h>
-@@ -833,8 +833,7 @@ ForeignToolsSetProperties(ForeignVMTools
- * Do some validation
- */
- if ((NULL == asyncCommand)
-- || (NULL == requestMsg)
-- || (0 > requestMsg->bufferSize)) {
-+ || (NULL == requestMsg)) {
- err = VIX_E_INVALID_ARG;
- goto abort;
- }
diff --git a/sysutils/open-vm-tools/patches/patch-bw b/sysutils/open-vm-tools/patches/patch-bw
deleted file mode 100644
index f9c8901a850..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bw
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-bw,v 1.2 2012/12/25 21:02:15 joerg Exp $
-
---- vmware-user/foreignVMToolsDaemon.h.orig 2008-08-08 07:01:56.000000000 +0000
-+++ vmware-user/foreignVMToolsDaemon.h
-@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
-
- #ifdef __APPLE__
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
--#elif defined(__FreeBSD__) || defined(sun)
-+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
- #include <unistd.h>
- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
- #else
-@@ -72,7 +72,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock
-
- typedef pthread_mutex_t VixLockType;
- static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr);
--VixError VIX_INIT_LOCK(VixLockType *lockPtr)
-+static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr)
- {
- int result;
- pthread_mutexattr_t attr;
diff --git a/sysutils/open-vm-tools/patches/patch-bx b/sysutils/open-vm-tools/patches/patch-bx
deleted file mode 100644
index 8ca9411675b..00000000000
--- a/sysutils/open-vm-tools/patches/patch-bx
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-bx,v 1.2 2012/12/25 21:02:15 joerg Exp $
-
---- xferlogs/xferlogs.c.orig 2008-08-08 07:01:57.000000000 +0000
-+++ xferlogs/xferlogs.c
-@@ -125,7 +125,7 @@ xmitFile(char *filename) //IN : file to
- RpcVMX_Log("%s: %s: ver - %d", LOG_START_MARK, filename, LOG_VERSION);
- while ((readLen = fread(buf, 1, sizeof buf, fp)) > 0 ) {
- if (Base64_Encode(buf, readLen, base64Buf, sizeof base64B - 1, NULL)) {
-- RpcVMX_Log(base64B);
-+ RpcVMX_Log("%s", base64B);
- } else {
- Warning("Error in Base64_Encode\n");
- goto exit;
-@@ -200,8 +200,8 @@ extractFile(char *filename) //IN: vmx lo
- * Ignore the filename in the log, for obvious security reasons
- * and create a new filename consiting of time and enumerator.
- */
-- Str_Sprintf(fname, sizeof fname, "%d_%"FMTTIME".log",
-- filenu++, time(NULL));
-+ Str_Sprintf(fname, sizeof fname, "%d_%lld.log",
-+ filenu++, (long long)time(NULL));
-
- /*
- * Read the version information, if they dont match just warn
-@@ -261,7 +261,7 @@ main(int argc, char *argv[])
- usage();
- return -1;
- } if (argc == 2) {
-- RpcVMX_Log(argv[1]);
-+ RpcVMX_Log("%s", argv[1]);
- return 0;
- }
-
diff --git a/sysutils/open-vm-tools/patches/patch-by b/sysutils/open-vm-tools/patches/patch-by
deleted file mode 100644
index 1a7f05f7d47..00000000000
--- a/sysutils/open-vm-tools/patches/patch-by
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-by,v 1.1 2009/09/22 07:08:05 taca Exp $
-
---- lib/hgfs/hgfsUtil.c.orig 2008-08-08 16:01:54.000000000 +0900
-+++ lib/hgfs/hgfsUtil.c
-@@ -95,24 +95,19 @@ int
- HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format
- uint64 ntTime) // IN: Time in Windows NT format
- {
--#ifndef VM_X86_64
- uint32 sec;
- uint32 nsec;
-
- ASSERT(unixTime);
-- /* We assume that time_t is 32bit */
-- ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4);
-
-- /* Cap NT time values that are outside of Unix time's range */
--
-- if (ntTime >= UNIX_S32_MAX) {
-- unixTime->tv_sec = 0x7FFFFFFF;
-- unixTime->tv_nsec = 0;
-- return 1;
-- }
--#else
-- ASSERT(unixTime);
--#endif
-+ if (sizeof(unixTime->tv_sec) == 4) {
-+ /* Cap NT time values that are outside of Unix time's range */
-+ if (ntTime >= UNIX_S32_MAX) {
-+ unixTime->tv_sec = 0x7FFFFFFF;
-+ unixTime->tv_nsec = 0;
-+ return 1;
-+ }
-+ }
-
- if (ntTime < UNIX_EPOCH) {
- unixTime->tv_sec = 0;
-@@ -120,14 +115,14 @@ HgfsConvertFromNtTimeNsec(struct timespe
- return -1;
- }
-
--#ifndef VM_X86_64
-- Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec);
-- unixTime->tv_sec = sec;
-- unixTime->tv_nsec = nsec * 100;
--#else
-- unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000;
-- unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100;
--#endif
-+ if (sizeof(unixTime->tv_sec) == 4) {
-+ Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec);
-+ unixTime->tv_sec = sec;
-+ unixTime->tv_nsec = nsec * 100;
-+ } else {
-+ unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000;
-+ unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100;
-+ }
-
- return 0;
- }
diff --git a/sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c b/sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c
deleted file mode 100644
index 7f2c362509e..00000000000
--- a/sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD: patch-checkvm_checkvm.c,v 1.2 2013/11/11 16:42:38 joerg Exp $
-
---- checkvm/checkvm.c.orig 2012-12-25 19:48:10.000000000 +0000
-+++ checkvm/checkvm.c
-@@ -46,30 +46,6 @@ VM_EMBED_VERSION(CHECKVM_VERSION_STRING)
- #ifdef __GNUC__
-
- /*
-- * outl and inl: Output or input a 32-bit word
-- */
--static __inline__ void
--outl(
-- const uint32 port,
-- uint32 val
--)
--{
-- __asm__ volatile("out%L0 (%%dx)" : :"a" (val), "d" (port));
--}
--
--static __inline__ uint32
--inl(
-- const uint32 port
--)
--{
-- uint32 ret;
--
-- __asm__ volatile("in%L0 (%%dx)" : "=a" (ret) : "d" (port));
-- return ret;
--}
--
--
--/*
- * getVersion - Read VM version & product code through backdoor
- */
- void
-@@ -77,7 +53,7 @@ getVersion(uint32 *version)
- {
- uint32 eax, ebx, ecx, edx;
-
-- __asm__ volatile("inl (%%dx)" :
-+ __asm__ volatile("inl %%dx, %%eax" :
- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
- "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION),
- "2"(BDOOR_PORT) : "memory");
-@@ -94,7 +70,7 @@ getHWVersion(uint32 *hwVersion)
- {
- uint32 eax, ebx, ecx, edx;
-
-- __asm__ volatile("inl (%%dx)" :
-+ __asm__ volatile("inl %%dx, %%eax" :
- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
- "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION),
- "2"(BDOOR_PORT) : "memory");
-@@ -110,7 +86,7 @@ getScreenSize(uint32 *screensize)
- {
- uint32 eax, ebx, ecx, edx;
-
-- __asm__ volatile("inl (%%dx)" :
-+ __asm__ volatile("inl %%dx, %%eax" :
- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
- "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE),
- "2"(BDOOR_PORT) : "memory");
diff --git a/sysutils/open-vm-tools/patches/patch-configure.ac b/sysutils/open-vm-tools/patches/patch-configure.ac
index 958520b2ec3..988d1df7fe3 100644
--- a/sysutils/open-vm-tools/patches/patch-configure.ac
+++ b/sysutils/open-vm-tools/patches/patch-configure.ac
@@ -1,23 +1,38 @@
-$NetBSD: patch-configure.ac,v 1.1 2013/04/01 12:25:17 joerg Exp $
+$NetBSD: patch-configure.ac,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- configure.ac.orig 2008-08-08 07:01:58.000000000 +0000
+--- configure.ac.orig 2016-02-16 20:06:45.000000000 +0000
+++ configure.ac
-@@ -111,6 +111,9 @@ case "$host_os" in
- [linux*])
- os="linux"
+@@ -136,6 +136,9 @@ case "$host_os" in
+ [solaris*])
+ os="solaris"
;;
+ [netbsd*])
+ os="netbsd"
+ ;;
- [freebsd*])
- os="freebsd"
+ [*])
+ AC_MSG_WARN([This is an untested and unsupported Operating System. Proceed at your own peril.])
;;
-@@ -573,7 +576,7 @@ if test "$with_dnet" = "yes"; then
+@@ -1064,6 +1067,15 @@ if test "$os" = "linux"; then
+ buildHgfsmounter=yes
+ fi
- GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS"
- VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS"
-- if test "$DNET_CONFIG" == dumbnet-config; then
-+ if test "$DNET_CONFIG" = dumbnet-config; then
- AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.])
- fi
- else
++if test "$os" = "netbsd"; then
++ LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm"
++ #MODULES_DIR="/boot/modules"
++
++ #MODULES="$MODULES vmmemctl"
++ #MODULES="$MODULES vmxnet"
++ #MODULES="$MODULES vmblock"
++fi
++
+ if test "$os" = "freebsd" || test "$os" = "kfreebsd-gnu"; then
+ LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm"
+ MODULES_DIR="/boot/modules"
+@@ -1132,6 +1144,7 @@ fi
+ AM_CONDITIONAL(BUILD_HGFSMOUNTER, test "$buildHgfsmounter" = "yes")
+ AM_CONDITIONAL(LINUX, test "$os" = "linux")
+ AM_CONDITIONAL(SOLARIS, test "$os" = "solaris")
++AM_CONDITIONAL(NETBSD, test "$os" = "netbsd")
+ AM_CONDITIONAL(FREEBSD, test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu")
+ AM_CONDITIONAL(FREEBSD_CUSTOM_SYSDIR,
+ test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR")
diff --git a/sysutils/open-vm-tools/patches/patch-guestd_Makefile.am b/sysutils/open-vm-tools/patches/patch-guestd_Makefile.am
deleted file mode 100644
index 33998dc0b4f..00000000000
--- a/sysutils/open-vm-tools/patches/patch-guestd_Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-$NetBSD: patch-guestd_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- guestd/Makefile.am.orig 2008-08-08 07:01:56.000000000 +0000
-+++ guestd/Makefile.am
-@@ -50,8 +50,8 @@ vmware_guestd_LDADD += ../lib/system/lib
- vmware_guestd_LDADD += ../lib/user/libUser.a
- vmware_guestd_LDADD += ../lib/vixTools/libVixTools.a
- vmware_guestd_LDADD += ../lib/vmBackupLib/libVmBackupLib.a
--vmware_guestd_LDADD += ../lib/vmCheck/libVmCheck.a
--vmware_guestd_LDADD += ../lib/vmSignal/libVmSignal.a
-+vmware_guestd_LDADD += ../lib/vmCheck/libVmCheck.la
-+vmware_guestd_LDADD += ../lib/vmSignal/libVmSignal.la
- vmware_guestd_LDADD += ../lib/wiper/libWiper.a
- # In the absence of the linker options --start-group and --end-group (which
- # can't be put in LDADD), we need to bring the following libraries out of the
-@@ -92,19 +92,11 @@ else
- vmware_guestd_LINK = $(LINK)
- endif
-
--if LINUX
--if PAMD
--if THIRTY_TWO_BIT_USERSPACE
--pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd
--else
--pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd-x64
--endif !THIRTY_TWO_BIT_USERSPACE
--endif PAMD
--endif LINUX
-+EGDIR = @datarootdir@/examples
-
- install-exec-hook:
-- $(INSTALL) -d $(DESTDIR)/etc/vmware-tools
-- echo 'disable-tools-version = "true"' > $(DESTDIR)/etc/vmware-tools/tools.conf
-+ $(INSTALL) -d $(DESTDIR)${EGDIR}/vmware-tools
-+ echo 'disable-tools-version = "true"' > $(DESTDIR)${EGDIR}/vmware-tools/tools.conf
-
- uninstall-hook:
-- $(RM) -rf $(DESTDIR)/etc/vmware-tools
-+ $(RM) -rf $(DESTDIR)${EGDIR}/vmware-tools
diff --git a/sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am b/sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am
deleted file mode 100644
index 02f6833ca02..00000000000
--- a/sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-hgfsclient_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- hgfsclient/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000
-+++ hgfsclient/Makefile.am
-@@ -25,8 +25,8 @@ vmware_hgfsclient_LDADD += ../lib/hgfsBd
- vmware_hgfsclient_LDADD += ../lib/rpcOut/libRpcOut.a
- vmware_hgfsclient_LDADD += ../lib/string/libString.a
- vmware_hgfsclient_LDADD += ../lib/toolsLogger/libToolsLogger.a
--vmware_hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.a
--vmware_hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.a
-+vmware_hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.la
-+vmware_hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.la
- # In the absence of the linker options --start-group and --end-group (which can't
- # be put in LDADD), we need to bring the following libraries out of the alphebetical
- # order so their symbols are properly resolved.
diff --git a/sysutils/open-vm-tools/patches/patch-libDeployPkg_linuxDeployment.c b/sysutils/open-vm-tools/patches/patch-libDeployPkg_linuxDeployment.c
new file mode 100644
index 00000000000..21078b707af
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-libDeployPkg_linuxDeployment.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-libDeployPkg_linuxDeployment.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- libDeployPkg/linuxDeployment.c.orig 2016-02-16 20:06:47.000000000 +0000
++++ libDeployPkg/linuxDeployment.c
+@@ -1058,7 +1058,7 @@ ExtractZipPackage(const char* pkgName,
+ {
+ ProcessHandle h;
+ char* args[32];
+- const char* stderr;
++ const char* mystderr;
+
+ int pkgFd, zipFd;
+ char zipName[1024];
+@@ -1106,9 +1106,9 @@ ExtractZipPackage(const char* pkgName,
+ sLog(log_info, "unzip output: %s\n", Process_GetStdout(h));
+
+ // Assume zip failed if it wrote to stderr
+- stderr = Process_GetStderr(h);
+- if (strlen(stderr) > 0) {
+- sLog(log_error, "Package unzip failed: %s\n", stderr);
++ mystderr = Process_GetStderr(h);
++ if (strlen(mystderr) > 0) {
++ sLog(log_error, "Package unzip failed: %s\n", mystderr);
+ ret = FALSE;
+ }
+
diff --git a/sysutils/open-vm-tools/patches/patch-libDeployPkg_processPosix.c b/sysutils/open-vm-tools/patches/patch-libDeployPkg_processPosix.c
new file mode 100644
index 00000000000..4ecd6d36f8c
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-libDeployPkg_processPosix.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-libDeployPkg_processPosix.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- libDeployPkg/processPosix.c.orig 2016-02-16 20:06:47.000000000 +0000
++++ libDeployPkg/processPosix.c
+@@ -22,6 +22,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/wait.h>
++#include <signal.h>
+
+ // vmware headers
+ #include "util.h"
diff --git a/sysutils/open-vm-tools/patches/patch-lib_dynxdr_xdrutil.c b/sysutils/open-vm-tools/patches/patch-lib_dynxdr_xdrutil.c
new file mode 100644
index 00000000000..fff22b99d94
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_dynxdr_xdrutil.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-lib_dynxdr_xdrutil.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/dynxdr/xdrutil.c.orig 2016-02-16 20:06:45.000000000 +0000
++++ lib/dynxdr/xdrutil.c
+@@ -102,7 +102,11 @@ XdrUtil_Deserialize(const void *data, /
+ ASSERT(dest != NULL);
+
+ xdrmem_create(&xdrs, (char *) data, dataLen, XDR_DECODE);
++#if defined(__NetBSD__)
++ ret = (Bool) proc(&xdrs, dest);
++#else
+ ret = (Bool) proc(&xdrs, dest, 0);
++#endif
+ xdr_destroy(&xdrs);
+
+ if (!ret) {
diff --git a/sysutils/open-vm-tools/patches/patch-lib_file_file.c b/sysutils/open-vm-tools/patches/patch-lib_file_file.c
new file mode 100644
index 00000000000..1ba6f21f9c0
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_file_file.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_file_file.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/file/file.c.orig 2016-02-16 20:06:45.000000000 +0000
++++ lib/file/file.c
+@@ -1302,7 +1302,7 @@ File_MoveTree(const char *srcName, //
+ }
+ }
+
+-#if !defined(__FreeBSD__) && !defined(sun)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)
+ /*
+ * File_GetFreeSpace is not defined for FreeBSD
+ */
diff --git a/sysutils/open-vm-tools/patches/patch-lib_guestApp_Makefile.am b/sysutils/open-vm-tools/patches/patch-lib_guestApp_Makefile.am
deleted file mode 100644
index 04efee4e61c..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_guestApp_Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-lib_guestApp_Makefile.am,v 1.1 2015/08/29 15:42:36 taca Exp $
-
-Honor sysconfdir.
-
---- lib/guestApp/Makefile.am.orig 2008-08-08 07:01:49.000000000 +0000
-+++ lib/guestApp/Makefile.am
-@@ -32,3 +32,5 @@ libGuestAppX11_a_SOURCES = $(libGuestApp
- libGuestAppX11_a_SOURCES += guestAppPosixX11.c
- libGuestAppX11_a_CPPFLAGS = -DGUESTAPP_HAS_X11
- endif
-+
-+CFLAGS += -DGUESTAPP_TOOLS_INSTALL_PATH=\"$(sysconfdir)/vmware-tools\"
diff --git a/sysutils/open-vm-tools/patches/patch-lib_hgfsHelper_hgfsHelperPosix.c b/sysutils/open-vm-tools/patches/patch-lib_hgfsHelper_hgfsHelperPosix.c
new file mode 100644
index 00000000000..87b1bc9ffd3
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_hgfsHelper_hgfsHelperPosix.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_hgfsHelper_hgfsHelperPosix.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/hgfsHelper/hgfsHelperPosix.c.orig 2016-02-16 20:06:45.000000000 +0000
++++ lib/hgfsHelper/hgfsHelperPosix.c
+@@ -24,7 +24,7 @@
+ *
+ */
+
+-#if !defined __linux__ && !defined __FreeBSD__ && !defined sun && !defined __APPLE__
++#if !defined __linux__ && !defined __FreeBSD__ && !defined sun && !defined __APPLE__ && !defined __NetBSD__
+ # error This file should not be compiled
+ #endif
+
+@@ -39,6 +39,8 @@
+ #define HGFSHLPR_DEFAULT_MOUNT_PATH "/hgfs"
+ #elif defined __APPLE__
+ #define HGFSHLPR_DEFAULT_MOUNT_PATH "/Volumes/VMware Shared Folders"
++#elif defined __NetBSD__
++#define HGFSHLPR_DEFAULT_MOUNT_PATH "/mnt/hgfs"
+ #endif
+
+
diff --git a/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c b/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c
deleted file mode 100644
index 1359e64e665..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-lib_hgfsServer_hgfsServer.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- lib/hgfsServer/hgfsServer.c.orig 2012-12-25 19:41:00.000000000 +0000
-+++ lib/hgfsServer/hgfsServer.c
-@@ -2441,7 +2441,7 @@ HgfsServerStatFs(const char *pathName, /
- * delimiter on copy. Allow 0 length drives so that hidden feature "" can
- * work.
- */
-- if (pathLength < 0 || pathLength >= sizeof p.mountPoint) {
-+ if (pathLength >= sizeof p.mountPoint) {
- LOG(4, ("HgfsServerStatFs: could not get the volume name\n"));
- return FALSE;
- }
-@@ -3305,10 +3305,6 @@ HgfsCreateAndCacheFileNode(HgfsFileOpenI
- * for the share name, should be none.
- */
- len = CPName_GetComponentGeneric(openInfo->cpName, inEnd, "", &next);
-- if (len < 0) {
-- LOG(4, ("HgfsServerGetAccess: get first component failed\n"));
-- return FALSE;
-- }
-
- /* See if we are dealing with the base of the namespace */
- if (!len) {
diff --git a/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c b/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c
deleted file mode 100644
index 84f9834687e..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-lib_hgfsServer_hgfsServerLinux.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- lib/hgfsServer/hgfsServerLinux.c.orig 2012-12-25 19:41:43.000000000 +0000
-+++ lib/hgfsServer/hgfsServerLinux.c
-@@ -544,7 +544,7 @@ HgfsServerGetOpenFlags(HgfsOpenFlags fla
-
- arraySize = ARRAYSIZE(HgfsServerOpenFlags);
-
-- if (flagsIn < 0 || flagsIn >= arraySize) {
-+ if (flagsIn >= arraySize) {
- Log("HgfsServerGetOpenFlags: Invalid HgfsOpenFlags %d\n", flagsIn);
- return FALSE;
- }
diff --git a/sysutils/open-vm-tools/patches/patch-lib_hgfsUri_hgfsUriPosix.c b/sysutils/open-vm-tools/patches/patch-lib_hgfsUri_hgfsUriPosix.c
new file mode 100644
index 00000000000..a5bc013f5e2
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_hgfsUri_hgfsUriPosix.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_hgfsUri_hgfsUriPosix.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/hgfsUri/hgfsUriPosix.c.orig 2016-02-16 20:06:45.000000000 +0000
++++ lib/hgfsUri/hgfsUriPosix.c
+@@ -23,7 +23,7 @@
+ * x-vmware-share:// style URIs
+ */
+
+-#if !defined __linux__ && !defined __APPLE__ && !defined __FreeBSD__
++#if !defined __linux__ && !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__
+ # error This file should not be compiled
+ #endif
+
diff --git a/sysutils/open-vm-tools/patches/patch-lib_include_sigPosixRegs.h b/sysutils/open-vm-tools/patches/patch-lib_include_sigPosixRegs.h
new file mode 100644
index 00000000000..5eb83c12070
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_include_sigPosixRegs.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-lib_include_sigPosixRegs.h,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/include/sigPosixRegs.h.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/include/sigPosixRegs.h
+@@ -224,6 +224,36 @@
+ #define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[ESP])
+ #define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.gregs[EIP])
+ #endif
++#elif defined (__NetBSD__)
++#ifdef __x86_64__
++#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RAX])
++#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RBX])
++#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RCX])
++#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RDX])
++#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RDI])
++#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RSI])
++#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RBP])
++#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RSP])
++#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_RIP])
++#define SC_R8(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R8])
++#define SC_R9(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R9])
++#define SC_R10(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R10])
++#define SC_R11(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R11])
++#define SC_R12(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R12])
++#define SC_R13(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R13])
++#define SC_R14(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R14])
++#define SC_R15(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_R15])
++#else
++#define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EAX])
++#define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EBX])
++#define SC_ECX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_ECX])
++#define SC_EDX(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EDX])
++#define SC_EDI(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EDI])
++#define SC_ESI(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_ESI])
++#define SC_EBP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EBP])
++#define SC_ESP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_ESP])
++#define SC_EIP(uc) ((unsigned long) (uc)->uc_mcontext.__gregs[_REG_EIP])
++#endif
+ #elif defined(ANDROID_X86)
+ #define SC_EAX(uc) ((unsigned long) (uc)->uc_mcontext.eax)
+ #define SC_EBX(uc) ((unsigned long) (uc)->uc_mcontext.ebx)
diff --git a/sysutils/open-vm-tools/patches/patch-lib_include_vmblock__user.h b/sysutils/open-vm-tools/patches/patch-lib_include_vmblock__user.h
new file mode 100644
index 00000000000..b0cf43005d5
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_include_vmblock__user.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_include_vmblock__user.h,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/include/vmblock_user.h.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/include/vmblock_user.h
+@@ -68,6 +68,10 @@
+ #include "vm_basic_types.h"
+ #include "vmblock.h"
+
++#if defined(__NetBSD__)
++#include <sys/ioctl.h>
++#endif
++
+ static INLINE int
+ VMBLOCK_CONTROL_FUSE(int fd, // IN
+ char op, // IN
+@@ -125,7 +129,7 @@ VMBLOCK_CONTROL(int fd, int op, const ch
+ return write(fd, path, op);
+ }
+
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+
+ static INLINE int
+ VMBLOCK_CONTROL(int fd, int cmd, const char *path)
diff --git a/sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets.h b/sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets.h
new file mode 100644
index 00000000000..63edfa916fd
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_include_vmci__sockets.h,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/include/vmci_sockets.h.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/include/vmci_sockets.h
+@@ -837,7 +837,7 @@ struct uuid_2_cid {
+ return io.u2c_context_id;
+ }
+ # endif // __KERNEL__
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+ /*
+ * No FreeBSD support yet, but it might appear in the future. Just define
+ * some stubs that return errors - that way a client doesn't have to ifdef
diff --git a/sysutils/open-vm-tools/patches/patch-lib_misc_hostinfoPosix.c b/sysutils/open-vm-tools/patches/patch-lib_misc_hostinfoPosix.c
new file mode 100644
index 00000000000..6420ea67e2f
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_misc_hostinfoPosix.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_misc_hostinfoPosix.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/misc/hostinfoPosix.c.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/misc/hostinfoPosix.c
+@@ -3289,7 +3289,7 @@ HostinfoSysinfo(uint64 *totalRam, // OU
+ #endif // ifndef __APPLE__
+
+
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(sun)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__)
+ /*
+ *-----------------------------------------------------------------------------
+ *
diff --git a/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoInt.h b/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoInt.h
new file mode 100644
index 00000000000..cb00d0034f5
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoInt.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_nicInfo_nicInfoInt.h,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/nicInfo/nicInfoInt.h.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/nicInfo/nicInfoInt.h
+@@ -29,7 +29,7 @@
+
+ #include "nicInfo.h"
+
+-#if defined __FreeBSD__ || defined __sun__ || defined __APPLE__
++#if defined __FreeBSD__ || defined __sun__ || defined __APPLE__ || defined __NetBSD__
+ # include <sys/socket.h> // struct sockaddr
+ #endif
+
diff --git a/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoPosix.c b/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoPosix.c
new file mode 100644
index 00000000000..ffc534df517
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_nicInfo_nicInfoPosix.c
@@ -0,0 +1,74 @@
+$NetBSD: patch-lib_nicInfo_nicInfoPosix.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/nicInfo/nicInfoPosix.c.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/nicInfo/nicInfoPosix.c
+@@ -62,6 +62,8 @@
+ # include <net/if.h>
+ #endif
+
++__thread struct __res_state myres;
++
+ /*
+ * resolver(3) and IPv6:
+ *
+@@ -471,7 +473,7 @@ RecordResolverInfo(NicInfoV3 *nicInfo)
+ char namebuf[DNSINFO_MAX_ADDRLEN + 1];
+ char **s;
+
+- if (res_init() == -1) {
++ if (res_ninit(&myres) == -1) {
+ return FALSE;
+ }
+
+@@ -492,7 +494,7 @@ RecordResolverInfo(NicInfoV3 *nicInfo)
+ */
+ dnsConfigInfo->domainName =
+ Util_SafeCalloc(1, sizeof *dnsConfigInfo->domainName);
+- *dnsConfigInfo->domainName = Util_SafeStrdup(_res.defdname);
++ *dnsConfigInfo->domainName = Util_SafeStrdup(myres.defdname);
+
+ /*
+ * Name servers.
+@@ -502,7 +504,7 @@ RecordResolverInfo(NicInfoV3 *nicInfo)
+ /*
+ * Search suffixes.
+ */
+- for (s = _res.dnsrch; *s; s++) {
++ for (s = myres.dnsrch; *s; s++) {
+ DnsHostname *suffix;
+
+ /* Check to see if we're going above our limit. See bug 605821. */
+@@ -550,12 +552,12 @@ RecordResolverNS(DnsConfigInfo *dnsConfi
+ #if defined RESOLVER_IPV6_GETSERVERS
+ {
+ union res_sockaddr_union *ns;
+- ns = Util_SafeCalloc(_res.nscount, sizeof *ns);
+- if (res_getservers(&_res, ns, _res.nscount) != _res.nscount) {
++ ns = Util_SafeCalloc(myres.nscount, sizeof *ns);
++ if (res_getservers(&myres, ns, myres.nscount) != myres.nscount) {
+ g_warning("%s: res_getservers failed.\n", __func__);
+ return;
+ }
+- for (i = 0; i < _res.nscount; i++) {
++ for (i = 0; i < myres.nscount; i++) {
+ struct sockaddr *sa = (struct sockaddr *)&ns[i];
+ if (sa->sa_family == AF_INET || sa->sa_family == AF_INET6) {
+ TypedIpAddress *ip;
+@@ -579,7 +581,7 @@ RecordResolverNS(DnsConfigInfo *dnsConfi
+ * Name servers (IPv4).
+ */
+ for (i = 0; i < MAXNS; i++) {
+- struct sockaddr_in *sin = &_res.nsaddr_list[i];
++ struct sockaddr_in *sin = &myres.nsaddr_list[i];
+ if (sin->sin_family == AF_INET) {
+ TypedIpAddress *ip;
+
+@@ -600,7 +602,7 @@ RecordResolverNS(DnsConfigInfo *dnsConfi
+ * Name servers (IPv6).
+ */
+ for (i = 0; i < MAXNS; i++) {
+- struct sockaddr_in6 *sin6 = _res._u._ext.nsaddrs[i];
++ struct sockaddr_in6 *sin6 = myres._u._ext.nsaddrs[i];
+ if (sin6) {
+ TypedIpAddress *ip;
+
diff --git a/sysutils/open-vm-tools/patches/patch-lib_panic_panic.c b/sysutils/open-vm-tools/patches/patch-lib_panic_panic.c
deleted file mode 100644
index d36d4d7e5b3..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_panic_panic.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-lib_panic_panic.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- lib/panic/panic.c.orig 2012-12-25 19:42:53.000000000 +0000
-+++ lib/panic/panic.c
-@@ -497,7 +497,7 @@ Panic_Panic(const char *format,
- case 0:
- break;
- case 1:
-- Log(buf);
-+ Log("%s", buf);
- Log("Panic loop\n");
- default:
- fprintf(stderr, "Panic loop\n");
-@@ -510,7 +510,7 @@ Panic_Panic(const char *format,
- * the log file on exit.
- */
-
-- Log(buf);
-+ Log("%s", buf);
- Util_Backtrace(0);
- Log_SetAlwaysKeep(TRUE);
-
diff --git a/sysutils/open-vm-tools/patches/patch-lib_user_util.c b/sysutils/open-vm-tools/patches/patch-lib_user_util.c
deleted file mode 100644
index 8db80010143..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_user_util.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-lib_user_util.c,v 1.1 2016/05/07 10:10:09 joerg Exp $
-
---- lib/user/util.c.orig 2016-05-06 15:59:45.000000000 +0000
-+++ lib/user/util.c
-@@ -319,7 +319,7 @@ UtilBacktraceToBufferCallback(struct _Un
- */
- if (cfa >= data->basePtr) {
- if (data->len) {
-- *data->buffer++ = _Unwind_GetIP(ctx);
-+ *data->buffer++ = (uintptr_t)_Unwind_GetIP(ctx);
- data->len--;
- } else {
- return _URC_END_OF_STACK;
diff --git a/sysutils/open-vm-tools/patches/patch-lib_user_utilBacktrace.c b/sysutils/open-vm-tools/patches/patch-lib_user_utilBacktrace.c
new file mode 100644
index 00000000000..44a5e480989
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-lib_user_utilBacktrace.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_user_utilBacktrace.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- lib/user/utilBacktrace.c.orig 2016-02-16 20:06:46.000000000 +0000
++++ lib/user/utilBacktrace.c
+@@ -53,7 +53,7 @@
+ #include "str.h"
+
+ #ifdef VM_X86_64
+-# if defined(__GNUC__) && (!defined(USING_AUTOCONF) || defined(HAVE_UNWIND_H))
++# if defined(__GNUC__) && (!defined(USING_AUTOCONF) || (defined(HAVE_UNWIND_H)) && !defined(__NetBSD__))
+ # define UTIL_BACKTRACE_USE_UNWIND
+ # endif
+ #endif
diff --git a/sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am b/sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am
deleted file mode 100644
index b78c6873a66..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-lib_vmCheck_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- lib/vmCheck/Makefile.am.orig 2008-08-08 07:01:50.000000000 +0000
-+++ lib/vmCheck/Makefile.am
-@@ -15,7 +15,6 @@
- ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- ################################################################################
-
--noinst_LIBRARIES = libVmCheck.a
-+noinst_LTLIBRARIES = libVmCheck.la
-
--libVmCheck_a_SOURCES =
--libVmCheck_a_SOURCES += vmcheck.c
-+libVmCheck_la_SOURCES = vmcheck.c
diff --git a/sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am b/sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am
deleted file mode 100644
index 04cf525adb3..00000000000
--- a/sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-lib_vmSignal_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- lib/vmSignal/Makefile.am.orig 2013-03-31 21:45:43.000000000 +0000
-+++ lib/vmSignal/Makefile.am
-@@ -15,7 +15,7 @@
- ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- ################################################################################
-
--noinst_LIBRARIES = libVmSignal.a
-+noinst_LTLIBRARIES = libVmSignal.la
-
--libVmSignal_a_SOURCES =
--libVmSignal_a_SOURCES += vmsignal.c
-+libVmSignal_la_SOURCES =
-+libVmSignal_la_SOURCES += vmsignal.c
diff --git a/sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am b/sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am
deleted file mode 100644
index d8d3bfe61eb..00000000000
--- a/sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-libguestlib_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- libguestlib/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000
-+++ libguestlib/Makefile.am
-@@ -26,12 +26,14 @@ libguestlib_la_LIBADD += ../lib/stubs/sh
- # order so their symbols are properly resolved.
- libguestlib_la_LIBADD += ../lib/message/shared/libMessage.la
- libguestlib_la_LIBADD += ../lib/backdoor/shared/libBackdoor.la
-+libguestlib_la_LIBADD += ../lib/vmCheck/libVmCheck.la
-+libguestlib_la_LIBADD += ../lib/vmSignal/libVmSignal.la
-
- libguestlib_la_SOURCES =
- libguestlib_la_SOURCES += vmGuestLib.c
- libguestlib_la_SOURCES += vmGuestLibPanic.c
-
--libguestlib_la_LDFLAGS =
-+libguestlib_la_LDFLAGS = -no-undefined
- # We require GCC, so we're fine passing compiler-specific flags.
- # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD
- libguestlib_la_LDFLAGS += -Wl,-lc
diff --git a/sysutils/open-vm-tools/patches/patch-scripts_Makefile.am b/sysutils/open-vm-tools/patches/patch-scripts_Makefile.am
index 285189f54ba..234b1ae6ffb 100644
--- a/sysutils/open-vm-tools/patches/patch-scripts_Makefile.am
+++ b/sysutils/open-vm-tools/patches/patch-scripts_Makefile.am
@@ -1,15 +1,18 @@
-$NetBSD: patch-scripts_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
+$NetBSD: patch-scripts_Makefile.am,v 1.2 2016/10/09 03:41:56 ryoon Exp $
---- scripts/Makefile.am.orig 2008-08-08 07:01:58.000000000 +0000
+--- scripts/Makefile.am.orig 2016-02-16 20:06:47.000000000 +0000
+++ scripts/Makefile.am
-@@ -1,7 +1,7 @@
+@@ -3,10 +3,10 @@ defaultscripts += poweroff-vm-default
+ defaultscripts += suspend-vm-default
+ defaultscripts += resume-vm-default
+
-confdir = /etc/vmware-tools
+EGDIR = @datarootdir@/examples
+confdir = ${EGDIR}/vmware-tools
-conf_SCRIPTS = ./common/vm-support
--conf_SCRIPTS += $(MODULES_OS)/poweron-vm-default
-+conf_SCRIPTS = $(MODULES_OS)/poweron-vm-default
- conf_SCRIPTS += $(MODULES_OS)/poweroff-vm-default
- conf_SCRIPTS += $(MODULES_OS)/suspend-vm-default
- conf_SCRIPTS += $(MODULES_OS)/resume-vm-default
+-conf_SCRIPTS += ./common/statechange.subr
++conf_SCRIPTS = ./common/statechange.subr
+ if ENABLE_GRABBITMQPROXY
+ conf_SCRIPTS += ./common/guestproxy-ssl.conf
+ endif
diff --git a/sysutils/open-vm-tools/patches/patch-scripts_netbsd_network b/sysutils/open-vm-tools/patches/patch-scripts_netbsd_network
new file mode 100644
index 00000000000..a1f277db2f3
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-scripts_netbsd_network
@@ -0,0 +1,108 @@
+$NetBSD: patch-scripts_netbsd_network,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- scripts/netbsd/network.orig 2016-10-04 11:37:34.038469430 +0000
++++ scripts/netbsd/network
+@@ -0,0 +1,103 @@
++#!/bin/sh
++##########################################################
++# Copyright (C) 2010-2015 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
++# by the Free Software Foundation version 2.1 and no later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
++# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
++# License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public License
++# along with this program; if not, write to the Free Software Foundation, Inc.,
++# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++##########################################################
++
++##########################################################################
++# DO NOT modify this file directly as it will be overwritten the next
++# time the VMware Tools are installed.
++##########################################################################
++
++#
++# network (FreeBSD 6.3 and above)
++#
++# This script uses FreeBSD's rc(8) scripts to stop and restart networking
++# services in response to suspend and resume events, respectively.
++#
++
++
++echo `date` ": Executing '$0'"
++echo
++
++. `dirname "$0"`/../../statechange.subr
++
++
++#
++# ToggleNetwork --
++#
++# Sources native configuration files in a subshell and executes native
++# scripts to either start or stop networking services associated with
++# a single interface.
++#
++# Results:
++# See description above.
++#
++# Side effects:
++# All side effects implied by FreeBSD's netif script.
++#
++
++ToggleNetwork() {
++ (
++ . /etc/rc.subr
++ . /etc/network.subr
++
++ load_rc_config network
++
++ for intf in `list_net_interfaces dhcp`; do
++ /etc/rc.d/netif $1 $intf
++ ec=$?
++
++ # Failure to stop an interface should not interfere with suspend.
++ if [ "$1" != "stop" ]; then
++ exitCode=`expr $exitCode \| $ec`
++ fi
++ done
++ )
++}
++
++
++#
++# main --
++#
++# Main entry point. Perform some sanity checking, then map state change
++# events to relevant networking operations.
++#
++# Results:
++# See comment at top of file.
++#
++
++main() {
++ exitCode=0
++
++ [ -r /etc/rc.subr ] || Panic "Cannot read /etc/rc.subr."
++ [ -r /etc/network.subr ] || Panic "Cannot read /etc/network.subr"
++ [ -x /etc/rc.d/netif ] || Panic "Cannot read /etc/rc.d/netif"
++
++ case "$1" in
++ suspend-vm)
++ ToggleNetwork stop
++ ;;
++ resume-vm)
++ ToggleNetwork start
++ ;;
++ *) ;;
++ esac
++
++ return $exitCode
++}
++
++main "$@"
diff --git a/sysutils/open-vm-tools/patches/patch-af b/sysutils/open-vm-tools/patches/patch-services_plugins_dndcp_dnd_dndLinux.c
index 65df0bad2a1..00148494171 100644
--- a/sysutils/open-vm-tools/patches/patch-af
+++ b/sysutils/open-vm-tools/patches/patch-services_plugins_dndcp_dnd_dndLinux.c
@@ -1,22 +1,22 @@
-$NetBSD: patch-af,v 1.2 2008/08/31 06:36:47 scottr Exp $
+$NetBSD: patch-services_plugins_dndcp_dnd_dndLinux.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
---- lib/dnd/dndLinux.c.orig 2008-08-08 02:01:53.000000000 -0500
-+++ lib/dnd/dndLinux.c
+--- services/plugins/dndcp/dnd/dndLinux.c.orig 2016-02-16 20:06:48.000000000 +0000
++++ services/plugins/dndcp/dnd/dndLinux.c
@@ -39,7 +39,7 @@
#include "util.h"
#include "escape.h"
#include "su.h"
-#if defined(linux) || defined(sun) || defined(__FreeBSD__)
+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
- #include "vmblock.h"
+ #include "vmblock_user.h"
#include "mntinfo.h"
#endif
-@@ -288,7 +288,7 @@ DnD_UriListGetNextFile(char const *uriLi
+@@ -276,7 +276,7 @@ DnD_UriIsNonFileSchemes(const char *uri)
/* We need to make this suck less. */
-#if defined(linux) || defined(sun) || defined(__FreeBSD__)
+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)
+
/*
*----------------------------------------------------------------------------
- *
diff --git a/sysutils/open-vm-tools/patches/patch-services_plugins_timeSync_Makefile.am b/sysutils/open-vm-tools/patches/patch-services_plugins_timeSync_Makefile.am
new file mode 100644
index 00000000000..be8e91300ea
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-services_plugins_timeSync_Makefile.am
@@ -0,0 +1,15 @@
+$NetBSD: patch-services_plugins_timeSync_Makefile.am,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- services/plugins/timeSync/Makefile.am.orig 2016-02-16 20:06:48.000000000 +0000
++++ services/plugins/timeSync/Makefile.am
+@@ -39,6 +39,10 @@ if FREEBSD
+ libtimeSync_la_SOURCES += slewAdjtime.c
+ libtimeSync_la_SOURCES += pllNone.c
+ endif
++if NETBSD
++libtimeSync_la_SOURCES += slewAdjtime.c
++libtimeSync_la_SOURCES += pllNone.c
++endif
+ if LINUX
+ libtimeSync_la_SOURCES += slewLinux.c
+ libtimeSync_la_SOURCES += pllLinux.c
diff --git a/sysutils/open-vm-tools/patches/patch-services_vmtoolsd_Makefile.am b/sysutils/open-vm-tools/patches/patch-services_vmtoolsd_Makefile.am
new file mode 100644
index 00000000000..8ea3c76e521
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-services_vmtoolsd_Makefile.am
@@ -0,0 +1,25 @@
+$NetBSD: patch-services_vmtoolsd_Makefile.am,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- services/vmtoolsd/Makefile.am.orig 2016-02-16 20:06:48.000000000 +0000
++++ services/vmtoolsd/Makefile.am
+@@ -15,8 +15,10 @@
+ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ ################################################################################
+
++EGDIR = @datarootdir@/examples
++
+ bin_PROGRAMS = vmtoolsd
+-pamdir = $(PAM_PREFIX)/pam.d
++pamdir = $(EGDIR)/vmware-tools/pam.d
+
+
+ vmtoolsd_CPPFLAGS =
+@@ -83,7 +85,7 @@ install-data-hook:
+ @INSTVMSG@ vmtoolsd $(srcdir)/l10n $(DESTDIR)$(datadir)
+
+ install-exec-hook:
+- $(INSTALL) -d $(DESTDIR)/etc/vmware-tools
++ $(INSTALL) -d $(DESTDIR)/${EGDIR}/vmware-tools
+
+ uninstall-hook:
+ rm -rf $(DESTDIR)/etc/vmware-tools
diff --git a/sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am b/sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am
deleted file mode 100644
index 12054e8a712..00000000000
--- a/sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-toolbox_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- toolbox/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000
-+++ toolbox/Makefile.am
-@@ -26,8 +26,8 @@ COMMON += ../lib/rpcOut/libRpcOut.a
- COMMON += ../lib/string/libString.a
- COMMON += ../lib/system/libSystem.a
- COMMON += ../lib/user/libUser.a
--COMMON += ../lib/vmCheck/libVmCheck.a
--COMMON += ../lib/vmSignal/libVmSignal.a
-+COMMON += ../lib/vmCheck/libVmCheck.la
-+COMMON += ../lib/vmSignal/libVmSignal.la
- COMMON += ../lib/wiper/libWiper.a
- # In the absence of the linker options --start-group and --end-group (which
- # can't be put in LDADD), we need to bring the following libraries out of
diff --git a/sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c b/sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c
deleted file mode 100644
index 11605566023..00000000000
--- a/sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-toolbox_toolboxcmd-stat.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- toolbox/toolboxcmd-stat.c.orig 2012-12-25 19:51:17.000000000 +0000
-+++ toolbox/toolboxcmd-stat.c
-@@ -96,10 +96,6 @@ Stat_ProcessorSpeed(void)
- bp.in.cx.halfs.low = BDOOR_CMD_GETMHZ;
- Backdoor(&bp);
- speed = bp.out.ax.word;
-- if (speed < 0) {
-- fprintf(stderr, "Unable to get processor speed\n");
-- return EX_TEMPFAIL;
-- }
- printf("%u MHz\n", speed);
- return EXIT_SUCCESS;
- }
-@@ -130,10 +126,6 @@ Stat_MemorySize(void)
- bp.in.cx.halfs.low = BDOOR_CMD_GETMEMSIZE;
- Backdoor(&bp);
- memsize = bp.out.ax.word;
-- if (memsize < 0) {
-- fprintf(stderr, "Unable to get memory size\n");
-- return EX_TEMPFAIL;
-- }
- printf("%u MB\n", memsize);
- return EXIT_SUCCESS;
- }
-@@ -166,10 +158,6 @@ Stat_HostTime(void)
- bp.in.cx.halfs.low = BDOOR_CMD_GETTIME;
- Backdoor(&bp);
- time = bp.out.ax.word;
-- if (time < 0) {
-- fprintf(stderr, "Unable to get host time\n");
-- return EX_TEMPFAIL;
-- }
- sprintf(buf, "%u", time);
- strptime(buf, "%s", &tm);
- strftime(buf, sizeof(buf), "%d %b %Y %H:%M:%S", &tm);
diff --git a/sysutils/open-vm-tools/patches/patch-vgauth_common_VGAuthLog.c b/sysutils/open-vm-tools/patches/patch-vgauth_common_VGAuthLog.c
new file mode 100644
index 00000000000..8fe9b3f11bd
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-vgauth_common_VGAuthLog.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-vgauth_common_VGAuthLog.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- vgauth/common/VGAuthLog.c.orig 2016-02-16 20:06:48.000000000 +0000
++++ vgauth/common/VGAuthLog.c
+@@ -210,7 +210,7 @@ LogErrorPosixCodeV(int code,
+ g_vsnprintf(buf, sizeof buf, fmt, args);
+ buf[sizeof buf - 1] = '\0';
+
+-#ifdef sun
++#if defined(sun) && defined(__NetBSD__)
+ strerror_r(code, errMsg, sizeof errMsg);
+ g_warning("[function %s, file %s, line %d], %s, [errno = %d], %s\n",
+ func, file, line, buf, code, errMsg);
diff --git a/sysutils/open-vm-tools/patches/patch-vgauth_lib_common.c b/sysutils/open-vm-tools/patches/patch-vgauth_lib_common.c
new file mode 100644
index 00000000000..548f01f741d
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-vgauth_lib_common.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-vgauth_lib_common.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- vgauth/lib/common.c.orig 2016-02-16 20:06:48.000000000 +0000
++++ vgauth/lib/common.c
+@@ -374,7 +374,7 @@ done:
+
+ return err;
+ }
+-#elif defined(sun)
++#elif defined(sun) || defined(__NetBSD__)
+ return VGAUTH_E_OK;
+ #else
+ #error VGAuth_InstallClient unsupported on this platform.
+@@ -454,7 +454,7 @@ done:
+ g_free(lowAppName);
+ return err;
+ }
+-#elif defined(sun)
++#elif defined(sun) || defined(__NetBSD__)
+ return VGAUTH_E_OK;
+ #else
+ #error VGAuth_UninstallClient unsupported on this platform.
diff --git a/sysutils/open-vm-tools/patches/patch-vgauth_lib_impersonateLinux.c b/sysutils/open-vm-tools/patches/patch-vgauth_lib_impersonateLinux.c
new file mode 100644
index 00000000000..2c3013277a7
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-vgauth_lib_impersonateLinux.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-vgauth_lib_impersonateLinux.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- vgauth/lib/impersonateLinux.c.orig 2016-02-16 20:06:48.000000000 +0000
++++ vgauth/lib/impersonateLinux.c
+@@ -29,7 +29,7 @@
+ #define _GNU_SOURCE
+ #include <unistd.h>
+
+-#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__)
+ #include <asm/param.h>
+ #include <locale.h>
+ #include <sys/stat.h>
diff --git a/sysutils/open-vm-tools/patches/patch-vmblockmounter_vmblockmounter.c b/sysutils/open-vm-tools/patches/patch-vmblockmounter_vmblockmounter.c
new file mode 100644
index 00000000000..825f5ccac99
--- /dev/null
+++ b/sysutils/open-vm-tools/patches/patch-vmblockmounter_vmblockmounter.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-vmblockmounter_vmblockmounter.c,v 1.1 2016/10/09 03:41:56 ryoon Exp $
+
+--- vmblockmounter/vmblockmounter.c.orig 2016-02-16 20:06:48.000000000 +0000
++++ vmblockmounter/vmblockmounter.c
+@@ -223,6 +223,8 @@ main(int argc, // IN
+ /* Go! */
+ #if defined(sun)
+ mntRes = mount(sourceDir, mountPoint, MS_DATA, VMBLOCK_FS_NAME);
++#elif defined(__NetBSD__)
++ mntRes = mount(sourceDir, mountPoint, MNT_BASIC_FLAGS, VMBLOCK_FS_NAME, sizeof(sourceDir));
+ #elif defined(__FreeBSD__)
+ {
+ struct iovec iov[] = {
diff --git a/sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am b/sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am
deleted file mode 100644
index 0d7b6f0e375..00000000000
--- a/sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-vmware-user_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $
-
---- vmware-user/Makefile.am.orig 2013-03-31 21:25:01.000000000 +0000
-+++ vmware-user/Makefile.am
-@@ -60,8 +60,8 @@ else
- endif
- vmware_user_LDADD += ../lib/user/libUser.a
- vmware_user_LDADD += ../lib/vixTools/libVixTools.a
--vmware_user_LDADD += ../lib/vmCheck/libVmCheck.a
--vmware_user_LDADD += ../lib/vmSignal/libVmSignal.a
-+vmware_user_LDADD += ../lib/vmCheck/libVmCheck.la
-+vmware_user_LDADD += ../lib/vmSignal/libVmSignal.la
- vmware_user_LDADD += ../lib/wiper/libWiper.a
- # In the absence of the linker options --start-group and --end-group (which
- # can't be put in LDADD), we need to bring the following libraries out of
diff --git a/sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c b/sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c
deleted file mode 100644
index 4215753ff62..00000000000
--- a/sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-vmware-user_copyPaste.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- vmware-user/copyPaste.c.orig 2012-12-25 19:45:44.000000000 +0000
-+++ vmware-user/copyPaste.c
-@@ -655,14 +655,6 @@ CopyPasteSelectionGetCB(GtkWidget
- const size_t origTextLen = textLen;
- Bool freeBegin = FALSE;
-
-- if (len < 0) {
-- Debug("CopyPasteSelectionGetCB: error getting next component\n");
-- if (text) {
-- free(text);
-- }
-- return;
-- }
--
- /*
- * A URI list will expect the provided path to be escaped. If we cannot
- * escape the path for some reason we just use the unescaped version and
-@@ -1761,11 +1753,6 @@ CopyPasteRpcInGHGetNextFileCB(char const
- cpNameSize = CPNameUtil_ConvertToRoot(fileName,
- sizeof resultBuffer - (fileNameSize + 1),
- resultBuffer + fileNameSize + 1);
-- if (cpNameSize < 0) {
-- Warning("CopyPasteRpcInGHGetNextFileCB: could not convert to CPName\n");
-- return RpcIn_SetRetVals(result, resultLen,
-- "error on CPName conversion", FALSE);
-- }
-
- /* Set manually because RpcIn_SetRetVals() assumes no NUL characters */
- *result = resultBuffer;
diff --git a/sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c b/sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c
deleted file mode 100644
index de18c351b01..00000000000
--- a/sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-vmware-user_dnd.c,v 1.1 2012/12/25 21:02:15 joerg Exp $
-
---- vmware-user/dnd.c.orig 2012-12-25 19:46:26.000000000 +0000
-+++ vmware-user/dnd.c
-@@ -943,12 +943,6 @@ DnDRpcInGetNextFileCB(char const **resul
- cpNameSize = CPNameUtil_ConvertToRoot(fileName,
- sizeof resultBuffer - (fileNameSize + 1),
- resultBuffer + fileNameSize + 1);
-- if (cpNameSize < 0) {
-- Warning("DnDRpcInGetNextFileCB: could not convert to CPName\n");
-- DnDGHCancel(mainWnd);
-- return RpcIn_SetRetVals(result, resultLen,
-- "error on CPName conversion", FALSE);
-- }
-
- /* Set manually because RpcIn_SetRetVals() assumes no NUL characters */
- *result = resultBuffer;
-@@ -1223,14 +1217,6 @@ DnDGtkDataRequestCB(GtkWidget *widget,
- const size_t origTextLen = textLen;
- Bool freeBegin = FALSE;
-
-- if (len < 0) {
-- Log("DnDGtkDataRequestCB: error getting next component\n");
-- if (text) {
-- free(text);
-- }
-- return;
-- }
--
- /*
- * A URI list will expect the provided path to be escaped. If we cannot
- * escape the path for some reason we just use the unescaped version and