diff options
Diffstat (limited to 'meta-networking/recipes-support/open-vm-tools')
19 files changed, 1039 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Add-resolv_compat.h-for-musl-builds.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Add-resolv_compat.h-for-musl-builds.patch new file mode 100644 index 0000000000..96270f860b --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0001-Add-resolv_compat.h-for-musl-builds.patch @@ -0,0 +1,72 @@ +From 148aadcc1b61da6f6b9ee4bcd35c38b7fbaeb8a8 Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin <trevor.gamblin@windriver.com> +Date: Wed, 14 Apr 2021 10:24:52 -0400 +Subject: [PATCH] Add resolv_compat.h for musl builds + +musl doesn't implement res_ninit, so it needs to be defined +independently for musl builds. This patch is based on the one at +https://gitweb.gentoo.org/proj/musl.git/tree/dev-qt/qtwebengine/files/qtwebengine-5.7.0-musl-resolver.patch?id=7f4100326793d55d45d0f5bb6178827ce6173513 + +Upstream-Status: Pending + +Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> +--- + open-vm-tools/lib/nicInfo/nicInfoPosix.c | 4 +++ + open-vm-tools/lib/nicInfo/resolv_compat.h | 30 +++++++++++++++++++++++ + 2 files changed, 34 insertions(+) + create mode 100644 open-vm-tools/lib/nicInfo/resolv_compat.h + +diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +index 6f20547b2..f5064a9c0 100644 +--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c ++++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +@@ -70,6 +70,10 @@ + # include <net/if.h> + #endif + ++#if !defined(__GLIBC__) ++#include "resolv_compat.h" ++#endif ++ + /* + * resolver(3) and IPv6: + * +diff --git a/open-vm-tools/lib/nicInfo/resolv_compat.h b/open-vm-tools/lib/nicInfo/resolv_compat.h +new file mode 100644 +index 000000000..d768464b9 +--- /dev/null ++++ b/open-vm-tools/lib/nicInfo/resolv_compat.h +@@ -0,0 +1,30 @@ ++#if !defined(__GLIBC__) ++/*************************************************************************** ++ * resolv_compat.h ++ * ++ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc ++ * Note: res_init() is actually deprecated according to ++ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html ++ **************************************************************************/ ++#include <string.h> ++ ++static inline int res_ninit(res_state statp) ++{ ++ int rc = res_init(); ++ if (statp != &_res) { ++ memcpy(statp, &_res, sizeof(*statp)); ++ } ++ return rc; ++} ++ ++static inline int res_nclose(res_state statp) ++{ ++ if (!statp) ++ return -1; ++ if (statp != &_res) { ++ memset(statp, 0, sizeof(*statp)); ++ } ++ return 0; ++} ++#endif ++ +-- +2.25.1 + 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..69c8253117 --- /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,41 @@ +From 547d05ca417c6b75ad06bf3119e1df8869742a70 Mon Sep 17 00:00:00 2001 +From: Martin Kelly <mkelly@xevo.com> +Date: Fri, 7 Apr 2017 15:20:30 -0700 +Subject: [PATCH] configure.ac: don't use dnet-config + +The dnet-config tool doesn't know about cross-compilation, so it injects +-I/usr/include into the path, causing compiler errors. So instead find dnet via +-ldnet. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Martin Kelly <mkelly@xevo.com> +--- + open-vm-tools/configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 26bfdb682..9e2a1d6e3 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -1227,7 +1227,7 @@ if test "$with_dnet" = "yes"; then + AC_VMW_CHECK_LIB([dnet], + [DNET], + [], +- [dnet-config], ++ [], + [], + [dnet.h], + [intf_open], +@@ -1237,7 +1237,7 @@ if test "$with_dnet" = "yes"; then + + if test $have_dnet = "no"; then + AC_MSG_ERROR( +- [dnet-config was not found on your PATH. Please configure without dnet or install dnet - http://libdnet.sourceforge.net]) ++ [dnet was not found. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net]) + fi + fi + +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-Use-configure-test-for-struct-timespec.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-Use-configure-test-for-struct-timespec.patch new file mode 100644 index 0000000000..1029252c76 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0002-Use-configure-test-for-struct-timespec.patch @@ -0,0 +1,50 @@ +From 74ab6b05fcba32031255624a31676e2aa0db133f Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 18 Nov 2015 09:03:00 +0000 +Subject: [PATCH] Use configure test for struct timespec + +Use the configure script to test for struct time spec instead of trying +to keep track of what platforms has it. + +Upstream-Status: Pending + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +--- + open-vm-tools/configure.ac | 1 + + open-vm-tools/lib/include/hgfsUtil.h | 8 +------- + 2 files changed, 2 insertions(+), 7 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 9e2a1d6e3..2f34f6eda 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -1441,6 +1441,7 @@ AC_TYPE_OFF_T + AC_TYPE_PID_T + AC_TYPE_SIZE_T + AC_CHECK_MEMBERS([struct stat.st_rdev]) ++AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include <time.h>]]) + AC_HEADER_TIME + AC_STRUCT_TM + AC_C_VOLATILE +diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h +index 609f4c000..a3a022d42 100644 +--- a/open-vm-tools/lib/include/hgfsUtil.h ++++ b/open-vm-tools/lib/include/hgfsUtil.h +@@ -53,13 +53,7 @@ + # include <time.h> + # endif + # include "vm_basic_types.h" +-# if !defined _STRUCT_TIMESPEC && \ +- !defined _TIMESPEC_DECLARED && \ +- !defined __timespec_defined && \ +- !defined sun && \ +- !defined __FreeBSD__ && \ +- !__APPLE__ && \ +- !defined _WIN32 ++# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC + struct timespec { + time_t tv_sec; + long tv_nsec; +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch new file mode 100644 index 0000000000..b4bd646d61 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0003-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch @@ -0,0 +1,63 @@ +From ef466581b53a1e64f53d4839bdacfab1d65cc6b9 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 18 Nov 2015 09:10:14 +0000 +Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS + +The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so +assume it is not there instead of testing for specific implementations. + +This is needed for musl libc. + +Upstream-Status: Pending + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +--- + open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 8 +++++--- + open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +index 4a0bc9378..6ed49e2b7 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +@@ -105,11 +105,13 @@ typedef struct DirectoryEntry { + #endif + + /* +- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the +- * Solaris version of <sys/stat.h>. ++ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in ++ * POSIX. + */ +-#ifdef sun ++#ifndef ACCESSPERMS + # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ++#endif ++#ifndef ALLPERMS + # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) + #endif + +diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +index 219065f74..b5b7e6203 100644 +--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c ++++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c +@@ -53,7 +53,7 @@ + + #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #define DND_STAGINGDIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) +-#ifdef sun ++#ifndef ACCESSPERMS + #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #endif + #ifdef __ANDROID__ +@@ -62,7 +62,6 @@ + */ + #define NO_SETMNTENT + #define NO_ENDMNTENT +-#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) + #endif + + +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Use-configure-to-test-for-feature-instead-of-platfor.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Use-configure-to-test-for-feature-instead-of-platfor.patch new file mode 100644 index 0000000000..f23235e902 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0004-Use-configure-to-test-for-feature-instead-of-platfor.patch @@ -0,0 +1,144 @@ +From 4462efefdd61bff1e39e946b917b01433898be88 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 18 Nov 2015 10:05:07 +0000 +Subject: [PATCH] Use configure to test for feature instead of platform + +Test for various functions instead of trying to keep track of what +platform and what version of the given platform has support for what. + +This should make it easier to port to currently unknown platforms and +will solve the issue if a platform add support for a missing feature in +the future. + +The features we test for are: +- getifaddrs +- getauxval +- issetugid +- __secure_getenv + +This is needed for musl libc. + +Upstream-Status: Pending + +Refit patch of open-vm-tools/lib/nicInfo/nicInfoPosix.c + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +Signed-off-by: Randy MacLeod <randy.macleod@windriver.com> +--- + open-vm-tools/configure.ac | 4 ++++ + open-vm-tools/lib/misc/idLinux.c | 30 +++++++++++------------- + open-vm-tools/lib/nicInfo/nicInfoPosix.c | 6 ++++- + 3 files changed, 23 insertions(+), 17 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index 2f34f6eda..daa0939c3 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -1169,6 +1169,7 @@ AC_CHECK_FUNCS( + + AC_CHECK_FUNCS([ecvt]) + AC_CHECK_FUNCS([fcvt]) ++AC_CHECK_FUNCS([getifaddrs getauxval issetugid __secure_getenv]) + + AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes]) + +@@ -1378,10 +1379,13 @@ fi + ### + + AC_CHECK_HEADERS([crypt.h]) ++AC_CHECK_HEADERS([ifaddrs.h]) + AC_CHECK_HEADERS([inttypes.h]) + AC_CHECK_HEADERS([stdint.h]) + AC_CHECK_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([wchar.h]) ++AC_CHECK_HEADERS([net/if.h]) ++AC_CHECK_HEADERS([sys/auxv.h]) + AC_CHECK_HEADERS([sys/inttypes.h]) + AC_CHECK_HEADERS([sys/io.h]) + AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD +diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c +index 3d7d1e303..0e12ac5bd 100644 +--- a/open-vm-tools/lib/misc/idLinux.c ++++ b/open-vm-tools/lib/misc/idLinux.c +@@ -27,12 +27,9 @@ + #include <sys/syscall.h> + #include <string.h> + #include <unistd.h> +-#ifdef __linux__ +-#if defined(__GLIBC__) && \ +- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) ++#ifdef HAVE_SYS_AUXV_H + #include <sys/auxv.h> + #endif +-#endif + #ifdef __APPLE__ + #include <sys/socket.h> + #include <TargetConditionals.h> +@@ -1025,24 +1022,23 @@ Id_EndSuperUser(uid_t uid) // IN: + static Bool + IdIsSetUGid(void) + { +-#if defined(__ANDROID__) +- /* Android does not have a secure_getenv, so be conservative. */ +- return TRUE; +-#else + /* + * We use __secure_getenv, which returns NULL if the binary is +- * setuid or setgid. Alternatives include, ++ * setuid or setgid, when issetugid or getauxval(AT_SECURE) is not ++ * available. Alternatives include, + * +- * a) getauxval(AT_SECURE); not available until glibc 2.16. +- * b) __libc_enable_secure; may not be exported. ++ * a) issetugid(); not (yet?) available in glibc. ++ * b) getauxval(AT_SECURE); not available until glibc 2.16. ++ * c) __libc_enable_secure; may not be exported. + * +- * Use (a) when we are based on glibc 2.16, or newer. ++ * Use (b) when we are based on glibc 2.16, or newer. + */ + +-#if defined(__GLIBC__) && \ +- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) ++#if HAVE_ISSETUGID ++ return issetugid(); ++#elif HAVE_GETAUXVAL + return getauxval(AT_SECURE) != 0; +-#else ++#elif HAVE___SECURE_GETENV + static const char envName[] = "VMW_SETUGID_TEST"; + + /* +@@ -1062,7 +1058,9 @@ IdIsSetUGid(void) + return secure_getenv(envName) == NULL; + } + return TRUE; +-#endif ++#else ++ /* Android does not have a secure_getenv, so be conservative. */ ++ return TRUE; + #endif + } + #endif +diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +index 0135e6a09..6f20547b2 100644 +--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c ++++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c +@@ -35,9 +35,13 @@ + #include <sys/stat.h> + #include <errno.h> + #include <limits.h> +-#if defined(__FreeBSD__) || defined(__APPLE__) ++#if HAVE_SYS_SYSCTL_H + # include <sys/sysctl.h> ++#endif ++#if HAVE_IFADDRS_H + # include <ifaddrs.h> ++#endif ++#if HAVE_NET_IF_H + # include <net/if.h> + #endif + #ifndef NO_DNET +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-sys-stat.h-include.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-sys-stat.h-include.patch new file mode 100644 index 0000000000..fda4c37e59 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0005-Use-configure-test-for-sys-stat.h-include.patch @@ -0,0 +1,30 @@ +From 79675399124b61f4e3da1f64f4b265f83dd26cdc Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 18 Nov 2015 10:41:01 +0000 +Subject: [PATCH] Use configure test for sys/stat.h include + +This is needed for musl libc. + +Upstream-Status: Pending + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +--- + open-vm-tools/services/plugins/vix/vixTools.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c +index 75d24a29e..d11c42178 100644 +--- a/open-vm-tools/services/plugins/vix/vixTools.c ++++ b/open-vm-tools/services/plugins/vix/vixTools.c +@@ -66,7 +66,7 @@ + #include <unistd.h> + #endif + +-#if defined(sun) || defined(__FreeBSD__) || defined(__APPLE__) ++#ifdef HAVE_SYS_STAT_H + #include <sys/stat.h> + #endif + +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-subdir-objects-configure-error.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-subdir-objects-configure-error.patch new file mode 100644 index 0000000000..4c6f6ce022 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0006-Fix-subdir-objects-configure-error.patch @@ -0,0 +1,38 @@ +From 37ad9845b5b8ab7170a2aaba31a505b2a36ba0f8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Jun 2018 23:48:04 -0700 +Subject: [PATCH] Fix subdir objects configure error + +Fix build on musl while here + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/configure.ac | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac +index daa0939c3..497e9459a 100644 +--- a/open-vm-tools/configure.ac ++++ b/open-vm-tools/configure.ac +@@ -326,7 +326,6 @@ AC_ARG_ENABLE( + [], + [enable_resolutionkms="auto"]) + +- + AC_ARG_ENABLE( + vmwgfxctrl, + AS_HELP_STRING( +@@ -335,7 +334,7 @@ AC_ARG_ENABLE( + [], + [enable_vmwgfxctrl="auto"]) + +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([subdir-objects]) + + ### + ### Constants +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-include-poll.h-instead-of-sys-poll.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-include-poll.h-instead-of-sys-poll.h.patch new file mode 100644 index 0000000000..fc0ce961c2 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0007-include-poll.h-instead-of-sys-poll.h.patch @@ -0,0 +1,31 @@ +From d138b808a8b47a02a370b411149ef8ce7883ca6f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Jun 2018 23:02:50 -0700 +Subject: [PATCH] include poll.h instead of sys/poll.h + +including sys/poll.h is deprecated + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c +index 26aee553a..4f413db73 100644 +--- a/open-vm-tools/lib/asyncsocket/asyncsocket.c ++++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c +@@ -70,8 +70,8 @@ + #else + #include <stddef.h> + #include <ctype.h> ++#include <poll.h> + #include <sys/types.h> +-#include <sys/poll.h> + #include <sys/socket.h> + #include <sys/un.h> + #include <netdb.h> +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-Rename-poll.h-to-vm_poll.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-Rename-poll.h-to-vm_poll.h.patch new file mode 100644 index 0000000000..2654767099 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0008-Rename-poll.h-to-vm_poll.h.patch @@ -0,0 +1,114 @@ +From e86d7b309bdf5b7c6c38faeded157e220d4ccc78 Mon Sep 17 00:00:00 2001 +From: Randy MacLeod <Randy.MacLeod@windriver.com> +Date: Wed, 24 Mar 2021 16:21:35 -0400 +Subject: [PATCH] Rename poll.h to vm_poll.h + +Rename poll.h to vm_poll.h and switch from: + #include <sys/poll.h> +to + #include <poll.h> + +musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this +we rename poll.h to vm_poll.h. + +Update for open-vm-tools-11.2.5. + +Upstream-Status: Pending + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> +--- + open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- + open-vm-tools/lib/hgfsServer/hgfsServer.c | 2 +- + open-vm-tools/lib/include/asyncsocket.h | 2 +- + open-vm-tools/lib/include/pollImpl.h | 2 +- + open-vm-tools/lib/include/{poll.h => vm_poll.h} | 2 +- + open-vm-tools/lib/rpcIn/rpcin.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (99%) + +diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c +index 4f413db73..684008d34 100644 +--- a/open-vm-tools/lib/asyncsocket/asyncsocket.c ++++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c +@@ -87,7 +87,7 @@ + #include "random.h" + #include "asyncsocket.h" + #include "asyncSocketBase.h" +-#include "poll.h" ++#include "vm_poll.h" + #include "log.h" + #include "err.h" + #include "hostinfo.h" +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c +index c7b4cdd0f..d6e0cdc0e 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServer.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c +@@ -51,7 +51,7 @@ + #include "hgfsDirNotify.h" + #include "hgfsThreadpool.h" + #include "userlock.h" +-#include "poll.h" ++#include "vm_poll.h" + #include "mutexRankLib.h" + #include "vm_basic_asm.h" + #include "unicodeOperations.h" +diff --git a/open-vm-tools/lib/include/asyncsocket.h b/open-vm-tools/lib/include/asyncsocket.h +index 09947002e..3800f5971 100644 +--- a/open-vm-tools/lib/include/asyncsocket.h ++++ b/open-vm-tools/lib/include/asyncsocket.h +@@ -177,7 +177,7 @@ typedef struct AsyncSocket AsyncSocket; + * Or the client can specify its favorite poll class and locking behavior. + * Use of IVmdbPoll is only supported for regular sockets and for Attach. + */ +-#include "poll.h" ++#include "vm_poll.h" + struct IVmdbPoll; + typedef struct AsyncSocketPollParams { + int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ +diff --git a/open-vm-tools/lib/include/pollImpl.h b/open-vm-tools/lib/include/pollImpl.h +index 46442e556..8bc669970 100644 +--- a/open-vm-tools/lib/include/pollImpl.h ++++ b/open-vm-tools/lib/include/pollImpl.h +@@ -44,7 +44,7 @@ + #define INCLUDE_ALLOW_USERLEVEL + #include "includeCheck.h" + +-#include "poll.h" ++#include "vm_poll.h" + #include "vm_basic_asm.h" + + #if defined(__cplusplus) +diff --git a/open-vm-tools/lib/include/poll.h b/open-vm-tools/lib/include/vm_poll.h +similarity index 99% +rename from open-vm-tools/lib/include/poll.h +rename to open-vm-tools/lib/include/vm_poll.h +index ade356b9f..8759fb960 100644 +--- a/open-vm-tools/lib/include/poll.h ++++ b/open-vm-tools/lib/include/vm_poll.h +@@ -60,7 +60,7 @@ extern "C" { + #if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 + #include <sys/kernel.h> + #endif +-#include <sys/poll.h> ++#include <poll.h> + #define HZ 100 + #endif + #ifdef __ANDROID__ +diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c +index f1709fe03..c1a5dfdba 100644 +--- a/open-vm-tools/lib/rpcIn/rpcin.c ++++ b/open-vm-tools/lib/rpcIn/rpcin.c +@@ -57,7 +57,7 @@ + + #if defined(VMTOOLS_USE_VSOCKET) + # include <glib.h> +-# include "poll.h" ++# include "vm_poll.h" + # include "asyncsocket.h" + # include "vmci_defs.h" + #include "dataMap.h" +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch new file mode 100644 index 0000000000..a6638adb9a --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch @@ -0,0 +1,44 @@ +From 666a043be7d6fe07a36599260f7214cbd29a79e7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Jun 2018 23:16:53 -0700 +Subject: [PATCH] use posix strerror_r unless on gnu libc system + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/lib/err/errPosix.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c +index c81b4c13f..7a4036402 100644 +--- a/open-vm-tools/lib/err/errPosix.c ++++ b/open-vm-tools/lib/err/errPosix.c +@@ -31,6 +31,7 @@ + #include <errno.h> + #include <string.h> + #include <locale.h> ++#include <stdio.h> + + #include "vmware.h" + #include "errInt.h" +@@ -63,11 +64,13 @@ ErrErrno2String(Err_Number errorNumber, // IN + { + char *p; + +-#if defined(__linux__) && !defined(__ANDROID__) ++#if defined(__GLIBC__) && !defined(__ANDROID__) + p = strerror_r(errorNumber, buf, bufSize); + #else +- p = strerror(errorNumber); +-#endif ++ if (strerror_r(errorNumber, buf, bufSize) != 0) ++ snprintf(buf, bufSize, "unknown error %i", errorNumber); ++ p = buf; ++#endif /* defined __GLIBC__ */ + ASSERT(p != NULL); + return p; + } +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-Use-uintmax_t-for-handling-rlim_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-Use-uintmax_t-for-handling-rlim_t.patch new file mode 100644 index 0000000000..6d0f8a3ae0 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0010-Use-uintmax_t-for-handling-rlim_t.patch @@ -0,0 +1,38 @@ +From b294005f3748c6caee002fd7588964f7bf9b1d09 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 24 Mar 2021 17:26:53 -0400 +Subject: [PATCH] Use uintmax_t for handling rlim_t + +rlimit types are not representable with long or long long +formats, therefore use uintmax_t to typecast rlim_t types +and use %j to print it + +Upstream-Status: Pending + +Refit patch for open-vm-tools-11.2.5. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> +Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> +--- + open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +index 6ed49e2b7..0cc7c4094 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +@@ -5294,8 +5294,8 @@ HgfsWriteCheckIORange(off_t offset, // IN: + goto exit; + } + +- LOG(6, "%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", +- __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max); ++ //LOG(6, ("%s: File Size limits: 0x%jx 0x%jx\n", ++ // __FUNCTION__, (uintmax_t)fileSize.rlim_cur, (uintmax_t)fileSize.rlim_max)); + + /* + * Check the offset is within the file size range. +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-off64_t-instead-of-__off64_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-off64_t-instead-of-__off64_t.patch new file mode 100644 index 0000000000..c6ab4d44d6 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0011-Use-off64_t-instead-of-__off64_t.patch @@ -0,0 +1,35 @@ +From a8ef33b0623ba3494594a040ff5c77771168fdd6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 27 Aug 2018 23:22:21 -0700 +Subject: [PATCH] Use off64_t instead of __off64_t + +Fixes +unknown type name '__off64_t' + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/lib/file/fileIOPosix.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c +index 492a4bf4a..a80a884cd 100644 +--- a/open-vm-tools/lib/file/fileIOPosix.c ++++ b/open-vm-tools/lib/file/fileIOPosix.c +@@ -211,10 +211,10 @@ static AlignedPool alignedPool; + * the symbols (and anyone building XOPEN<700 gets nothing). + */ + extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, +- __off64_t offset) __attribute__ ((weak)); ++ off64_t offset) __attribute__ ((weak)); + + extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, +- __off64_t offset) __attribute__ ((weak)); ++ off64_t offset) __attribute__ ((weak)); + #else + #error "Large file support is unavailable." + #endif +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch new file mode 100644 index 0000000000..388857fc10 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch @@ -0,0 +1,44 @@ +From 2904454f3408a3abe3f2b0681504a66ea5ce713c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 24 Mar 2021 17:36:26 -0400 +Subject: [PATCH] hgfsServerLinux: Consider 64bit time_t possibility + +Upstream-Status: Pending + +Refit for open-vm-tools-11.2.5. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> +Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> +--- + open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +index 0cc7c4094..445a53881 100644 +--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c ++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +@@ -2559,20 +2559,6 @@ HgfsStatToFileAttr(struct stat *stats, // IN: stat information + LOG(4, "%s: done, permissions %o%o%o%o, size %"FMT64"u\n", __FUNCTION__, + attr->specialPerms, attr->ownerPerms, attr->groupPerms, + attr->otherPerms, attr->size); +-#ifdef __FreeBSD__ +-# if !defined(VM_X86_64) && !defined(VM_ARM_64) +-# define FMTTIMET "" +-# else +-# define FMTTIMET "l" +-# endif +-#else +-# define FMTTIMET "l" +-#endif +- LOG(4, "access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n" +- "attr: %"FMTTIMET"d/%"FMT64"u\n", +- stats->st_atime, attr->accessTime, stats->st_mtime, attr->writeTime, +- stats->st_ctime, attr->attrChangeTime); +-#undef FMTTIMET + + attr->userId = stats->st_uid; + attr->groupId = stats->st_gid; +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-open-vm-tools-Correct-include-path-for-poll.h.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-open-vm-tools-Correct-include-path-for-poll.h.patch new file mode 100644 index 0000000000..f2f6893db0 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0013-open-vm-tools-Correct-include-path-for-poll.h.patch @@ -0,0 +1,37 @@ +From eae0a65a9d6c9df20d05b4208aee23656915480b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 7 Feb 2022 13:32:32 -0800 +Subject: [PATCH] open-vm-tools: Correct include path for poll.h + +sys/poll.h is deprecated and musl calls it out explicitly. + +Fixes +| In file included from ../../../../git/open-vm-tools/services/plugins/gdp/gdpPlugin.c:35: +| /mnt/b/yoe/master/build/tmp/work/core2-32-yoe-linux-musl/open-vm-tools/11.3.5-r0/recipe-sysroot/usr/include/sys/poll.h:1:2: error: redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings] +| #warning redirecting incorrect #include <sys/poll.h> to <poll.h> +| ^ +| 1 error generated. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/services/plugins/gdp/gdpPlugin.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/open-vm-tools/services/plugins/gdp/gdpPlugin.c b/open-vm-tools/services/plugins/gdp/gdpPlugin.c +index 96e6d717b..0b8a583b8 100644 +--- a/open-vm-tools/services/plugins/gdp/gdpPlugin.c ++++ b/open-vm-tools/services/plugins/gdp/gdpPlugin.c +@@ -32,7 +32,7 @@ + #include <sys/types.h> + #include <sys/socket.h> + #include <sys/eventfd.h> +-#include <sys/poll.h> ++#include <poll.h> + #include <unistd.h> + #endif + +-- +2.25.1 + diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0014-timeSync-Portable-way-to-print-64bit-time_t.patch b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0014-timeSync-Portable-way-to-print-64bit-time_t.patch new file mode 100644 index 0000000000..39eea767a0 --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools/0014-timeSync-Portable-way-to-print-64bit-time_t.patch @@ -0,0 +1,55 @@ +From 09cc01b2fa15e319afafa13d7365b399a60f443c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 3 Jan 2023 13:36:01 -0800 +Subject: [PATCH] timeSync: Portable way to print 64bit time_t + +This ensures when 64bit time_t is used on 32bit architectures ( +-D_TIME_BITS=64 ) then it can print it correctly as well. + +Fixes +pllLinux.c:43:20: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat] +| prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror, +| ^~~~~~~~~~ + +Upstream-Status: Submitted [https://github.com/vmware/open-vm-tools/pull/631] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + open-vm-tools/services/plugins/timeSync/pllLinux.c | 8 ++++---- + open-vm-tools/services/plugins/timeSync/slewLinux.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/open-vm-tools/services/plugins/timeSync/pllLinux.c b/open-vm-tools/services/plugins/timeSync/pllLinux.c +index e9c8e61de..90ba8c63f 100644 +--- a/open-vm-tools/services/plugins/timeSync/pllLinux.c ++++ b/open-vm-tools/services/plugins/timeSync/pllLinux.c +@@ -38,10 +38,10 @@ + static void + TimeSyncLogPLLState(const char *prefix, struct timex *tx) + { +- g_debug("%s : off %ld freq %ld maxerr %ld esterr %ld status %d " +- "const %ld precision %ld tolerance %ld tick %ld\n", +- prefix, tx->offset, tx->freq, tx->maxerror, tx->esterror, +- tx->status, tx->constant, tx->precision, tx->tolerance, tx->tick); ++ g_debug("%s : off %jd freq %jd maxerr %jd esterr %jd status %d " ++ "const %jd precision %jd tolerance %jd tick %jd\n", ++ prefix, (intmax_t)tx->offset, (intmax_t)tx->freq, (intmax_t)tx->maxerror, (intmax_t)tx->esterror, ++ tx->status, (intmax_t)tx->constant, (intmax_t)tx->precision, (intmax_t)tx->tolerance, (intmax_t)tx->tick); + } + + /* +diff --git a/open-vm-tools/services/plugins/timeSync/slewLinux.c b/open-vm-tools/services/plugins/timeSync/slewLinux.c +index 1ab6e3584..0c304b5d7 100644 +--- a/open-vm-tools/services/plugins/timeSync/slewLinux.c ++++ b/open-vm-tools/services/plugins/timeSync/slewLinux.c +@@ -156,6 +156,6 @@ TimeSync_Slew(int64 delta, + g_debug("adjtimex failed: %s\n", strerror(errno)); + return FALSE; + } +- g_debug("time slew start: %ld\n", tx.tick); ++ g_debug("time slew start: %jd\n", (intmax_t)tx.tick); + return TRUE; + } +-- +2.25.1 + 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 @@ +[guestinfo] +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 @@ +#!/bin/sh +# +# vmtoolsd Start/stop the vmware tools daemon +# +# chkconfig: 2345 90 60 +# description: vmtoolsd is a daemon that starts up. for some reason, it +# doesn't include a sysv init startup file in the latest release. +# so i have to write this +# + +### BEGIN INIT INFO +# Provides: vmtoolsd +# Required-Start: $local_fs $syslog +# Required-Stop: $local_fs $syslog +# Default-Start: 2345 +# Default-Stop: 90 +# Short-Description: Run vmware tools daemon +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/vmtoolsd +NAME=vmtoolsd +DESC="vmware tools daemon" +VMTOOLSDARGS=" -b /var/run/vmtoolsd.pid " +RETVAL="1" + +# source function library +. /etc/init.d/functions + +test -f $DAEMON || exit 0 + + +case "$1" in + start) + echo -n "Starting vmware tools daemon: " + start-stop-daemon --start --quiet --exec $DAEMON -- $VMTOOLSDARGS + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + stop) + echo -n "Stopping vmware tools daemon: " + start-stop-daemon --stop --quiet --pidfile /var/run/vmtoolsd.pid + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + status) + status vmtoolsd + exit $? + ;; + restart) + $0 stop && sleep 1 && $0 start + ;; + *) + echo "Usage: /etc/init.d/vmtoolsd {start|stop|status|restart}" + exit 1 +esac + +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 @@ +[Unit] +Description=Open Virtual Machine Tools (VMware Tools) +ConditionVirtualization=vmware + +[Service] +ExecStart=/usr/bin/vmtoolsd +Restart=on-failure +KillSignal=SIGKILL + +[Install] +WantedBy=multi-user.target diff --git a/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.3.5.bb b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.3.5.bb new file mode 100644 index 0000000000..7e3fe5601f --- /dev/null +++ b/meta-networking/recipes-support/open-vm-tools/open-vm-tools_12.3.5.bb @@ -0,0 +1,124 @@ +# This recipe is modified from the recipe originally found in the Open-Switch +# repository: +# +# https://github.com/open-switch/ops-build +# yocto/openswitch/meta-foss-openswitch/meta-oe/recipes-support/open-vm-tools/open-vm-tools_10.0.5.bb +# Commit 9008de2d8e100f3f868c66765742bca9fa98f3f9 +# +# The recipe packaging has been relicensed under the MIT license for inclusion +# in meta-openembedded by agreement of the author (Diego Dompe). +# + +SUMMARY = "Tools to enhance VMWare guest integration and performance" +HOMEPAGE = "https://github.com/vmware/open-vm-tools" +DESCRIPTION = "\ +open-vm-tools is a set of services and modules that enable several features in VMware products \ +for better management of and seamless user interactions with guests.\ +" +SECTION = "vmware-tools" + +LICENSE = "LGPL-2.0-only & GPL-2.0-only & BSD-2-Clause & CDDL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=559317809c5444fb39ceaf6ac45c43ac" +LICENSE:modules/freebsd/vmblock = "BSD-2-Clause" +LICENSE:modules/freebsd/vmmemctl = "GPL-2.0-only" +LICENSE:modules/freebsd/vmxnet = "GPL-2.0-only" +LICENSE:modules/linux = "GPL-2.0-only" +LICENSE:modules/solaris = "CDDL-1.0" + +SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https;branch=stable-12.3.x \ + file://tools.conf \ + file://vmtoolsd.service \ + file://vmtoolsd.init \ + file://0001-configure.ac-don-t-use-dnet-config.patch;patchdir=.. \ + file://0002-Use-configure-test-for-struct-timespec.patch;patchdir=.. \ + file://0003-Fix-definition-of-ALLPERMS-and-ACCESSPERMS.patch;patchdir=.. \ + file://0004-Use-configure-to-test-for-feature-instead-of-platfor.patch;patchdir=.. \ + file://0005-Use-configure-test-for-sys-stat.h-include.patch;patchdir=.. \ + file://0006-Fix-subdir-objects-configure-error.patch;patchdir=.. \ + file://0007-include-poll.h-instead-of-sys-poll.h.patch;patchdir=.. \ + file://0008-Rename-poll.h-to-vm_poll.h.patch;patchdir=.. \ + file://0009-use-posix-strerror_r-unless-on-gnu-libc-system.patch;patchdir=.. \ + file://0010-Use-uintmax_t-for-handling-rlim_t.patch;patchdir=.. \ + file://0011-Use-off64_t-instead-of-__off64_t.patch;patchdir=.. \ + file://0012-hgfsServerLinux-Consider-64bit-time_t-possibility.patch;patchdir=.. \ + file://0013-open-vm-tools-Correct-include-path-for-poll.h.patch;patchdir=.. \ + file://0014-timeSync-Portable-way-to-print-64bit-time_t.patch;patchdir=.. \ + " + +UPSTREAM_CHECK_GITTAGREGEX = "stable-(?P<pver>\d+(\.\d+)+)" + +SRC_URI:append:libc-musl = " file://0001-Add-resolv_compat.h-for-musl-builds.patch;patchdir=.. \ +" + +SRCREV = "1b362b9eb449fb5de3809aaea4a636ece30ee5b7" + +S = "${WORKDIR}/git/open-vm-tools" + +DEPENDS = "glib-2.0 glib-2.0-native util-linux libdnet procps libtirpc" + +# open-vm-tools is supported only on x86. +COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux' + +inherit autotools pkgconfig systemd update-rc.d + +SYSTEMD_SERVICE:${PN} = "vmtoolsd.service" + +EXTRA_OECONF = "--without-icu --disable-multimon --disable-docs \ + --disable-tests --without-gtkmm --without-xerces --without-pam \ + --disable-vgauth --disable-deploypkg --disable-containerinfo \ + --without-root-privileges --without-kernel-modules --with-tirpc \ + --with-udev-rules-dir=${nonarch_base_libdir}/udev/rules.d" + +NO_X11_FLAGS = "--without-x --without-gtk2 --without-gtk3" +X11_DEPENDS = "libxext libxi libxrender libxrandr libxtst gtk+ gdk-pixbuf" +PACKAGECONFIG[x11] = ",${NO_X11_FLAGS},${X11_DEPENDS}" + +# fuse gets implicitly detected; there is no --without-fuse option. +PACKAGECONFIG[fuse] = ",,fuse" + +CFLAGS:append:toolchain-clang = " -Wno-address-of-packed-member -Wno-error=unused-function" +FILES:${PN} += "\ + ${libdir}/open-vm-tools/plugins/vmsvc/lib*.so \ + ${libdir}/open-vm-tools/plugins/common/lib*.so \ + ${sysconfdir}/vmware-tools/tools.conf \ +" +FILES:${PN}-locale += "${datadir}/open-vm-tools/messages" +FILES:${PN}-dev += "${libdir}/open-vm-tools/plugins/common/lib*.la" + +CONFFILES:${PN} += "${sysconfdir}/vmware-tools/tools.conf" + +RDEPENDS:${PN} = "util-linux libdnet fuse" + +do_install:append() { + if ! ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','true','false',d)}; then + install -d ${D}/sbin + ln -sf ${sbindir}/mount.vmhgfs ${D}/sbin/mount.vmhgfs + fi + install -d ${D}${sysconfdir}/vmware-tools + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_unitdir}/system + install -m 644 ${UNPACKDIR}/*.service ${D}${systemd_unitdir}/system + else + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${UNPACKDIR}/vmtoolsd.init ${D}${sysconfdir}/init.d/vmtoolsd + fi + install -m 0644 ${UNPACKDIR}/tools.conf ${D}${sysconfdir}/vmware-tools/tools.conf +} + +do_configure:prepend() { + export CUSTOM_DNET_NAME=dnet + export CUSTOM_DNET_LIBS=-L${STAGING_LIBDIR}/libdnet.so +} + +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME:${PN} = "vmtoolsd" +INITSCRIPT_PARAMS:${PN} = "start 90 2 3 4 5 . stop 60 0 1 6 ." + +python() { + if 'filesystems-layer' not in d.getVar('BBFILE_COLLECTIONS').split(): + raise bb.parse.SkipRecipe('Requires meta-filesystems to be present to provide fuse.') +} + +CVE_PRODUCT = "open-vm-tools vmware:tools" +CVE_STATUS[CVE-2014-4199] = "fixed-version: No action required. The current version (12.3.5) is not affected by the CVE which affects version 10.0.3" +CVE_STATUS[CVE-2014-4200] = "fixed-version: No action required. The current version (12.3.5) is not affected by the CVE which affects version 10.0.3" |