diff options
| author | Martin Jansa <Martin.Jansa@gmail.com> | 2021-03-25 18:25:30 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2021-03-28 12:12:57 -0700 |
| commit | fdbb0e334f71e4d967f62e7aecd86fff86932a42 (patch) | |
| tree | 8cdcf42c89d9d4d062f6737c3e996184587542a1 /meta-networking/recipes-support/open-vm-tools | |
| parent | f86d6ead5951067e6bd0e5d9f752f3fc7ac0463d (diff) | |
| download | meta-openembedded-fdbb0e334f71e4d967f62e7aecd86fff86932a42.tar.gz | |
open-vm-tools: move to meta-networking
* and make it skipped only when meta-filesystem is missing as well
* depends on libdnet from meta-networking and nothing in meta-oe depends on open-vm-tools
* update packagegroup-meta-oe to match this, without either of these layers packagegroup-meta-oe is currently failing with:
ERROR: Nothing RPROVIDES 'open-vm-tools' (but meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb RDEPENDS on or otherwise requires it)
open-vm-tools was skipped: Requires meta-networking and meta-filesystems to be present.
NOTE: Runtime target 'open-vm-tools' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['open-vm-tools']
ERROR: Required build target 'packagegroup-meta-oe' has no buildable providers.
Missing or unbuildable dependency chain was: ['packagegroup-meta-oe', 'open-vm-tools']
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/open-vm-tools')
23 files changed, 1753 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch new file mode 100644 index 0000000000..6cb5dfcccb --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | From 6fb28085e867d7c3ef46577d9ff193a185693bcb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Oliver Kurth <okurth@vmware.com> | ||
| 3 | Date: Mon, 30 Sep 2019 16:24:27 -0700 | ||
| 4 | Subject: [PATCH] GitHub Issue #367. Remove references to deprecated G_INLINE_FUNC. | ||
| 5 | |||
| 6 | G_INLINE_FUNC was a work-around for compilers that didn't support | ||
| 7 | static inline. Change uses of it to static inline. | ||
| 8 | |||
| 9 | Upstream-Status: Backport | ||
| 10 | [https://github.com/vmware/open-vm-tools/commit/89c0d444567eb525e8d083fb564c46d68e96660c] | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/lib/include/vmware/tools/plugin.h | 2 +- | ||
| 15 | open-vm-tools/lib/include/vmware/tools/threadPool.h | 8 ++++---- | ||
| 16 | open-vm-tools/lib/include/vmware/tools/utils.h | 9 --------- | ||
| 17 | 3 files changed, 5 insertions(+), 14 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/open-vm-tools/lib/include/vmware/tools/plugin.h b/open-vm-tools/lib/include/vmware/tools/plugin.h | ||
| 20 | index f9acc6a2..deefd1f3 100644 | ||
| 21 | --- a/open-vm-tools/lib/include/vmware/tools/plugin.h | ||
| 22 | +++ b/open-vm-tools/lib/include/vmware/tools/plugin.h | ||
| 23 | @@ -290,7 +290,7 @@ typedef struct ToolsAppCtx { | ||
| 24 | * | ||
| 25 | * @return TRUE if COM is initialized when the function returns. | ||
| 26 | */ | ||
| 27 | -G_INLINE_FUNC gboolean | ||
| 28 | +static inline gboolean | ||
| 29 | ToolsCore_InitializeCOM(ToolsAppCtx *ctx) | ||
| 30 | { | ||
| 31 | if (!ctx->comInitialized) { | ||
| 32 | diff --git a/open-vm-tools/lib/include/vmware/tools/threadPool.h b/open-vm-tools/lib/include/vmware/tools/threadPool.h | ||
| 33 | index 3f2082b3..5880fbcf 100644 | ||
| 34 | --- a/open-vm-tools/lib/include/vmware/tools/threadPool.h | ||
| 35 | +++ b/open-vm-tools/lib/include/vmware/tools/threadPool.h | ||
| 36 | @@ -91,7 +91,7 @@ typedef struct ToolsCorePool { | ||
| 37 | ******************************************************************************* | ||
| 38 | */ | ||
| 39 | |||
| 40 | -G_INLINE_FUNC ToolsCorePool * | ||
| 41 | +static inline ToolsCorePool * | ||
| 42 | ToolsCorePool_GetPool(ToolsAppCtx *ctx) | ||
| 43 | { | ||
| 44 | ToolsCorePool *pool = NULL; | ||
| 45 | @@ -123,7 +123,7 @@ ToolsCorePool_GetPool(ToolsAppCtx *ctx) | ||
| 46 | ******************************************************************************* | ||
| 47 | */ | ||
| 48 | |||
| 49 | -G_INLINE_FUNC guint | ||
| 50 | +static inline guint | ||
| 51 | ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, | ||
| 52 | ToolsCorePoolCb cb, | ||
| 53 | gpointer data, | ||
| 54 | @@ -153,7 +153,7 @@ ToolsCorePool_SubmitTask(ToolsAppCtx *ctx, | ||
| 55 | ******************************************************************************* | ||
| 56 | */ | ||
| 57 | |||
| 58 | -G_INLINE_FUNC void | ||
| 59 | +static inline void | ||
| 60 | ToolsCorePool_CancelTask(ToolsAppCtx *ctx, | ||
| 61 | guint taskId) | ||
| 62 | { | ||
| 63 | @@ -197,7 +197,7 @@ ToolsCorePool_CancelTask(ToolsAppCtx *ctx, | ||
| 64 | ******************************************************************************* | ||
| 65 | */ | ||
| 66 | |||
| 67 | -G_INLINE_FUNC gboolean | ||
| 68 | +static inline gboolean | ||
| 69 | ToolsCorePool_StartThread(ToolsAppCtx *ctx, | ||
| 70 | const gchar *threadName, | ||
| 71 | ToolsCorePoolCb cb, | ||
| 72 | diff --git a/open-vm-tools/lib/include/vmware/tools/utils.h b/open-vm-tools/lib/include/vmware/tools/utils.h | ||
| 73 | index f6574590..a3292d5c 100644 | ||
| 74 | --- a/open-vm-tools/lib/include/vmware/tools/utils.h | ||
| 75 | +++ b/open-vm-tools/lib/include/vmware/tools/utils.h | ||
| 76 | @@ -51,15 +51,6 @@ | ||
| 77 | # include <sys/time.h> | ||
| 78 | #endif | ||
| 79 | |||
| 80 | - | ||
| 81 | -/* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */ | ||
| 82 | -#if defined(G_PLATFORM_WIN32) | ||
| 83 | -# if defined(G_INLINE_FUNC) | ||
| 84 | -# undef G_INLINE_FUNC | ||
| 85 | -# endif | ||
| 86 | -# define G_INLINE_FUNC static __inline | ||
| 87 | -#endif | ||
| 88 | - | ||
| 89 | #ifndef ABS | ||
| 90 | # define ABS(x) (((x) >= 0) ? (x) : -(x)) | ||
| 91 | #endif | ||
| 92 | -- | ||
| 93 | 2.23.0 | ||
| 94 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch new file mode 100644 index 0000000000..61a681f17f --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | From caf80e220b055dbce259078be96e899dc78ec1d2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bartosz Brachaczek <b.brachaczek@gmail.com> | ||
| 3 | Date: Tue, 12 Nov 2019 14:31:08 +0100 | ||
| 4 | Subject: [PATCH] Make HgfsConvertFromNtTimeNsec aware of 64-bit time_t on i386 | ||
| 5 | |||
| 6 | I verified that this function behaves as expected on x86_64, i386 with | ||
| 7 | 32-bit time_t, and i386 with 64-bit time_t for the following values of | ||
| 8 | ntTtime: | ||
| 9 | |||
| 10 | UNIX_EPOCH-1, UNIX_EPOCH, UNIX_EPOCH+1, UNIX_S32_MAX-1, UNIX_S32_MAX, | ||
| 11 | UNIX_S32_MAX+1, UNIX_S32_MAX*2+1 | ||
| 12 | |||
| 13 | I did not verify whether the use of Div643264 is optimal, performance | ||
| 14 | wise. | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/387] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | open-vm-tools/lib/hgfs/hgfsUtil.c | 34 +++++++++++++++++-------------- | ||
| 20 | 1 file changed, 19 insertions(+), 15 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/open-vm-tools/lib/hgfs/hgfsUtil.c b/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
| 23 | index cc580ab8..49b10040 100644 | ||
| 24 | --- a/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
| 25 | +++ b/open-vm-tools/lib/hgfs/hgfsUtil.c | ||
| 26 | @@ -110,23 +110,21 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | ||
| 27 | uint64 ntTime) // IN: Time in Windows NT format | ||
| 28 | { | ||
| 29 | #ifdef __i386__ | ||
| 30 | - uint32 sec; | ||
| 31 | - uint32 nsec; | ||
| 32 | + uint64 sec64; | ||
| 33 | + uint32 sec32, nsec; | ||
| 34 | +#endif | ||
| 35 | |||
| 36 | ASSERT(unixTime); | ||
| 37 | - /* We assume that time_t is 32bit */ | ||
| 38 | - ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4); | ||
| 39 | |||
| 40 | - /* Cap NT time values that are outside of Unix time's range */ | ||
| 41 | + if (sizeof (unixTime->tv_sec) == 4) { | ||
| 42 | + /* Cap NT time values that are outside of Unix time's range */ | ||
| 43 | |||
| 44 | - if (ntTime >= UNIX_S32_MAX) { | ||
| 45 | - unixTime->tv_sec = 0x7FFFFFFF; | ||
| 46 | - unixTime->tv_nsec = 0; | ||
| 47 | - return 1; | ||
| 48 | + if (ntTime >= UNIX_S32_MAX) { | ||
| 49 | + unixTime->tv_sec = 0x7FFFFFFF; | ||
| 50 | + unixTime->tv_nsec = 0; | ||
| 51 | + return 1; | ||
| 52 | + } | ||
| 53 | } | ||
| 54 | -#else | ||
| 55 | - ASSERT(unixTime); | ||
| 56 | -#endif | ||
| 57 | |||
| 58 | if (ntTime < UNIX_EPOCH) { | ||
| 59 | unixTime->tv_sec = 0; | ||
| 60 | @@ -135,9 +133,15 @@ HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format | ||
| 61 | } | ||
| 62 | |||
| 63 | #ifdef __i386__ | ||
| 64 | - Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); | ||
| 65 | - unixTime->tv_sec = sec; | ||
| 66 | - unixTime->tv_nsec = nsec * 100; | ||
| 67 | + if (sizeof (unixTime->tv_sec) == 4) { | ||
| 68 | + Div643232(ntTime - UNIX_EPOCH, 10000000, &sec32, &nsec); | ||
| 69 | + unixTime->tv_sec = sec32; | ||
| 70 | + unixTime->tv_nsec = nsec * 100; | ||
| 71 | + } else { | ||
| 72 | + Div643264(ntTime - UNIX_EPOCH, 10000000, &sec64, &nsec); | ||
| 73 | + unixTime->tv_sec = sec64; | ||
| 74 | + unixTime->tv_nsec = nsec * 100; | ||
| 75 | + } | ||
| 76 | #else | ||
| 77 | unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; | ||
| 78 | unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch new file mode 100644 index 0000000000..a711f5e5d2 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-configure.ac-don-t-use-dnet-config.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From fc9bf1ce9f1a21150b10736a1c968d4ca6d4eaa3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Kelly <mkelly@xevo.com> | ||
| 3 | Date: Fri, 7 Apr 2017 15:20:30 -0700 | ||
| 4 | Subject: [PATCH] configure.ac: don't use dnet-config | ||
| 5 | |||
| 6 | The dnet-config tool doesn't know about cross-compilation, so it injects | ||
| 7 | -I/usr/include into the path, causing compiler errors. So instead find dnet via | ||
| 8 | -ldnet. | ||
| 9 | |||
| 10 | Upstream-Status: Inappropriate [embedded specific] | ||
| 11 | |||
| 12 | Signed-off-by: Martin Kelly <mkelly@xevo.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/configure.ac | 4 ++-- | ||
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | --- a/open-vm-tools/configure.ac | ||
| 18 | +++ b/open-vm-tools/configure.ac | ||
| 19 | @@ -937,7 +937,7 @@ if test "$with_dnet" = "yes"; then | ||
| 20 | AC_VMW_CHECK_LIB([dnet], | ||
| 21 | [DNET], | ||
| 22 | [], | ||
| 23 | - [dnet-config], | ||
| 24 | + [], | ||
| 25 | [], | ||
| 26 | [dnet.h], | ||
| 27 | [intf_open], | ||
| 28 | @@ -947,7 +947,7 @@ if test "$with_dnet" = "yes"; then | ||
| 29 | |||
| 30 | if test $have_dnet = "no"; then | ||
| 31 | AC_MSG_ERROR( | ||
| 32 | - [dnet-config was not found on your PATH. Please configure without dnet or install dnet - http://libdnet.sourceforge.net]) | ||
| 33 | + [dnet was not found. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net]) | ||
| 34 | fi | ||
| 35 | fi | ||
| 36 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-hgfsmounter-Makefile.am-support-usrmerge.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-hgfsmounter-Makefile.am-support-usrmerge.patch new file mode 100644 index 0000000000..82443ee660 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-hgfsmounter-Makefile.am-support-usrmerge.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 33798f3e484ebd3470e9da791b73b4b90ba12bc3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
| 3 | Date: Tue, 14 Jan 2020 15:04:03 +0800 | ||
| 4 | Subject: [PATCH] hgfsmounter/Makefile.am: support usrmerge | ||
| 5 | |||
| 6 | There is a do_package error when enable usrmerge feature due to the | ||
| 7 | hardcoded sbin directory. Remove this piece of code because we already | ||
| 8 | create the symbolic link in do_install. | ||
| 9 | |||
| 10 | Upstream-Status: Inappropriate [oe-specific] | ||
| 11 | |||
| 12 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/hgfsmounter/Makefile.am | 3 --- | ||
| 15 | 1 file changed, 3 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/open-vm-tools/hgfsmounter/Makefile.am b/open-vm-tools/hgfsmounter/Makefile.am | ||
| 18 | index 7c1ba1a..58bd3f8 100644 | ||
| 19 | --- a/open-vm-tools/hgfsmounter/Makefile.am | ||
| 20 | +++ b/open-vm-tools/hgfsmounter/Makefile.am | ||
| 21 | @@ -39,9 +39,6 @@ uninstall-hook: | ||
| 22 | rm -f $(DESTDIR)$(sbindir)/mount_vmhgfs | ||
| 23 | else | ||
| 24 | install-exec-hook: | ||
| 25 | - -$(MKDIR_P) $(DESTDIR)/sbin | ||
| 26 | - -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \ | ||
| 27 | - $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null | ||
| 28 | uninstall-hook: | ||
| 29 | rm -f $(DESTDIR)/sbin/mount.vmhgfs | ||
| 30 | endif !FREEBSD | ||
| 31 | -- | ||
| 32 | 2.7.4 | ||
| 33 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-pollGtk-Drop-volatile-qualifier.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-pollGtk-Drop-volatile-qualifier.patch new file mode 100644 index 0000000000..adc6571f7e --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-pollGtk-Drop-volatile-qualifier.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 7bd280f3cc07208760759c98bbfbac3f9d28f77c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 5 Mar 2021 08:58:29 -0800 | ||
| 4 | Subject: [PATCH] pollGtk: Drop volatile qualifier | ||
| 5 | |||
| 6 | glib-2.0 has changed the function interfaces as well and do not expect | ||
| 7 | it to be volatile. GCC 11 complains about it | ||
| 8 | |||
| 9 | glib/gatomic.h:112:5: error: argument 2 of '__atomic_load' discards 'volatile' qualifier [-Werror=incompatible-pointer-types] | ||
| 10 | |||
| 11 | Upstream-Status: Pending | ||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/lib/pollGtk/pollGtk.c | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/open-vm-tools/lib/pollGtk/pollGtk.c b/open-vm-tools/lib/pollGtk/pollGtk.c | ||
| 18 | index 6d95bf01..a941e7a7 100644 | ||
| 19 | --- a/open-vm-tools/lib/pollGtk/pollGtk.c | ||
| 20 | +++ b/open-vm-tools/lib/pollGtk/pollGtk.c | ||
| 21 | @@ -1473,7 +1473,7 @@ PollGtkBasicCallback(gpointer data) // IN: The eventEntry | ||
| 22 | void | ||
| 23 | Poll_InitGtk(void) | ||
| 24 | { | ||
| 25 | - static volatile gsize inited = 0; | ||
| 26 | + static gsize inited = 0; | ||
| 27 | |||
| 28 | static const PollImpl gtkImpl = | ||
| 29 | { | ||
| 30 | -- | ||
| 31 | 2.30.1 | ||
| 32 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch new file mode 100644 index 0000000000..95664e8552 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-utilBacktrace-Ignore-Warray-bounds.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From ac3f93ea087d3a5461fe57fe021d0fe9a959e13c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 25 Dec 2019 15:25:02 -0800 | ||
| 4 | Subject: [PATCH] utilBacktrace: Ignore -Warray-bounds | ||
| 5 | |||
| 6 | This is new warning with gcc10, until its fixed ignore it like gcc<10 | ||
| 7 | did | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | open-vm-tools/lib/user/utilBacktrace.c | 5 +++++ | ||
| 13 | 1 file changed, 5 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/open-vm-tools/lib/user/utilBacktrace.c b/open-vm-tools/lib/user/utilBacktrace.c | ||
| 16 | index b72340ad..97ca53f2 100644 | ||
| 17 | --- a/open-vm-tools/lib/user/utilBacktrace.c | ||
| 18 | +++ b/open-vm-tools/lib/user/utilBacktrace.c | ||
| 19 | @@ -517,6 +517,11 @@ Util_BacktraceWithFunc(int bugNr, // IN: | ||
| 20 | } else { | ||
| 21 | outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr); | ||
| 22 | } | ||
| 23 | +#pragma GCC diagnostic push | ||
| 24 | +#pragma GCC diagnostic ignored "-Warray-bounds" | ||
| 25 | + | ||
| 26 | Util_BacktraceFromPointerWithFunc(&x[-2], outFunc, outFuncData); | ||
| 27 | +#pragma GCC diagnostic pop | ||
| 28 | #endif | ||
| 29 | } | ||
| 30 | + | ||
| 31 | -- | ||
| 32 | 2.24.1 | ||
| 33 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch new file mode 100644 index 0000000000..34628ffbef --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-add-include-sys-sysmacros.h.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 3fa237b3afabc293e563292b8d89265a871626ad Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Kelly <mkelly@xevo.com> | ||
| 3 | Date: Mon, 22 May 2017 17:00:05 -0700 | ||
| 4 | Subject: [PATCH] add #include <sys/sysmacros.h> | ||
| 5 | |||
| 6 | In newer glibc versions, the definition for major() has been moved to | ||
| 7 | sys/sysmacros.h, and using the older version in <sys/types.h> has been | ||
| 8 | deprecated. So, add an include for <sys/sysmacros.h>. | ||
| 9 | |||
| 10 | Upstream-Status: Pending | ||
| 11 | |||
| 12 | Signed-off-by: Martin Kelly <mkelly@xevo.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/lib/wiper/wiperPosix.c | 3 +++ | ||
| 15 | 1 file changed, 3 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/open-vm-tools/lib/wiper/wiperPosix.c b/open-vm-tools/lib/wiper/wiperPosix.c | ||
| 18 | index bd542410..ccf06293 100644 | ||
| 19 | --- a/open-vm-tools/lib/wiper/wiperPosix.c | ||
| 20 | +++ b/open-vm-tools/lib/wiper/wiperPosix.c | ||
| 21 | @@ -43,6 +43,9 @@ | ||
| 22 | # include <libgen.h> | ||
| 23 | # endif /* __FreeBSD_version >= 500000 */ | ||
| 24 | #endif | ||
| 25 | +#if defined(__linux__) | ||
| 26 | +#include <sys/sysmacros.h> | ||
| 27 | +#endif | ||
| 28 | #include <unistd.h> | ||
| 29 | |||
| 30 | #include "vmware.h" | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch new file mode 100644 index 0000000000..0f64eabc94 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From fe56b67a2915a8632ea30604c14241f335dd3c15 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 12 Nov 2019 10:49:46 -0800 | ||
| 4 | Subject: [PATCH] hgfsServerLinux: Consider 64bit time_t possibility | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | --- | ||
| 9 | .../lib/hgfsServer/hgfsServerLinux.c | 19 +++++-------------- | ||
| 10 | 1 file changed, 5 insertions(+), 14 deletions(-) | ||
| 11 | |||
| 12 | diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 13 | index 03175623..554da67f 100644 | ||
| 14 | --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 15 | +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 16 | @@ -2561,20 +2561,11 @@ HgfsStatToFileAttr(struct stat *stats, // IN: stat information | ||
| 17 | LOG(4, ("%s: done, permissions %o%o%o%o, size %"FMT64"u\n", __FUNCTION__, | ||
| 18 | attr->specialPerms, attr->ownerPerms, attr->groupPerms, | ||
| 19 | attr->otherPerms, attr->size)); | ||
| 20 | -#ifdef __FreeBSD__ | ||
| 21 | -# if !defined(VM_X86_64) && __FreeBSD_version >= 500043 | ||
| 22 | -# define FMTTIMET "" | ||
| 23 | -# else | ||
| 24 | -# define FMTTIMET "l" | ||
| 25 | -# endif | ||
| 26 | -#else | ||
| 27 | -# define FMTTIMET "l" | ||
| 28 | -#endif | ||
| 29 | - LOG(4, ("access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n" | ||
| 30 | - "attr: %"FMTTIMET"d/%"FMT64"u\n", | ||
| 31 | - stats->st_atime, attr->accessTime, stats->st_mtime, attr->writeTime, | ||
| 32 | - stats->st_ctime, attr->attrChangeTime)); | ||
| 33 | -#undef FMTTIMET | ||
| 34 | + LOG(4, ("access: %jd/%"FMT64"u \nwrite: %jd/%"FMT64"u \n" | ||
| 35 | + "attr: %jd/%"FMT64"u\n", | ||
| 36 | + (intmax_t)stats->st_atime, attr->accessTime, | ||
| 37 | + (intmax_t)stats->st_mtime, attr->writeTime, | ||
| 38 | + (intmax_t)stats->st_ctime, attr->attrChangeTime)); | ||
| 39 | |||
| 40 | attr->userId = stats->st_uid; | ||
| 41 | attr->groupId = stats->st_gid; | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch new file mode 100644 index 0000000000..6d2e498141 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Use-configure-test-for-struct-timespec.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From bf9292ff9bd25467a014d6c2070805d163daa4c9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
| 3 | Date: Wed, 18 Nov 2015 09:03:00 +0000 | ||
| 4 | Subject: [PATCH] Use configure test for struct timespec | ||
| 5 | |||
| 6 | Use the configure script to test for struct time spec instead of trying | ||
| 7 | to keep track of what platforms has it. | ||
| 8 | |||
| 9 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> | ||
| 10 | --- | ||
| 11 | open-vm-tools/configure.ac | 1 + | ||
| 12 | open-vm-tools/lib/include/hgfsUtil.h | 8 +------- | ||
| 13 | 2 files changed, 2 insertions(+), 7 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac | ||
| 16 | index 713ea683..48ff1ef3 100644 | ||
| 17 | --- a/open-vm-tools/configure.ac | ||
| 18 | +++ b/open-vm-tools/configure.ac | ||
| 19 | @@ -1208,6 +1208,7 @@ AC_TYPE_OFF_T | ||
| 20 | AC_TYPE_PID_T | ||
| 21 | AC_TYPE_SIZE_T | ||
| 22 | AC_CHECK_MEMBERS([struct stat.st_rdev]) | ||
| 23 | +AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include <time.h>]]) | ||
| 24 | AC_HEADER_TIME | ||
| 25 | AC_STRUCT_TM | ||
| 26 | AC_C_VOLATILE | ||
| 27 | diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h | ||
| 28 | index 609f4c00..a3a022d4 100644 | ||
| 29 | --- a/open-vm-tools/lib/include/hgfsUtil.h | ||
| 30 | +++ b/open-vm-tools/lib/include/hgfsUtil.h | ||
| 31 | @@ -53,13 +53,7 @@ | ||
| 32 | # include <time.h> | ||
| 33 | # endif | ||
| 34 | # include "vm_basic_types.h" | ||
| 35 | -# if !defined _STRUCT_TIMESPEC && \ | ||
| 36 | - !defined _TIMESPEC_DECLARED && \ | ||
| 37 | - !defined __timespec_defined && \ | ||
| 38 | - !defined sun && \ | ||
| 39 | - !defined __FreeBSD__ && \ | ||
| 40 | - !__APPLE__ && \ | ||
| 41 | - !defined _WIN32 | ||
| 42 | +# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC | ||
| 43 | struct timespec { | ||
| 44 | time_t tv_sec; | ||
| 45 | long tv_nsec; | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch new file mode 100644 index 0000000000..e107ecf235 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | From 5a795b234c617150915a607776c76377948870a6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
| 3 | Date: Wed, 18 Nov 2015 09:10:14 +0000 | ||
| 4 | Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS | ||
| 5 | |||
| 6 | The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so | ||
| 7 | assume it is not there instead of testing for specific implementations. | ||
| 8 | |||
| 9 | This is needed for musl libc. | ||
| 10 | |||
| 11 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> | ||
| 12 | --- | ||
| 13 | open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 8 +++++--- | ||
| 14 | open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +-- | ||
| 15 | 2 files changed, 6 insertions(+), 5 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 18 | index f2b7ce67..0e6351a9 100644 | ||
| 19 | --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 20 | +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 21 | @@ -105,11 +105,13 @@ typedef struct DirectoryEntry { | ||
| 22 | #endif | ||
| 23 | |||
| 24 | /* | ||
| 25 | - * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the | ||
| 26 | - * Solaris version of <sys/stat.h>. | ||
| 27 | + * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in | ||
| 28 | + * POSIX. | ||
| 29 | */ | ||
| 30 | -#ifdef sun | ||
| 31 | +#ifndef ACCESSPERMS | ||
| 32 | # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) | ||
| 33 | +#endif | ||
| 34 | +#ifndef ALLPERMS | ||
| 35 | # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) | ||
| 36 | #endif | ||
| 37 | |||
| 38 | diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | ||
| 39 | index 89133652..7e9c3a91 100644 | ||
| 40 | --- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | ||
| 41 | +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | ||
| 42 | @@ -52,7 +52,7 @@ | ||
| 43 | |||
| 44 | #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) | ||
| 45 | #define DND_STAGINGDIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) | ||
| 46 | -#ifdef sun | ||
| 47 | +#ifndef ACCESSPERMS | ||
| 48 | #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) | ||
| 49 | #endif | ||
| 50 | #ifdef __ANDROID__ | ||
| 51 | @@ -61,7 +61,6 @@ | ||
| 52 | */ | ||
| 53 | #define NO_SETMNTENT | ||
| 54 | #define NO_ENDMNTENT | ||
| 55 | -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) | ||
| 56 | #endif | ||
| 57 | |||
| 58 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch new file mode 100644 index 0000000000..c6378b8086 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-to-test-for-feature-instead-of-platfor.patch | |||
| @@ -0,0 +1,135 @@ | |||
| 1 | From 719d60978f979cf2e03771a9b8a62e36c92639f9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
| 3 | Date: Wed, 18 Nov 2015 10:05:07 +0000 | ||
| 4 | Subject: [PATCH] Use configure to test for feature instead of platform | ||
| 5 | |||
| 6 | Test for various functions instead of trying to keep track of what | ||
| 7 | platform and what version of the given platform has support for what. | ||
| 8 | |||
| 9 | This should make it easier to port to currently unknown platforms and | ||
| 10 | will solve the issue if a platform add support for a missing feature in | ||
| 11 | the future. | ||
| 12 | |||
| 13 | The features we test for are: | ||
| 14 | - getifaddrs | ||
| 15 | - getauxval | ||
| 16 | - issetugid | ||
| 17 | - __secure_getenv | ||
| 18 | |||
| 19 | This is needed for musl libc. | ||
| 20 | |||
| 21 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> | ||
| 22 | --- | ||
| 23 | open-vm-tools/configure.ac | 4 ++++ | ||
| 24 | open-vm-tools/lib/misc/idLinux.c | 30 +++++++++++------------- | ||
| 25 | open-vm-tools/lib/nicInfo/nicInfoPosix.c | 6 ++++- | ||
| 26 | 3 files changed, 23 insertions(+), 17 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac | ||
| 29 | index 48ff1ef3..71e684bb 100644 | ||
| 30 | --- a/open-vm-tools/configure.ac | ||
| 31 | +++ b/open-vm-tools/configure.ac | ||
| 32 | @@ -897,6 +897,7 @@ AC_CHECK_FUNCS( | ||
| 33 | |||
| 34 | AC_CHECK_FUNCS([ecvt]) | ||
| 35 | AC_CHECK_FUNCS([fcvt]) | ||
| 36 | +AC_CHECK_FUNCS([getifaddrs getauxval issetugid __secure_getenv]) | ||
| 37 | |||
| 38 | AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes]) | ||
| 39 | |||
| 40 | @@ -1145,10 +1146,13 @@ fi | ||
| 41 | ### | ||
| 42 | |||
| 43 | AC_CHECK_HEADERS([crypt.h]) | ||
| 44 | +AC_CHECK_HEADERS([ifaddrs.h]) | ||
| 45 | AC_CHECK_HEADERS([inttypes.h]) | ||
| 46 | AC_CHECK_HEADERS([stdint.h]) | ||
| 47 | AC_CHECK_HEADERS([stdlib.h]) | ||
| 48 | AC_CHECK_HEADERS([wchar.h]) | ||
| 49 | +AC_CHECK_HEADERS([net/if.h]) | ||
| 50 | +AC_CHECK_HEADERS([sys/auxv.h]) | ||
| 51 | AC_CHECK_HEADERS([sys/inttypes.h]) | ||
| 52 | AC_CHECK_HEADERS([sys/io.h]) | ||
| 53 | AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD | ||
| 54 | diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c | ||
| 55 | index b950cf84..1dcfb508 100644 | ||
| 56 | --- a/open-vm-tools/lib/misc/idLinux.c | ||
| 57 | +++ b/open-vm-tools/lib/misc/idLinux.c | ||
| 58 | @@ -27,12 +27,9 @@ | ||
| 59 | #include <sys/syscall.h> | ||
| 60 | #include <string.h> | ||
| 61 | #include <unistd.h> | ||
| 62 | -#ifdef __linux__ | ||
| 63 | -#if defined(__GLIBC__) && \ | ||
| 64 | - (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) | ||
| 65 | +#ifdef HAVE_SYS_AUXV_H | ||
| 66 | #include <sys/auxv.h> | ||
| 67 | #endif | ||
| 68 | -#endif | ||
| 69 | #ifdef __APPLE__ | ||
| 70 | #include <sys/socket.h> | ||
| 71 | #include <TargetConditionals.h> | ||
| 72 | @@ -997,31 +994,32 @@ Id_EndSuperUser(uid_t uid) // IN: | ||
| 73 | static Bool | ||
| 74 | IdIsSetUGid(void) | ||
| 75 | { | ||
| 76 | -#if defined(__ANDROID__) | ||
| 77 | - /* Android does not have a secure_getenv, so be conservative. */ | ||
| 78 | - return TRUE; | ||
| 79 | -#else | ||
| 80 | /* | ||
| 81 | * We use __secure_getenv, which returns NULL if the binary is | ||
| 82 | - * setuid or setgid. Alternatives include, | ||
| 83 | + * setuid or setgid, when issetugid or getauxval(AT_SECURE) is not | ||
| 84 | + * available. Alternatives include, | ||
| 85 | * | ||
| 86 | - * a) getauxval(AT_SECURE); not available until glibc 2.16. | ||
| 87 | - * b) __libc_enable_secure; may not be exported. | ||
| 88 | + * a) issetugid(); not (yet?) available in glibc. | ||
| 89 | + * b) getauxval(AT_SECURE); not available until glibc 2.16. | ||
| 90 | + * c) __libc_enable_secure; may not be exported. | ||
| 91 | * | ||
| 92 | - * Use (a) when we are based on glibc 2.16, or newer. | ||
| 93 | + * Use (b) when we are based on glibc 2.16, or newer. | ||
| 94 | */ | ||
| 95 | |||
| 96 | -#if defined(__GLIBC__) && \ | ||
| 97 | - (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) | ||
| 98 | +#if HAVE_ISSETUGID | ||
| 99 | + return issetugid(); | ||
| 100 | +#elif HAVE_GETAUXVAL | ||
| 101 | return getauxval(AT_SECURE) != 0; | ||
| 102 | -#else | ||
| 103 | +#elif HAVE___SECURE_GETENV | ||
| 104 | static const char envName[] = "VMW_SETUGID_TEST"; | ||
| 105 | |||
| 106 | if (setenv(envName, "1", TRUE) == -1) { | ||
| 107 | return TRUE; /* Conservative */ | ||
| 108 | } | ||
| 109 | return __secure_getenv(envName) == NULL; | ||
| 110 | -#endif | ||
| 111 | +#else | ||
| 112 | + /* Android does not have a secure_getenv, so be conservative. */ | ||
| 113 | + return TRUE; | ||
| 114 | #endif | ||
| 115 | } | ||
| 116 | #endif | ||
| 117 | diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c | ||
| 118 | index a22981d5..b4e08681 100644 | ||
| 119 | --- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c | ||
| 120 | +++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c | ||
| 121 | @@ -34,9 +34,13 @@ | ||
| 122 | #include <sys/socket.h> | ||
| 123 | #include <sys/stat.h> | ||
| 124 | #include <errno.h> | ||
| 125 | -#if defined(__FreeBSD__) || defined(__APPLE__) | ||
| 126 | +#if HAVE_SYS_SYSCTL_H | ||
| 127 | # include <sys/sysctl.h> | ||
| 128 | +#endif | ||
| 129 | +#if HAVE_IFADDRS_H | ||
| 130 | # include <ifaddrs.h> | ||
| 131 | +#endif | ||
| 132 | +#if HAVE_NET_IF_H | ||
| 133 | # include <net/if.h> | ||
| 134 | #endif | ||
| 135 | #ifndef NO_DNET | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch new file mode 100644 index 0000000000..9a227f9ec7 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Use-configure-test-for-sys-stat.h-include.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | From 11adcf43a1e7aa39ee4d82fa567f37e5b0c6ca81 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
| 3 | Date: Wed, 18 Nov 2015 10:41:01 +0000 | ||
| 4 | Subject: [PATCH] Use configure test for sys/stat.h include | ||
| 5 | |||
| 6 | This is needed for musl libc. | ||
| 7 | |||
| 8 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> | ||
| 9 | --- | ||
| 10 | open-vm-tools/services/plugins/vix/vixTools.c | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c | ||
| 14 | index e5273786..cabc4137 100644 | ||
| 15 | --- a/open-vm-tools/services/plugins/vix/vixTools.c | ||
| 16 | +++ b/open-vm-tools/services/plugins/vix/vixTools.c | ||
| 17 | @@ -66,7 +66,7 @@ | ||
| 18 | #include <unistd.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | -#if defined(sun) || defined(__FreeBSD__) || defined(__APPLE__) | ||
| 22 | +#ifdef HAVE_SYS_STAT_H | ||
| 23 | #include <sys/stat.h> | ||
| 24 | #endif | ||
| 25 | |||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch new file mode 100644 index 0000000000..11be2d4a07 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-Fix-subdir-objects-configure-error.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | From cf1284fda8fb22a2b27cb2ce7962f166166e74c3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 13 Jun 2018 23:48:04 -0700 | ||
| 4 | Subject: [PATCH] Fix subdir objects configure error | ||
| 5 | |||
| 6 | Fix build on musl while here | ||
| 7 | |||
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 9 | --- | ||
| 10 | open-vm-tools/configure.ac | 1 + | ||
| 11 | 1 file changed, 1 insertion(+) | ||
| 12 | |||
| 13 | diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac | ||
| 14 | index 71e684bb..b76a7966 100644 | ||
| 15 | --- a/open-vm-tools/configure.ac | ||
| 16 | +++ b/open-vm-tools/configure.ac | ||
| 17 | @@ -303,6 +303,7 @@ AC_ARG_ENABLE( | ||
| 18 | [], | ||
| 19 | [enable_resolutionkms="auto"]) | ||
| 20 | |||
| 21 | +AM_INIT_AUTOMAKE([subdir-objects]) | ||
| 22 | AM_INIT_AUTOMAKE | ||
| 23 | |||
| 24 | ### | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch new file mode 100644 index 0000000000..814b9e3b25 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-include-poll.h-instead-of-sys-poll.h.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | From e4f0b99d90e26b15106f634caad1c3dea9e09cb8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 13 Jun 2018 23:02:50 -0700 | ||
| 4 | Subject: [PATCH] include poll.h instead of sys/poll.h | ||
| 5 | |||
| 6 | including sys/poll.h is deprecated | ||
| 7 | |||
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 9 | --- | ||
| 10 | open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c | ||
| 14 | index 65b07109..b41aa29d 100644 | ||
| 15 | --- a/open-vm-tools/lib/asyncsocket/asyncsocket.c | ||
| 16 | +++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c | ||
| 17 | @@ -69,8 +69,8 @@ | ||
| 18 | #else | ||
| 19 | #include <stddef.h> | ||
| 20 | #include <ctype.h> | ||
| 21 | +#include <poll.h> | ||
| 22 | #include <sys/types.h> | ||
| 23 | -#include <sys/poll.h> | ||
| 24 | #include <sys/socket.h> | ||
| 25 | #include <sys/un.h> | ||
| 26 | #include <netdb.h> | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch new file mode 100644 index 0000000000..9cf54f6f44 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-Rename-poll.h-to-vm_poll.h.patch | |||
| @@ -0,0 +1,742 @@ | |||
| 1 | From 8793466326dd10b0d2dbb83c64beff5cc8c0fc7d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 13 Jun 2018 23:11:58 -0700 | ||
| 4 | Subject: [PATCH] Rename poll.h to vm_poll.h | ||
| 5 | |||
| 6 | musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this | ||
| 7 | we rename poll.h to vm_poll.h. | ||
| 8 | |||
| 9 | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- | ||
| 13 | open-vm-tools/lib/hgfsServer/hgfsServer.c | 2 +- | ||
| 14 | open-vm-tools/lib/include/asyncsocket.h | 2 +- | ||
| 15 | open-vm-tools/lib/include/pollImpl.h | 2 +- | ||
| 16 | open-vm-tools/lib/include/{poll.h => vm_poll.h} | 2 +- | ||
| 17 | open-vm-tools/lib/rpcIn/rpcin.c | 2 +- | ||
| 18 | .../services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c | 2 +- | ||
| 19 | 7 files changed, 7 insertions(+), 7 deletions(-) | ||
| 20 | rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (99%) | ||
| 21 | |||
| 22 | --- a/open-vm-tools/lib/asyncsocket/asyncsocket.c | ||
| 23 | +++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c | ||
| 24 | @@ -86,7 +86,7 @@ | ||
| 25 | #include "random.h" | ||
| 26 | #include "asyncsocket.h" | ||
| 27 | #include "asyncSocketBase.h" | ||
| 28 | -#include "poll.h" | ||
| 29 | +#include "vm_poll.h" | ||
| 30 | #include "log.h" | ||
| 31 | #include "err.h" | ||
| 32 | #include "hostinfo.h" | ||
| 33 | --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c | ||
| 34 | +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c | ||
| 35 | @@ -48,7 +48,7 @@ | ||
| 36 | #include "hgfsServerOplock.h" | ||
| 37 | #include "hgfsDirNotify.h" | ||
| 38 | #include "userlock.h" | ||
| 39 | -#include "poll.h" | ||
| 40 | +#include "vm_poll.h" | ||
| 41 | #include "mutexRankLib.h" | ||
| 42 | #include "vm_basic_asm.h" | ||
| 43 | #include "unicodeOperations.h" | ||
| 44 | --- a/open-vm-tools/lib/include/asyncsocket.h | ||
| 45 | +++ b/open-vm-tools/lib/include/asyncsocket.h | ||
| 46 | @@ -164,7 +164,7 @@ typedef struct AsyncSocket AsyncSocket; | ||
| 47 | * Or the client can specify its favorite poll class and locking behavior. | ||
| 48 | * Use of IVmdbPoll is only supported for regular sockets and for Attach. | ||
| 49 | */ | ||
| 50 | -#include "poll.h" | ||
| 51 | +#include "vm_poll.h" | ||
| 52 | struct IVmdbPoll; | ||
| 53 | typedef struct AsyncSocketPollParams { | ||
| 54 | int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ | ||
| 55 | --- a/open-vm-tools/lib/include/pollImpl.h | ||
| 56 | +++ b/open-vm-tools/lib/include/pollImpl.h | ||
| 57 | @@ -44,7 +44,7 @@ | ||
| 58 | #define INCLUDE_ALLOW_USERLEVEL | ||
| 59 | #include "includeCheck.h" | ||
| 60 | |||
| 61 | -#include "poll.h" | ||
| 62 | +#include "vm_poll.h" | ||
| 63 | #include "vm_basic_asm.h" | ||
| 64 | |||
| 65 | #if defined(__cplusplus) | ||
| 66 | --- a/open-vm-tools/lib/include/poll.h | ||
| 67 | +++ /dev/null | ||
| 68 | @@ -1,330 +0,0 @@ | ||
| 69 | -/********************************************************* | ||
| 70 | - * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. | ||
| 71 | - * | ||
| 72 | - * This program is free software; you can redistribute it and/or modify it | ||
| 73 | - * under the terms of the GNU Lesser General Public License as published | ||
| 74 | - * by the Free Software Foundation version 2.1 and no later version. | ||
| 75 | - * | ||
| 76 | - * This program is distributed in the hope that it will be useful, but | ||
| 77 | - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 78 | - * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public | ||
| 79 | - * License for more details. | ||
| 80 | - * | ||
| 81 | - * You should have received a copy of the GNU Lesser General Public License | ||
| 82 | - * along with this program; if not, write to the Free Software Foundation, Inc., | ||
| 83 | - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 84 | - * | ||
| 85 | - *********************************************************/ | ||
| 86 | - | ||
| 87 | -/********************************************************* | ||
| 88 | - * The contents of this file are subject to the terms of the Common | ||
| 89 | - * Development and Distribution License (the "License") version 1.0 | ||
| 90 | - * and no later version. You may not use this file except in | ||
| 91 | - * compliance with the License. | ||
| 92 | - * | ||
| 93 | - * You can obtain a copy of the License at | ||
| 94 | - * http://www.opensource.org/licenses/cddl1.php | ||
| 95 | - * | ||
| 96 | - * See the License for the specific language governing permissions | ||
| 97 | - * and limitations under the License. | ||
| 98 | - * | ||
| 99 | - *********************************************************/ | ||
| 100 | - | ||
| 101 | - | ||
| 102 | -#ifndef _POLL_H_ | ||
| 103 | -#define _POLL_H_ | ||
| 104 | - | ||
| 105 | -#define INCLUDE_ALLOW_USERLEVEL | ||
| 106 | -#define INCLUDE_ALLOW_VMCORE | ||
| 107 | -#include "includeCheck.h" | ||
| 108 | - | ||
| 109 | -#include "vm_basic_types.h" | ||
| 110 | -#include "vm_basic_defs.h" | ||
| 111 | -#include "vmware.h" | ||
| 112 | -#include "userlock.h" | ||
| 113 | - | ||
| 114 | -#if defined(__cplusplus) | ||
| 115 | -extern "C" { | ||
| 116 | -#endif | ||
| 117 | - | ||
| 118 | -#ifdef _WIN32 | ||
| 119 | -#define HZ 100 | ||
| 120 | -#elif defined linux | ||
| 121 | -#include <asm/param.h> | ||
| 122 | -#elif __APPLE__ | ||
| 123 | -#include <TargetConditionals.h> | ||
| 124 | -/* | ||
| 125 | - * Old SDKs don't define TARGET_OS_IPHONE at all. | ||
| 126 | - * New ones define it to 0 on Mac OS X, 1 on iOS. | ||
| 127 | - */ | ||
| 128 | -#if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 | ||
| 129 | -#include <sys/kernel.h> | ||
| 130 | -#endif | ||
| 131 | -#include <sys/poll.h> | ||
| 132 | -#define HZ 100 | ||
| 133 | -#endif | ||
| 134 | -#ifdef __ANDROID__ | ||
| 135 | -/* | ||
| 136 | - * <poll.h> of android should be included, but its name is same | ||
| 137 | - * with this file. So its content is put here to avoid conflict. | ||
| 138 | - */ | ||
| 139 | -#include <asm/poll.h> | ||
| 140 | -#define HZ 100 | ||
| 141 | -typedef unsigned int nfds_t; | ||
| 142 | -int poll(struct pollfd *, nfds_t, long); | ||
| 143 | -#endif | ||
| 144 | - | ||
| 145 | - | ||
| 146 | -/* | ||
| 147 | - * Poll event types: each type has a different reason for firing, | ||
| 148 | - * or condition that must be met before firing. | ||
| 149 | - */ | ||
| 150 | - | ||
| 151 | -typedef enum { | ||
| 152 | - /* | ||
| 153 | - * Actual Poll queue types against which you can register callbacks. | ||
| 154 | - */ | ||
| 155 | - POLL_VIRTUALREALTIME = -1, /* Negative because it doesn't have its own Q */ | ||
| 156 | - POLL_VTIME = 0, | ||
| 157 | - POLL_REALTIME, | ||
| 158 | - POLL_DEVICE, | ||
| 159 | - POLL_MAIN_LOOP, | ||
| 160 | - POLL_NUM_QUEUES | ||
| 161 | -} PollEventType; | ||
| 162 | - | ||
| 163 | - | ||
| 164 | -/* | ||
| 165 | - * Classes of events | ||
| 166 | - * | ||
| 167 | - * These are the predefined classes. More can be declared | ||
| 168 | - * with Poll_AllocClass(). | ||
| 169 | - */ | ||
| 170 | - | ||
| 171 | -typedef enum PollClass { | ||
| 172 | - POLL_CLASS_MAIN, | ||
| 173 | - POLL_CLASS_PAUSE, | ||
| 174 | - POLL_CLASS_IPC, | ||
| 175 | - POLL_CLASS_CPT, | ||
| 176 | - POLL_CLASS_MKS, | ||
| 177 | - POLL_FIXED_CLASSES, | ||
| 178 | - POLL_DEFAULT_FIXED_CLASSES, | ||
| 179 | - /* Size enum to maximum */ | ||
| 180 | - POLL_MAX_CLASSES = 31, | ||
| 181 | -} PollClass; | ||
| 182 | - | ||
| 183 | -/* | ||
| 184 | - * Do not use; Special pseudo private poll class supported by | ||
| 185 | - * PollDefault only | ||
| 186 | - */ | ||
| 187 | -#define POLL_DEFAULT_CLASS_NET POLL_FIXED_CLASSES | ||
| 188 | -#define POLL_DEFAULT_CS_NET PollClassSet_Singleton(POLL_DEFAULT_CLASS_NET) | ||
| 189 | - | ||
| 190 | -/* | ||
| 191 | - * Each callback is registered in a set of classes | ||
| 192 | - */ | ||
| 193 | - | ||
| 194 | -typedef struct PollClassSet { | ||
| 195 | - uintptr_t bits; | ||
| 196 | -} PollClassSet; | ||
| 197 | - | ||
| 198 | -/* An empty PollClassSet. */ | ||
| 199 | -static INLINE PollClassSet | ||
| 200 | -PollClassSet_Empty(void) | ||
| 201 | -{ | ||
| 202 | - PollClassSet set = { 0 }; | ||
| 203 | - return set; | ||
| 204 | -} | ||
| 205 | - | ||
| 206 | -/* A PollClassSet with the single member. */ | ||
| 207 | -static INLINE PollClassSet | ||
| 208 | -PollClassSet_Singleton(PollClass c) | ||
| 209 | -{ | ||
| 210 | - PollClassSet s = PollClassSet_Empty(); | ||
| 211 | - | ||
| 212 | - ASSERT_ON_COMPILE(POLL_MAX_CLASSES < sizeof s.bits * 8); | ||
| 213 | - ASSERT(c < POLL_MAX_CLASSES); | ||
| 214 | - | ||
| 215 | - s.bits = CONST3264U(1) << c; | ||
| 216 | - return s; | ||
| 217 | -} | ||
| 218 | - | ||
| 219 | -/* Combine two PollClassSets. */ | ||
| 220 | -static INLINE PollClassSet | ||
| 221 | -PollClassSet_Union(PollClassSet lhs, PollClassSet rhs) | ||
| 222 | -{ | ||
| 223 | - PollClassSet set; | ||
| 224 | - set.bits = lhs.bits | rhs.bits; | ||
| 225 | - return set; | ||
| 226 | -} | ||
| 227 | - | ||
| 228 | -/* Add single class to PollClassSet. */ | ||
| 229 | -static INLINE PollClassSet | ||
| 230 | -PollClassSet_Include(PollClassSet set, PollClass c) | ||
| 231 | -{ | ||
| 232 | - return PollClassSet_Union(set, PollClassSet_Singleton(c)); | ||
| 233 | -} | ||
| 234 | - | ||
| 235 | - | ||
| 236 | -#define POLL_CS_MAIN PollClassSet_Singleton(POLL_CLASS_MAIN) | ||
| 237 | -#define POLL_CS_PAUSE PollClassSet_Union(POLL_CS_MAIN, \ | ||
| 238 | - PollClassSet_Singleton(POLL_CLASS_PAUSE)) | ||
| 239 | -#define POLL_CS_CPT PollClassSet_Union(POLL_CS_PAUSE, \ | ||
| 240 | - PollClassSet_Singleton(POLL_CLASS_CPT)) | ||
| 241 | -#define POLL_CS_IPC PollClassSet_Union(POLL_CS_CPT, \ | ||
| 242 | - PollClassSet_Singleton(POLL_CLASS_IPC)) | ||
| 243 | -#define POLL_CS_VMDB POLL_CS_PAUSE /* POLL_CLASS_VMDB is retired */ | ||
| 244 | -#define POLL_CS_MKS PollClassSet_Singleton(POLL_CLASS_MKS) | ||
| 245 | -/* | ||
| 246 | - * DANGER. You don't need POLL_CS_ALWAYS. Really. So don't use it. | ||
| 247 | - */ | ||
| 248 | -#define POLL_CS_ALWAYS PollClassSet_Union(POLL_CS_CPT, POLL_CS_IPC) | ||
| 249 | - | ||
| 250 | -/* | ||
| 251 | - * Poll class-set taxonomy: | ||
| 252 | - * POLL_CS_MAIN | ||
| 253 | - * - Unless you NEED another class, use POLL_CS_MAIN. | ||
| 254 | - * POLL_CS_PAUSE | ||
| 255 | - * - For callbacks that must occur even if the guest is paused. | ||
| 256 | - * Most VMDB or Foundry commands are in this category. | ||
| 257 | - * POLL_CS_CPT | ||
| 258 | - * - Only for callbacks which can trigger intermediate Checkpoint | ||
| 259 | - * transitions. | ||
| 260 | - * The ONLY such callback is Migrate. | ||
| 261 | - * POLL_CS_IPC | ||
| 262 | - * - Only for callbacks which can contain Msg_(Post|Hint|Question) | ||
| 263 | - * responses, and for signal handlers (why)? | ||
| 264 | - * Vigor, VMDB, and Foundry can contain Msg_* responses. | ||
| 265 | - * POLL_CS_MKS | ||
| 266 | - * - Callback runs in MKS thread. | ||
| 267 | - * POLL_CS_ALWAYS | ||
| 268 | - * - Only for events that must be processed immediately. | ||
| 269 | - * The ONLY such callback is OvhdMemVmxSizeCheck. | ||
| 270 | - */ | ||
| 271 | - | ||
| 272 | - | ||
| 273 | -/* | ||
| 274 | - * Poll_Callback flags | ||
| 275 | - */ | ||
| 276 | - | ||
| 277 | -#define POLL_FLAG_PERIODIC 0x01 // keep after firing | ||
| 278 | -#define POLL_FLAG_REMOVE_AT_POWEROFF 0x02 // self-explanatory | ||
| 279 | -#define POLL_FLAG_READ 0x04 // device is ready for reading | ||
| 280 | -#define POLL_FLAG_WRITE 0x08 // device is ready for writing | ||
| 281 | -#define POLL_FLAG_SOCKET 0x10 // device is a Windows socket | ||
| 282 | -#define POLL_FLAG_NO_BULL 0x20 // callback does its own locking | ||
| 283 | -#define POLL_FLAG_WINSOCK 0x40 // Winsock style write events | ||
| 284 | -#define POLL_FLAG_FD 0x80 // device is a Windows file descriptor. | ||
| 285 | -#define POLL_FLAG_ACCEPT_INVALID_FDS 0x100 // For broken 3rd party libs, e.g. curl | ||
| 286 | -#define POLL_FLAG_THUNK_TO_WND 0x200 // thunk callback to window message loop | ||
| 287 | - | ||
| 288 | - | ||
| 289 | -typedef void (*PollerFunction)(void *clientData); | ||
| 290 | -typedef void (*PollerFireWrapper)(PollerFunction func, | ||
| 291 | - void *funcData, | ||
| 292 | - void *wrapperData); | ||
| 293 | -typedef Bool (*PollerErrorFn)(const char *errorStr); | ||
| 294 | - | ||
| 295 | -/* | ||
| 296 | - * Initialisers: | ||
| 297 | - * | ||
| 298 | - * For the sake of convenience, we declare the initialisers | ||
| 299 | - * for custom implmentations here, even though the actual | ||
| 300 | - * implementations are distinct from the core poll code. | ||
| 301 | - */ | ||
| 302 | - | ||
| 303 | -typedef struct PollOptions { | ||
| 304 | - Bool locked; // Use internal MXUser for locking | ||
| 305 | - Bool allowFullQueue; // Don't assert when device event queue is full. | ||
| 306 | - VThreadID windowsMsgThread; // thread that processes Windows messages | ||
| 307 | - PollerFireWrapper fireWrapperFn; // optional; may be useful for stats | ||
| 308 | - void *fireWrapperData; // optional | ||
| 309 | - PollerErrorFn errorFn; // optional; called upon unrecoverable error | ||
| 310 | -} PollOptions; | ||
| 311 | - | ||
| 312 | - | ||
| 313 | -void Poll_InitDefault(void); | ||
| 314 | -void Poll_InitDefaultEx(const PollOptions *opts); | ||
| 315 | -void Poll_InitGtk(void); // On top of glib for Linux | ||
| 316 | -void Poll_InitCF(void); // On top of CoreFoundation for OSX | ||
| 317 | - | ||
| 318 | - | ||
| 319 | -/* | ||
| 320 | - * Functions | ||
| 321 | - */ | ||
| 322 | -int Poll_SocketPair(Bool vmci, Bool stream, int fds[2]); | ||
| 323 | -void Poll_Loop(Bool loop, Bool *exit, PollClass c); | ||
| 324 | -void Poll_LoopTimeout(Bool loop, Bool *exit, PollClass c, int timeout); | ||
| 325 | -Bool Poll_LockingEnabled(void); | ||
| 326 | -void Poll_Exit(void); | ||
| 327 | - | ||
| 328 | - | ||
| 329 | -/* | ||
| 330 | - * Poll_Callback adds a callback regardless of whether an identical one exists. | ||
| 331 | - * The exception to this rule is POLL_DEVICE callbacks: there is a maximum of | ||
| 332 | - * one read and one write callback per fd. | ||
| 333 | - * | ||
| 334 | - * Poll_CallbackRemove removes one callback. If there are multiple identical | ||
| 335 | - * callbacks, which one is removed is an implementation detail. Note that in | ||
| 336 | - * the case of POLL_DEVICE and POLL_REALTIME callbacks, the fd/delay used to | ||
| 337 | - * create the callback is not specified when removing, so all callbacks | ||
| 338 | - * of those types with the same flags, function, and clientData are considered | ||
| 339 | - * "identical" even if their fd/delay differed. | ||
| 340 | - */ | ||
| 341 | - | ||
| 342 | -VMwareStatus Poll_Callback(PollClassSet classSet, | ||
| 343 | - int flags, | ||
| 344 | - PollerFunction f, | ||
| 345 | - void *clientData, | ||
| 346 | - PollEventType type, | ||
| 347 | - PollDevHandle info, // fd/microsec delay | ||
| 348 | - MXUserRecLock *lck); | ||
| 349 | -Bool Poll_CallbackRemove(PollClassSet classSet, | ||
| 350 | - int flags, | ||
| 351 | - PollerFunction f, | ||
| 352 | - void *clientData, | ||
| 353 | - PollEventType type); | ||
| 354 | -Bool Poll_CallbackRemoveOneByCB(PollClassSet classSet, | ||
| 355 | - int flags, | ||
| 356 | - PollerFunction f, | ||
| 357 | - PollEventType type, | ||
| 358 | - void **clientData); | ||
| 359 | - | ||
| 360 | -void Poll_NotifyChange(PollClassSet classSet); | ||
| 361 | - | ||
| 362 | -/* | ||
| 363 | - * Wrappers for Poll_Callback and Poll_CallbackRemove that present | ||
| 364 | - * simpler subsets of those interfaces. | ||
| 365 | - */ | ||
| 366 | - | ||
| 367 | -VMwareStatus Poll_CB_Device(PollerFunction f, | ||
| 368 | - void *clientData, | ||
| 369 | - PollDevHandle device, | ||
| 370 | - Bool periodic); | ||
| 371 | - | ||
| 372 | -Bool Poll_CB_DeviceRemove(PollerFunction f, | ||
| 373 | - void *clientData, | ||
| 374 | - Bool periodic); | ||
| 375 | - | ||
| 376 | - | ||
| 377 | -VMwareStatus Poll_CB_RTime(PollerFunction f, | ||
| 378 | - void *clientData, | ||
| 379 | - int64 delay, // microseconds | ||
| 380 | - Bool periodic, | ||
| 381 | - MXUserRecLock *lock); | ||
| 382 | - | ||
| 383 | -Bool Poll_CB_RTimeRemove(PollerFunction f, | ||
| 384 | - void *clientData, | ||
| 385 | - Bool periodic); | ||
| 386 | - | ||
| 387 | - | ||
| 388 | -#ifdef _WIN32 | ||
| 389 | -void Poll_SetPumpsWindowsMessages(Bool pumps); | ||
| 390 | -void Poll_SetWindowMessageRecipient(HWND hWnd, UINT msg, Bool alwaysThunk); | ||
| 391 | -Bool Poll_FireWndCallback(void *lparam); | ||
| 392 | -#endif | ||
| 393 | - | ||
| 394 | -#if defined(__cplusplus) | ||
| 395 | -} // extern "C" | ||
| 396 | -#endif | ||
| 397 | - | ||
| 398 | -#endif // _POLL_H_ | ||
| 399 | --- /dev/null | ||
| 400 | +++ b/open-vm-tools/lib/include/vm_poll.h | ||
| 401 | @@ -0,0 +1,330 @@ | ||
| 402 | +/********************************************************* | ||
| 403 | + * Copyright (C) 1998-2018 VMware, Inc. All rights reserved. | ||
| 404 | + * | ||
| 405 | + * This program is free software; you can redistribute it and/or modify it | ||
| 406 | + * under the terms of the GNU Lesser General Public License as published | ||
| 407 | + * by the Free Software Foundation version 2.1 and no later version. | ||
| 408 | + * | ||
| 409 | + * This program is distributed in the hope that it will be useful, but | ||
| 410 | + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 411 | + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public | ||
| 412 | + * License for more details. | ||
| 413 | + * | ||
| 414 | + * You should have received a copy of the GNU Lesser General Public License | ||
| 415 | + * along with this program; if not, write to the Free Software Foundation, Inc., | ||
| 416 | + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 417 | + * | ||
| 418 | + *********************************************************/ | ||
| 419 | + | ||
| 420 | +/********************************************************* | ||
| 421 | + * The contents of this file are subject to the terms of the Common | ||
| 422 | + * Development and Distribution License (the "License") version 1.0 | ||
| 423 | + * and no later version. You may not use this file except in | ||
| 424 | + * compliance with the License. | ||
| 425 | + * | ||
| 426 | + * You can obtain a copy of the License at | ||
| 427 | + * http://www.opensource.org/licenses/cddl1.php | ||
| 428 | + * | ||
| 429 | + * See the License for the specific language governing permissions | ||
| 430 | + * and limitations under the License. | ||
| 431 | + * | ||
| 432 | + *********************************************************/ | ||
| 433 | + | ||
| 434 | + | ||
| 435 | +#ifndef _POLL_H_ | ||
| 436 | +#define _POLL_H_ | ||
| 437 | + | ||
| 438 | +#define INCLUDE_ALLOW_USERLEVEL | ||
| 439 | +#define INCLUDE_ALLOW_VMCORE | ||
| 440 | +#include "includeCheck.h" | ||
| 441 | + | ||
| 442 | +#include "vm_basic_types.h" | ||
| 443 | +#include "vm_basic_defs.h" | ||
| 444 | +#include "vmware.h" | ||
| 445 | +#include "userlock.h" | ||
| 446 | + | ||
| 447 | +#if defined(__cplusplus) | ||
| 448 | +extern "C" { | ||
| 449 | +#endif | ||
| 450 | + | ||
| 451 | +#ifdef _WIN32 | ||
| 452 | +#define HZ 100 | ||
| 453 | +#elif defined linux | ||
| 454 | +#include <asm/param.h> | ||
| 455 | +#elif __APPLE__ | ||
| 456 | +#include <TargetConditionals.h> | ||
| 457 | +/* | ||
| 458 | + * Old SDKs don't define TARGET_OS_IPHONE at all. | ||
| 459 | + * New ones define it to 0 on Mac OS X, 1 on iOS. | ||
| 460 | + */ | ||
| 461 | +#if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 | ||
| 462 | +#include <sys/kernel.h> | ||
| 463 | +#endif | ||
| 464 | +#include <poll.h> | ||
| 465 | +#define HZ 100 | ||
| 466 | +#endif | ||
| 467 | +#ifdef __ANDROID__ | ||
| 468 | +/* | ||
| 469 | + * <poll.h> of android should be included, but its name is same | ||
| 470 | + * with this file. So its content is put here to avoid conflict. | ||
| 471 | + */ | ||
| 472 | +#include <asm/poll.h> | ||
| 473 | +#define HZ 100 | ||
| 474 | +typedef unsigned int nfds_t; | ||
| 475 | +int poll(struct pollfd *, nfds_t, long); | ||
| 476 | +#endif | ||
| 477 | + | ||
| 478 | + | ||
| 479 | +/* | ||
| 480 | + * Poll event types: each type has a different reason for firing, | ||
| 481 | + * or condition that must be met before firing. | ||
| 482 | + */ | ||
| 483 | + | ||
| 484 | +typedef enum { | ||
| 485 | + /* | ||
| 486 | + * Actual Poll queue types against which you can register callbacks. | ||
| 487 | + */ | ||
| 488 | + POLL_VIRTUALREALTIME = -1, /* Negative because it doesn't have its own Q */ | ||
| 489 | + POLL_VTIME = 0, | ||
| 490 | + POLL_REALTIME, | ||
| 491 | + POLL_DEVICE, | ||
| 492 | + POLL_MAIN_LOOP, | ||
| 493 | + POLL_NUM_QUEUES | ||
| 494 | +} PollEventType; | ||
| 495 | + | ||
| 496 | + | ||
| 497 | +/* | ||
| 498 | + * Classes of events | ||
| 499 | + * | ||
| 500 | + * These are the predefined classes. More can be declared | ||
| 501 | + * with Poll_AllocClass(). | ||
| 502 | + */ | ||
| 503 | + | ||
| 504 | +typedef enum PollClass { | ||
| 505 | + POLL_CLASS_MAIN, | ||
| 506 | + POLL_CLASS_PAUSE, | ||
| 507 | + POLL_CLASS_IPC, | ||
| 508 | + POLL_CLASS_CPT, | ||
| 509 | + POLL_CLASS_MKS, | ||
| 510 | + POLL_FIXED_CLASSES, | ||
| 511 | + POLL_DEFAULT_FIXED_CLASSES, | ||
| 512 | + /* Size enum to maximum */ | ||
| 513 | + POLL_MAX_CLASSES = 31, | ||
| 514 | +} PollClass; | ||
| 515 | + | ||
| 516 | +/* | ||
| 517 | + * Do not use; Special pseudo private poll class supported by | ||
| 518 | + * PollDefault only | ||
| 519 | + */ | ||
| 520 | +#define POLL_DEFAULT_CLASS_NET POLL_FIXED_CLASSES | ||
| 521 | +#define POLL_DEFAULT_CS_NET PollClassSet_Singleton(POLL_DEFAULT_CLASS_NET) | ||
| 522 | + | ||
| 523 | +/* | ||
| 524 | + * Each callback is registered in a set of classes | ||
| 525 | + */ | ||
| 526 | + | ||
| 527 | +typedef struct PollClassSet { | ||
| 528 | + uintptr_t bits; | ||
| 529 | +} PollClassSet; | ||
| 530 | + | ||
| 531 | +/* An empty PollClassSet. */ | ||
| 532 | +static INLINE PollClassSet | ||
| 533 | +PollClassSet_Empty(void) | ||
| 534 | +{ | ||
| 535 | + PollClassSet set = { 0 }; | ||
| 536 | + return set; | ||
| 537 | +} | ||
| 538 | + | ||
| 539 | +/* A PollClassSet with the single member. */ | ||
| 540 | +static INLINE PollClassSet | ||
| 541 | +PollClassSet_Singleton(PollClass c) | ||
| 542 | +{ | ||
| 543 | + PollClassSet s = PollClassSet_Empty(); | ||
| 544 | + | ||
| 545 | + ASSERT_ON_COMPILE(POLL_MAX_CLASSES < sizeof s.bits * 8); | ||
| 546 | + ASSERT(c < POLL_MAX_CLASSES); | ||
| 547 | + | ||
| 548 | + s.bits = CONST3264U(1) << c; | ||
| 549 | + return s; | ||
| 550 | +} | ||
| 551 | + | ||
| 552 | +/* Combine two PollClassSets. */ | ||
| 553 | +static INLINE PollClassSet | ||
| 554 | +PollClassSet_Union(PollClassSet lhs, PollClassSet rhs) | ||
| 555 | +{ | ||
| 556 | + PollClassSet set; | ||
| 557 | + set.bits = lhs.bits | rhs.bits; | ||
| 558 | + return set; | ||
| 559 | +} | ||
| 560 | + | ||
| 561 | +/* Add single class to PollClassSet. */ | ||
| 562 | +static INLINE PollClassSet | ||
| 563 | +PollClassSet_Include(PollClassSet set, PollClass c) | ||
| 564 | +{ | ||
| 565 | + return PollClassSet_Union(set, PollClassSet_Singleton(c)); | ||
| 566 | +} | ||
| 567 | + | ||
| 568 | + | ||
| 569 | +#define POLL_CS_MAIN PollClassSet_Singleton(POLL_CLASS_MAIN) | ||
| 570 | +#define POLL_CS_PAUSE PollClassSet_Union(POLL_CS_MAIN, \ | ||
| 571 | + PollClassSet_Singleton(POLL_CLASS_PAUSE)) | ||
| 572 | +#define POLL_CS_CPT PollClassSet_Union(POLL_CS_PAUSE, \ | ||
| 573 | + PollClassSet_Singleton(POLL_CLASS_CPT)) | ||
| 574 | +#define POLL_CS_IPC PollClassSet_Union(POLL_CS_CPT, \ | ||
| 575 | + PollClassSet_Singleton(POLL_CLASS_IPC)) | ||
| 576 | +#define POLL_CS_VMDB POLL_CS_PAUSE /* POLL_CLASS_VMDB is retired */ | ||
| 577 | +#define POLL_CS_MKS PollClassSet_Singleton(POLL_CLASS_MKS) | ||
| 578 | +/* | ||
| 579 | + * DANGER. You don't need POLL_CS_ALWAYS. Really. So don't use it. | ||
| 580 | + */ | ||
| 581 | +#define POLL_CS_ALWAYS PollClassSet_Union(POLL_CS_CPT, POLL_CS_IPC) | ||
| 582 | + | ||
| 583 | +/* | ||
| 584 | + * Poll class-set taxonomy: | ||
| 585 | + * POLL_CS_MAIN | ||
| 586 | + * - Unless you NEED another class, use POLL_CS_MAIN. | ||
| 587 | + * POLL_CS_PAUSE | ||
| 588 | + * - For callbacks that must occur even if the guest is paused. | ||
| 589 | + * Most VMDB or Foundry commands are in this category. | ||
| 590 | + * POLL_CS_CPT | ||
| 591 | + * - Only for callbacks which can trigger intermediate Checkpoint | ||
| 592 | + * transitions. | ||
| 593 | + * The ONLY such callback is Migrate. | ||
| 594 | + * POLL_CS_IPC | ||
| 595 | + * - Only for callbacks which can contain Msg_(Post|Hint|Question) | ||
| 596 | + * responses, and for signal handlers (why)? | ||
| 597 | + * Vigor, VMDB, and Foundry can contain Msg_* responses. | ||
| 598 | + * POLL_CS_MKS | ||
| 599 | + * - Callback runs in MKS thread. | ||
| 600 | + * POLL_CS_ALWAYS | ||
| 601 | + * - Only for events that must be processed immediately. | ||
| 602 | + * The ONLY such callback is OvhdMemVmxSizeCheck. | ||
| 603 | + */ | ||
| 604 | + | ||
| 605 | + | ||
| 606 | +/* | ||
| 607 | + * Poll_Callback flags | ||
| 608 | + */ | ||
| 609 | + | ||
| 610 | +#define POLL_FLAG_PERIODIC 0x01 // keep after firing | ||
| 611 | +#define POLL_FLAG_REMOVE_AT_POWEROFF 0x02 // self-explanatory | ||
| 612 | +#define POLL_FLAG_READ 0x04 // device is ready for reading | ||
| 613 | +#define POLL_FLAG_WRITE 0x08 // device is ready for writing | ||
| 614 | +#define POLL_FLAG_SOCKET 0x10 // device is a Windows socket | ||
| 615 | +#define POLL_FLAG_NO_BULL 0x20 // callback does its own locking | ||
| 616 | +#define POLL_FLAG_WINSOCK 0x40 // Winsock style write events | ||
| 617 | +#define POLL_FLAG_FD 0x80 // device is a Windows file descriptor. | ||
| 618 | +#define POLL_FLAG_ACCEPT_INVALID_FDS 0x100 // For broken 3rd party libs, e.g. curl | ||
| 619 | +#define POLL_FLAG_THUNK_TO_WND 0x200 // thunk callback to window message loop | ||
| 620 | + | ||
| 621 | + | ||
| 622 | +typedef void (*PollerFunction)(void *clientData); | ||
| 623 | +typedef void (*PollerFireWrapper)(PollerFunction func, | ||
| 624 | + void *funcData, | ||
| 625 | + void *wrapperData); | ||
| 626 | +typedef Bool (*PollerErrorFn)(const char *errorStr); | ||
| 627 | + | ||
| 628 | +/* | ||
| 629 | + * Initialisers: | ||
| 630 | + * | ||
| 631 | + * For the sake of convenience, we declare the initialisers | ||
| 632 | + * for custom implmentations here, even though the actual | ||
| 633 | + * implementations are distinct from the core poll code. | ||
| 634 | + */ | ||
| 635 | + | ||
| 636 | +typedef struct PollOptions { | ||
| 637 | + Bool locked; // Use internal MXUser for locking | ||
| 638 | + Bool allowFullQueue; // Don't assert when device event queue is full. | ||
| 639 | + VThreadID windowsMsgThread; // thread that processes Windows messages | ||
| 640 | + PollerFireWrapper fireWrapperFn; // optional; may be useful for stats | ||
| 641 | + void *fireWrapperData; // optional | ||
| 642 | + PollerErrorFn errorFn; // optional; called upon unrecoverable error | ||
| 643 | +} PollOptions; | ||
| 644 | + | ||
| 645 | + | ||
| 646 | +void Poll_InitDefault(void); | ||
| 647 | +void Poll_InitDefaultEx(const PollOptions *opts); | ||
| 648 | +void Poll_InitGtk(void); // On top of glib for Linux | ||
| 649 | +void Poll_InitCF(void); // On top of CoreFoundation for OSX | ||
| 650 | + | ||
| 651 | + | ||
| 652 | +/* | ||
| 653 | + * Functions | ||
| 654 | + */ | ||
| 655 | +int Poll_SocketPair(Bool vmci, Bool stream, int fds[2]); | ||
| 656 | +void Poll_Loop(Bool loop, Bool *exit, PollClass c); | ||
| 657 | +void Poll_LoopTimeout(Bool loop, Bool *exit, PollClass c, int timeout); | ||
| 658 | +Bool Poll_LockingEnabled(void); | ||
| 659 | +void Poll_Exit(void); | ||
| 660 | + | ||
| 661 | + | ||
| 662 | +/* | ||
| 663 | + * Poll_Callback adds a callback regardless of whether an identical one exists. | ||
| 664 | + * The exception to this rule is POLL_DEVICE callbacks: there is a maximum of | ||
| 665 | + * one read and one write callback per fd. | ||
| 666 | + * | ||
| 667 | + * Poll_CallbackRemove removes one callback. If there are multiple identical | ||
| 668 | + * callbacks, which one is removed is an implementation detail. Note that in | ||
| 669 | + * the case of POLL_DEVICE and POLL_REALTIME callbacks, the fd/delay used to | ||
| 670 | + * create the callback is not specified when removing, so all callbacks | ||
| 671 | + * of those types with the same flags, function, and clientData are considered | ||
| 672 | + * "identical" even if their fd/delay differed. | ||
| 673 | + */ | ||
| 674 | + | ||
| 675 | +VMwareStatus Poll_Callback(PollClassSet classSet, | ||
| 676 | + int flags, | ||
| 677 | + PollerFunction f, | ||
| 678 | + void *clientData, | ||
| 679 | + PollEventType type, | ||
| 680 | + PollDevHandle info, // fd/microsec delay | ||
| 681 | + MXUserRecLock *lck); | ||
| 682 | +Bool Poll_CallbackRemove(PollClassSet classSet, | ||
| 683 | + int flags, | ||
| 684 | + PollerFunction f, | ||
| 685 | + void *clientData, | ||
| 686 | + PollEventType type); | ||
| 687 | +Bool Poll_CallbackRemoveOneByCB(PollClassSet classSet, | ||
| 688 | + int flags, | ||
| 689 | + PollerFunction f, | ||
| 690 | + PollEventType type, | ||
| 691 | + void **clientData); | ||
| 692 | + | ||
| 693 | +void Poll_NotifyChange(PollClassSet classSet); | ||
| 694 | + | ||
| 695 | +/* | ||
| 696 | + * Wrappers for Poll_Callback and Poll_CallbackRemove that present | ||
| 697 | + * simpler subsets of those interfaces. | ||
| 698 | + */ | ||
| 699 | + | ||
| 700 | +VMwareStatus Poll_CB_Device(PollerFunction f, | ||
| 701 | + void *clientData, | ||
| 702 | + PollDevHandle device, | ||
| 703 | + Bool periodic); | ||
| 704 | + | ||
| 705 | +Bool Poll_CB_DeviceRemove(PollerFunction f, | ||
| 706 | + void *clientData, | ||
| 707 | + Bool periodic); | ||
| 708 | + | ||
| 709 | + | ||
| 710 | +VMwareStatus Poll_CB_RTime(PollerFunction f, | ||
| 711 | + void *clientData, | ||
| 712 | + int64 delay, // microseconds | ||
| 713 | + Bool periodic, | ||
| 714 | + MXUserRecLock *lock); | ||
| 715 | + | ||
| 716 | +Bool Poll_CB_RTimeRemove(PollerFunction f, | ||
| 717 | + void *clientData, | ||
| 718 | + Bool periodic); | ||
| 719 | + | ||
| 720 | + | ||
| 721 | +#ifdef _WIN32 | ||
| 722 | +void Poll_SetPumpsWindowsMessages(Bool pumps); | ||
| 723 | +void Poll_SetWindowMessageRecipient(HWND hWnd, UINT msg, Bool alwaysThunk); | ||
| 724 | +Bool Poll_FireWndCallback(void *lparam); | ||
| 725 | +#endif | ||
| 726 | + | ||
| 727 | +#if defined(__cplusplus) | ||
| 728 | +} // extern "C" | ||
| 729 | +#endif | ||
| 730 | + | ||
| 731 | +#endif // _POLL_H_ | ||
| 732 | --- a/open-vm-tools/lib/rpcIn/rpcin.c | ||
| 733 | +++ b/open-vm-tools/lib/rpcIn/rpcin.c | ||
| 734 | @@ -57,7 +57,7 @@ | ||
| 735 | |||
| 736 | #if defined(VMTOOLS_USE_VSOCKET) | ||
| 737 | # include <glib.h> | ||
| 738 | -# include "poll.h" | ||
| 739 | +# include "vm_poll.h" | ||
| 740 | # include "asyncsocket.h" | ||
| 741 | # include "vmci_defs.h" | ||
| 742 | #include "dataMap.h" | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch new file mode 100644 index 0000000000..784b4fc6c5 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From e86a259e1ce19c70ecfdece69ab53a07c63a34e1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 13 Jun 2018 23:16:53 -0700 | ||
| 4 | Subject: [PATCH] use posix strerror_r unless on gnu libc system | ||
| 5 | |||
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 7 | --- | ||
| 8 | open-vm-tools/lib/err/errPosix.c | 9 ++++++--- | ||
| 9 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c | ||
| 12 | index c81b4c13..7a403640 100644 | ||
| 13 | --- a/open-vm-tools/lib/err/errPosix.c | ||
| 14 | +++ b/open-vm-tools/lib/err/errPosix.c | ||
| 15 | @@ -31,6 +31,7 @@ | ||
| 16 | #include <errno.h> | ||
| 17 | #include <string.h> | ||
| 18 | #include <locale.h> | ||
| 19 | +#include <stdio.h> | ||
| 20 | |||
| 21 | #include "vmware.h" | ||
| 22 | #include "errInt.h" | ||
| 23 | @@ -63,11 +64,13 @@ ErrErrno2String(Err_Number errorNumber, // IN | ||
| 24 | { | ||
| 25 | char *p; | ||
| 26 | |||
| 27 | -#if defined(__linux__) && !defined(__ANDROID__) | ||
| 28 | +#if defined(__GLIBC__) && !defined(__ANDROID__) | ||
| 29 | p = strerror_r(errorNumber, buf, bufSize); | ||
| 30 | #else | ||
| 31 | - p = strerror(errorNumber); | ||
| 32 | -#endif | ||
| 33 | + if (strerror_r(errorNumber, buf, bufSize) != 0) | ||
| 34 | + snprintf(buf, bufSize, "unknown error %i", errorNumber); | ||
| 35 | + p = buf; | ||
| 36 | +#endif /* defined __GLIBC__ */ | ||
| 37 | ASSERT(p != NULL); | ||
| 38 | return p; | ||
| 39 | } | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch new file mode 100644 index 0000000000..0a1d008733 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-uintmax_t-for-handling-rlim_t.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From 18eea61a7a768c6c3b57c6683c7bef7049f0f6ab Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 13 Jun 2018 23:37:09 -0700 | ||
| 4 | Subject: [PATCH] Use uintmax_t for handling rlim_t | ||
| 5 | |||
| 6 | rlimit types are not representable with long or long long | ||
| 7 | formats, therefore use uintmax_t to typecast rlim_t types | ||
| 8 | and use %j to print it | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 16 | index 0e6351a9..a2ee1740 100644 | ||
| 17 | --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 18 | +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | ||
| 19 | @@ -5294,8 +5294,8 @@ HgfsWriteCheckIORange(off_t offset, // IN: | ||
| 20 | goto exit; | ||
| 21 | } | ||
| 22 | |||
| 23 | - LOG(6, ("%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", | ||
| 24 | - __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max)); | ||
| 25 | + LOG(6, ("%s: File Size limits: 0x%jx 0x%jx\n", | ||
| 26 | + __FUNCTION__, (uintmax_t)fileSize.rlim_cur, (uintmax_t)fileSize.rlim_max)); | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Check the offset is within the file size range. | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch new file mode 100644 index 0000000000..d69b74e23a --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-Use-off64_t-instead-of-__off64_t.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 123c690f12f560022305b0cf19499e7f81a690ae Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 27 Aug 2018 23:22:21 -0700 | ||
| 4 | Subject: [PATCH] Use off64_t instead of __off64_t | ||
| 5 | |||
| 6 | Fixes | ||
| 7 | unknown type name '__off64_t' | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | open-vm-tools/lib/file/fileIOPosix.c | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c | ||
| 16 | index 23108279..bcd2ddc5 100644 | ||
| 17 | --- a/open-vm-tools/lib/file/fileIOPosix.c | ||
| 18 | +++ b/open-vm-tools/lib/file/fileIOPosix.c | ||
| 19 | @@ -206,10 +206,10 @@ static AlignedPool alignedPool; | ||
| 20 | * the symbols (and anyone building XOPEN<700 gets nothing). | ||
| 21 | */ | ||
| 22 | extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, | ||
| 23 | - __off64_t offset) __attribute__ ((weak)); | ||
| 24 | + off64_t offset) __attribute__ ((weak)); | ||
| 25 | |||
| 26 | extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, | ||
| 27 | - __off64_t offset) __attribute__ ((weak)); | ||
| 28 | + off64_t offset) __attribute__ ((weak)); | ||
| 29 | #else | ||
| 30 | #error "Large file support unavailable. Aborting." | ||
| 31 | #endif | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch new file mode 100644 index 0000000000..3e4753b2a6 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-misc-Do-not-print-NULL-string-into-logs.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | From cfc6839362bd96bf2f42954160f16a60bf1de377 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 22 Dec 2018 19:59:02 -0800 | ||
| 4 | Subject: [PATCH] misc: Do not print NULL string into logs | ||
| 5 | |||
| 6 | string format %s is getting a NULL pointer for 'expand' | ||
| 7 | parameter always since the check for chunks[i] == NULL will ensure that | ||
| 8 | its always null when the Log() API is called | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/312] | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | open-vm-tools/lib/misc/util_misc.c | 4 ++-- | ||
| 15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | --- a/open-vm-tools/lib/misc/util_misc.c | ||
| 18 | +++ b/open-vm-tools/lib/misc/util_misc.c | ||
| 19 | @@ -719,7 +719,7 @@ Util_ExpandString(const char *fileName) | ||
| 20 | ASSERT(!freeChunk[i]); | ||
| 21 | chunks[i] = expand; | ||
| 22 | if (chunks[i] == NULL) { | ||
| 23 | - Log("%s: Cannot allocate memory to expand $ in \"%s\".\n", | ||
| 24 | + Log("%s: Cannot allocate memory to expand in \"%s\".\n", | ||
| 25 | __FUNCTION__, fileName); | ||
| 26 | goto out; | ||
| 27 | } | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/tools.conf b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/tools.conf new file mode 100644 index 0000000000..f6cae70cc5 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/tools.conf | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | [guestinfo] | ||
| 2 | disable-perf-mon=1 | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.init b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.init new file mode 100644 index 0000000000..38280464a7 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.init | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # vmtoolsd Start/stop the vmware tools daemon | ||
| 4 | # | ||
| 5 | # chkconfig: 2345 90 60 | ||
| 6 | # description: vmtoolsd is a daemon that starts up. for some reason, it | ||
| 7 | # doesn't include a sysv init startup file in the latest release. | ||
| 8 | # so i have to write this | ||
| 9 | # | ||
| 10 | |||
| 11 | ### BEGIN INIT INFO | ||
| 12 | # Provides: vmtoolsd | ||
| 13 | # Required-Start: $local_fs $syslog | ||
| 14 | # Required-Stop: $local_fs $syslog | ||
| 15 | # Default-Start: 2345 | ||
| 16 | # Default-Stop: 90 | ||
| 17 | # Short-Description: Run vmware tools daemon | ||
| 18 | ### END INIT INFO | ||
| 19 | |||
| 20 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
| 21 | DAEMON=/usr/bin/vmtoolsd | ||
| 22 | NAME=vmtoolsd | ||
| 23 | DESC="vmware tools daemon" | ||
| 24 | VMTOOLSDARGS=" -b /var/run/vmtoolsd.pid " | ||
| 25 | RETVAL="1" | ||
| 26 | |||
| 27 | # source function library | ||
| 28 | . /etc/init.d/functions | ||
| 29 | |||
| 30 | test -f $DAEMON || exit 0 | ||
| 31 | |||
| 32 | |||
| 33 | case "$1" in | ||
| 34 | start) | ||
| 35 | echo -n "Starting vmware tools daemon: " | ||
| 36 | start-stop-daemon --start --quiet --exec $DAEMON -- $VMTOOLSDARGS | ||
| 37 | RETVAL=$? | ||
| 38 | if [ $RETVAL -eq 0 ] ; then | ||
| 39 | echo "OK" | ||
| 40 | else | ||
| 41 | echo "FAIL" | ||
| 42 | fi | ||
| 43 | ;; | ||
| 44 | stop) | ||
| 45 | echo -n "Stopping vmware tools daemon: " | ||
| 46 | start-stop-daemon --stop --quiet --pidfile /var/run/vmtoolsd.pid | ||
| 47 | RETVAL=$? | ||
| 48 | if [ $RETVAL -eq 0 ] ; then | ||
| 49 | echo "OK" | ||
| 50 | else | ||
| 51 | echo "FAIL" | ||
| 52 | fi | ||
| 53 | ;; | ||
| 54 | status) | ||
| 55 | status vmtoolsd | ||
| 56 | exit $? | ||
| 57 | ;; | ||
| 58 | restart) | ||
| 59 | $0 stop && sleep 1 && $0 start | ||
| 60 | ;; | ||
| 61 | *) | ||
| 62 | echo "Usage: /etc/init.d/vmtoolsd {start|stop|status|restart}" | ||
| 63 | exit 1 | ||
| 64 | esac | ||
| 65 | |||
| 66 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.service b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.service new file mode 100644 index 0000000000..d30e38055c --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/vmtoolsd.service | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=Open Virtual Machine Tools (VMware Tools) | ||
| 3 | ConditionVirtualization=vmware | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | ExecStart=/usr/bin/vmtoolsd | ||
| 7 | Restart=on-failure | ||
| 8 | KillSignal=SIGKILL | ||
| 9 | |||
| 10 | [Install] | ||
| 11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb new file mode 100644 index 0000000000..832fab1eac --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_11.0.1.bb | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | # This recipe is modified from the recipe originally found in the Open-Switch | ||
| 2 | # repository: | ||
| 3 | # | ||
| 4 | # https://github.com/open-switch/ops-build | ||
| 5 | # yocto/openswitch/meta-foss-openswitch/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.0.5.bb | ||
| 6 | # Commit 9008de2d8e100f3f868c66765742bca9fa98f3f9 | ||
| 7 | # | ||
| 8 | # The recipe packaging has been relicensed under the MIT license for inclusion | ||
| 9 | # in meta-openembedded by agreement of the author (Diego Dompe). | ||
| 10 | # | ||
| 11 | |||
| 12 | SUMMARY = "Tools to enhance VMWare guest integration and performance" | ||
| 13 | HOMEPAGE = "https://github.com/vmware/open-vm-tools" | ||
| 14 | SECTION = "vmware-tools" | ||
| 15 | |||
| 16 | LICENSE = "LGPL-2.0 & GPL-2.0 & BSD & CDDL-1.0" | ||
| 17 | LIC_FILES_CHKSUM = "file://LICENSE;md5=559317809c5444fb39ceaf6ac45c43ac" | ||
| 18 | LICENSE_modules/freebsd/vmblock = "BSD" | ||
| 19 | LICENSE_modules/freebsd/vmmemctl = "GPL-2.0" | ||
| 20 | LICENSE_modules/freebsd/vmxnet = "GPL-2.0" | ||
| 21 | LICENSE_modules/linux = "GPL-2.0" | ||
| 22 | LICENSE_modules/solaris = "CDDL-1.0" | ||
| 23 | |||
| 24 | SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \ | ||
| 25 | file://tools.conf \ | ||
| 26 | file://vmtoolsd.service \ | ||
| 27 | file://vmtoolsd.init \ | ||
| 28 | file://0001-configure.ac-don-t-use-dnet-config.patch;patchdir=.. \ | ||
| 29 | file://0002-add-include-sys-sysmacros.h.patch;patchdir=.. \ | ||
| 30 | file://0003-Use-configure-test-for-struct-timespec.patch;patchdir=.. \ | ||
| 31 | file://0004-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch;patchdir=.. \ | ||
| 32 | file://0005-Use-configure-to-test-for-feature-instead-of-platfor.patch;patchdir=.. \ | ||
| 33 | file://0006-Use-configure-test-for-sys-stat.h-include.patch;patchdir=.. \ | ||
| 34 | file://0007-Fix-subdir-objects-configure-error.patch;patchdir=.. \ | ||
| 35 | file://0008-include-poll.h-instead-of-sys-poll.h.patch;patchdir=.. \ | ||
| 36 | file://0009-Rename-poll.h-to-vm_poll.h.patch;patchdir=.. \ | ||
| 37 | file://0010-use-posix-strerror_r-unless-on-gnu-libc-system.patch;patchdir=.. \ | ||
| 38 | file://0011-Use-uintmax_t-for-handling-rlim_t.patch;patchdir=.. \ | ||
| 39 | file://0012-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \ | ||
| 40 | file://0013-misc-Do-not-print-NULL-string-into-logs.patch;patchdir=.. \ | ||
| 41 | file://0001-GitHub-Issue-367.-Remove-references-to-deprecated-G_.patch;patchdir=.. \ | ||
| 42 | file://0001-Make-HgfsConvertFromNtTimeNsec-aware-of-64-bit-time_.patch;patchdir=.. \ | ||
| 43 | file://0002-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \ | ||
| 44 | file://0001-utilBacktrace-Ignore-Warray-bounds.patch;patchdir=.. \ | ||
| 45 | file://0001-hgfsmounter-Makefile.am-support-usrmerge.patch;patchdir=.. \ | ||
| 46 | file://0001-pollGtk-Drop-volatile-qualifier.patch;patchdir=.. \ | ||
| 47 | " | ||
| 48 | |||
| 49 | SRCREV = "d3edfd142a81096f9f58aff17d84219b457f4987" | ||
| 50 | |||
| 51 | S = "${WORKDIR}/git/open-vm-tools" | ||
| 52 | |||
| 53 | DEPENDS = "glib-2.0 glib-2.0-native util-linux libdnet procps libtirpc" | ||
| 54 | |||
| 55 | # open-vm-tools is supported only on x86. | ||
| 56 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' | ||
| 57 | |||
| 58 | inherit autotools pkgconfig systemd update-rc.d | ||
| 59 | |||
| 60 | SYSTEMD_SERVICE_${PN} = "vmtoolsd.service" | ||
| 61 | |||
| 62 | EXTRA_OECONF = "--without-icu --disable-multimon --disable-docs \ | ||
| 63 | --disable-tests --without-gtkmm --without-xerces --without-pam \ | ||
| 64 | --disable-vgauth --disable-deploypkg \ | ||
| 65 | --without-root-privileges --without-kernel-modules --with-tirpc \ | ||
| 66 | --with-udev-rules-dir=${nonarch_base_libdir}/udev/rules.d" | ||
| 67 | |||
| 68 | NO_X11_FLAGS = "--without-x --without-gtk2 --without-gtk3" | ||
| 69 | X11_DEPENDS = "libxext libxi libxrender libxrandr libxtst gtk+ gdk-pixbuf" | ||
| 70 | PACKAGECONFIG[x11] = ",${NO_X11_FLAGS},${X11_DEPENDS}" | ||
| 71 | |||
| 72 | # fuse gets implicitly detected; there is no --without-fuse option. | ||
| 73 | PACKAGECONFIG[fuse] = ",,fuse" | ||
| 74 | |||
| 75 | CFLAGS_append_toolchain-clang = " -Wno-address-of-packed-member" | ||
| 76 | FILES_${PN} += "\ | ||
| 77 | ${libdir}/open-vm-tools/plugins/vmsvc/lib*.so \ | ||
| 78 | ${libdir}/open-vm-tools/plugins/common/lib*.so \ | ||
| 79 | ${sysconfdir}/vmware-tools/tools.conf \ | ||
| 80 | " | ||
| 81 | FILES_${PN}-locale += "${datadir}/open-vm-tools/messages" | ||
| 82 | FILES_${PN}-dev += "${libdir}/open-vm-tools/plugins/common/lib*.la" | ||
| 83 | |||
| 84 | CONFFILES_${PN} += "${sysconfdir}/vmware-tools/tools.conf" | ||
| 85 | |||
| 86 | RDEPENDS_${PN} = "util-linux libdnet fuse" | ||
| 87 | |||
| 88 | do_install_append() { | ||
| 89 | if ! ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','true','false',d)}; then | ||
| 90 | install -d ${D}/sbin | ||
| 91 | ln -sf ${sbindir}/mount.vmhgfs ${D}/sbin/mount.vmhgfs | ||
| 92 | fi | ||
| 93 | install -d ${D}${sysconfdir}/vmware-tools | ||
| 94 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
| 95 | install -d ${D}${systemd_unitdir}/system | ||
| 96 | install -m 644 ${WORKDIR}/*.service ${D}${systemd_unitdir}/system | ||
| 97 | else | ||
| 98 | install -d ${D}${sysconfdir}/init.d | ||
| 99 | install -m 0755 ${WORKDIR}/vmtoolsd.init ${D}${sysconfdir}/init.d/vmtoolsd | ||
| 100 | fi | ||
| 101 | install -m 0644 ${WORKDIR}/tools.conf ${D}${sysconfdir}/vmware-tools/tools.conf | ||
| 102 | } | ||
| 103 | |||
| 104 | do_configure_prepend() { | ||
| 105 | export CUSTOM_DNET_NAME=dnet | ||
| 106 | export CUSTOM_DNET_LIBS=-L${STAGING_LIBDIR}/libdnet.so | ||
| 107 | } | ||
| 108 | |||
| 109 | INITSCRIPT_PACKAGES = "${PN}" | ||
| 110 | INITSCRIPT_NAME_${PN} = "vmtoolsd" | ||
| 111 | INITSCRIPT_PARAMS_${PN} = "start 90 2 3 4 5 . stop 60 0 1 6 ." | ||
| 112 | |||
| 113 | python() { | ||
| 114 | if 'filesystems-layer' not in d.getVar('BBFILE_COLLECTIONS').split(): | ||
| 115 | raise bb.parse.SkipRecipe('Requires meta-filesystems to be present to provide fuse.') | ||
| 116 | } | ||
