diff mbox

[v7] openvmtools: new package

Message ID 1409674416-33961-1-git-send-email-kaszak@gmail.com
State Accepted
Headers show

Commit Message

Karoly Kasza Sept. 2, 2014, 4:13 p.m. UTC
New package: openvmtools

Signed-off-by: Karoly Kasza <kaszak@gmail.com>
---

Changes v6 -> v7:
  - PAM support now depends on BR2_PREFER_STATIC_LIB
  - LDFLAGS="-L$(TARGET_DIR)/usr/lib" removed from procps section
  - Reference to $(STAGING_DIR) removed from DNET section
  - Additional comments added

 package/Config.in                                  |    1 +
 package/openvmtools/Config.in                      |   61 +++++++++++++++
 package/openvmtools/S10vmtoolsd                    |   33 ++++++++
 .../openvmtools-01-has_bsd_printf.patch            |   26 +++++++
 .../openvmtools-02-network_script.patch            |   21 ++++++
 package/openvmtools/openvmtools.mk                 |   79 ++++++++++++++++++++
 package/openvmtools/shutdown                       |    7 ++
 package/openvmtools/vmtoolsd.service               |   14 ++++
 8 files changed, 242 insertions(+)
 create mode 100644 package/openvmtools/Config.in
 create mode 100644 package/openvmtools/S10vmtoolsd
 create mode 100644 package/openvmtools/openvmtools-01-has_bsd_printf.patch
 create mode 100644 package/openvmtools/openvmtools-02-network_script.patch
 create mode 100644 package/openvmtools/openvmtools.mk
 create mode 100644 package/openvmtools/shutdown
 create mode 100644 package/openvmtools/vmtoolsd.service

Comments

Karoly Kasza Sept. 8, 2014, 9:10 a.m. UTC | #1
Hello Yann, Thomas, List,

could you please verify the latest version of openvmtools package?
I think I was able to fit your comments.
Also, if you like the format of the S10vmtoolsd script, I will review the
other initscripts as proposed by you before.

Kind regards,
Karoly

On Tue, Sep 2, 2014 at 6:13 PM, Karoly Kasza <kaszak@gmail.com> wrote:

> New package: openvmtools
>
> Signed-off-by: Karoly Kasza <kaszak@gmail.com>
> ---
>
> Changes v6 -> v7:
>   - PAM support now depends on BR2_PREFER_STATIC_LIB
>   - LDFLAGS="-L$(TARGET_DIR)/usr/lib" removed from procps section
>   - Reference to $(STAGING_DIR) removed from DNET section
>   - Additional comments added
>
>  package/Config.in                                  |    1 +
>  package/openvmtools/Config.in                      |   61 +++++++++++++++
>  package/openvmtools/S10vmtoolsd                    |   33 ++++++++
>  .../openvmtools-01-has_bsd_printf.patch            |   26 +++++++
>  .../openvmtools-02-network_script.patch            |   21 ++++++
>  package/openvmtools/openvmtools.mk                 |   79
> ++++++++++++++++++++
>  package/openvmtools/shutdown                       |    7 ++
>  package/openvmtools/vmtoolsd.service               |   14 ++++
>  8 files changed, 242 insertions(+)
>  create mode 100644 package/openvmtools/Config.in
>  create mode 100644 package/openvmtools/S10vmtoolsd
>  create mode 100644 package/openvmtools/openvmtools-01-has_bsd_printf.patch
>  create mode 100644 package/openvmtools/openvmtools-02-network_script.patch
>  create mode 100644 package/openvmtools/openvmtools.mk
>  create mode 100644 package/openvmtools/shutdown
>  create mode 100644 package/openvmtools/vmtoolsd.service
>
> diff --git a/package/Config.in b/package/Config.in
> index 883dd66..374694b 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1171,6 +1171,7 @@ endif
>         source "package/ncdu/Config.in"
>         source "package/numactl/Config.in"
>         source "package/nut/Config.in"
> +       source "package/openvmtools/Config.in"
>         source "package/powerpc-utils/Config.in"
>         source "package/polkit/Config.in"
>  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> diff --git a/package/openvmtools/Config.in b/package/openvmtools/Config.in
> new file mode 100644
> index 0000000..319b653
> --- /dev/null
> +++ b/package/openvmtools/Config.in
> @@ -0,0 +1,61 @@
> +config BR2_PACKAGE_OPENVMTOOLS
> +       bool "openvmtools"
> +       depends on BR2_i386 || BR2_x86_64
> +       depends on BR2_USE_MMU # libglib2
> +       depends on BR2_USE_WCHAR # libglib2
> +       depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
> +       depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
> +       depends on BR2_LARGEFILE
> +       depends on BR2_ENABLE_LOCALE
> +       select BR2_PACKAGE_LIBGLIB2
> +       help
> +         Open Virtual Machine Tools for VMware guest OS
> +
> +         http://open-vm-tools.sourceforge.net/
> +
> +         ICU locales and X11 tools are currently not supported.
> +
> +         NOTE: Support for vmblock-fuse will be enabled in openvmtools if
> the
> +               libfuse package is selected.
> +
> +if BR2_PACKAGE_OPENVMTOOLS
> +
> +config BR2_PACKAGE_OPENVMTOOLS_PROCPS
> +       bool "procps support"
> +       depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> +       select BR2_PACKAGE_PROCPS_NG
> +       help
> +         Enable support for procps / meminfo
> +
> +comment "procps support needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS"
> +       depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> +
> +config BR2_PACKAGE_OPENVMTOOLS_DNET
> +       bool "dnet support"
> +       depends on BR2_INET_IPV6
> +       select BR2_PACKAGE_LIBDNET
> +       help
> +         Enable support for libdnet / nicinfo
> +
> +comment "dnet support needs a toolchain w/ IPv6"
> +       depends on !BR2_INET_IPV6
> +
> +config BR2_PACKAGE_OPENVMTOOLS_PAM
> +       bool "PAM support"
> +       select BR2_PACKAGE_LINUX_PAM
> +       # linux-pam needs locale and wchar, but we already have this
> +       # dependency on the main symbol, above.
> +       depends on !BR2_PREFER_STATIC_LIB
> +       help
> +         Support for PAM in openvmtools
> +
> +comment "PAM support needs a toolchain w/ dynamic library"
> +       depends on BR2_PREFER_STATIC_LIB
> +
> +endif
> +
> +comment "openvmtools needs a toolchain w/ wchar, threads, RPC, largefile,
> locale"
> +       depends on BR2_i386 || BR2_x86_64
> +       depends on BR2_USE_MMU
> +       depends on !BR2_USE_WCHAR ||!BR2_TOOLCHAIN_HAS_THREADS || \
> +       !BR2_TOOLCHAIN_HAS_NATIVE_RPC || !BR2_LARGEFILE ||
> !BR2_ENABLE_LOCALE
> diff --git a/package/openvmtools/S10vmtoolsd
> b/package/openvmtools/S10vmtoolsd
> new file mode 100644
> index 0000000..969ba93
> --- /dev/null
> +++ b/package/openvmtools/S10vmtoolsd
> @@ -0,0 +1,33 @@
> +#!/bin/sh
> +#
> +# Starts vmtoolsd for openvmtools
> +#
> +
> +EXEC="/usr/bin/vmtoolsd"
> +ARGS="-b"
> +PID="/var/run/vmtoolsd.pid"
> +
> +case "$1" in
> +  start)
> +    echo -n "Starting vmtoolsd: "
> +    start-stop-daemon -S -q -x $EXEC -- $ARGS $PID
> +    if [ $? != 0 ]; then
> +      echo "FAILED"
> +      exit 1
> +    else
> +      echo "OK"
> +    fi
> +  ;;
> +  stop)
> +    echo -n "Stopping vmtoolsd: "
> +    start-stop-daemon -K -q -p $PID
> +    echo "OK"
> +  ;;
> +  restart|reload)
> +    $0 stop
> +    $0 start
> +  ;;
> +  *)
> +    echo "Usage: $0 {start|stop|restart}"
> +    exit 1
> +esac
> diff --git a/package/openvmtools/openvmtools-01-has_bsd_printf.patch
> b/package/openvmtools/openvmtools-01-has_bsd_printf.patch
> new file mode 100644
> index 0000000..889f7d1
> --- /dev/null
> +++ b/package/openvmtools/openvmtools-01-has_bsd_printf.patch
> @@ -0,0 +1,26 @@
> +lib/misc/msgList.c: missing #ifdef
> +
> +This macro checks for BSD style printf(), which is not present
> +when compiling for uClibc. The linked functions are unnecessary in
> +this case, and they break compilation.
> +
> +Signed-off-by: Karoly Kasza <kaszak@gmail.com>
> +
> +--- open-vm-tools-9.4.6-1770165.orig/lib/misc/msgList.c        2014-07-02
> 00:21:14.000000000 +0200
> ++++ open-vm-tools-9.4.6-1770165/lib/misc/msgList.c     2014-07-29
> 13:40:40.000000000 +0200
> +@@ -487,6 +487,7 @@
> +    return messages->id;
> + }
> +
> ++#ifdef HAS_BSD_PRINTF
> +
> + /*
> +  *----------------------------------------------------------------------
> +@@ -566,6 +567,7 @@
> +    }
> + }
> +
> ++#endif
> +
> + /*
> +  *----------------------------------------------------------------------
> diff --git a/package/openvmtools/openvmtools-02-network_script.patch
> b/package/openvmtools/openvmtools-02-network_script.patch
> new file mode 100644
> index 0000000..67705cc
> --- /dev/null
> +++ b/package/openvmtools/openvmtools-02-network_script.patch
> @@ -0,0 +1,21 @@
> +scripts/linux/network: exit normally if no network control script
> +
> +When using suspend/resume from the hypervisor, openvmtools checks for the
> +networking script, and exists with an error if not found, making the
> hypervisor
> +raise a warning message. This workaround silences that error message.
> +
> +Signed-off-by: Karoly Kasza <kaszak@gmail.com>
> +
> +--- open-vm-tools-9.4.6-1770165.orig/scripts/linux/network     2014-07-02
> 00:21:14.000000000 +0200
> ++++ open-vm-tools-9.4.6-1770165/scripts/linux/network  2014-08-07
> 16:34:21.963514273 +0200
> +@@ -88,7 +88,9 @@
> + run_network_script()
> + {
> +    script=`find_networking_script`
> +-   [ "$script" != "error" ] || Panic "Cannot find system networking
> script."
> ++#   [ "$script" != "error" ] || Panic "Cannot find system networking
> script."
> ++# Modified for buildroot
> ++   [ "$script" != "error" ] || exit 0
> +
> +    # Using SysV "service" if it exists, otherwise fall back to run the
> script directly
> +    service=`which service 2>/dev/null`
> diff --git a/package/openvmtools/openvmtools.mk b/package/openvmtools/
> openvmtools.mk
> new file mode 100644
> index 0000000..6361d6b
> --- /dev/null
> +++ b/package/openvmtools/openvmtools.mk
> @@ -0,0 +1,79 @@
>
> +################################################################################
> +#
> +# openvmtools
> +#
>
> +################################################################################
> +
> +OPENVMTOOLS_VERSION = 9.4.6-1770165
> +OPENVMTOOLS_SOURCE = open-vm-tools-$(OPENVMTOOLS_VERSION).tar.gz
> +OPENVMTOOLS_SITE =
> http://downloads.sourceforge.net/project/open-vm-tools/open-vm-tools/stable-9.4.x
> +OPENVMTOOLS_LICENSE = LGPLv2.1
> +OPENVMTOOLS_LICENSE_FILES = COPYING
> +# Autoreconf needed because package is distributed without a configure
> script
> +# See http://sourceforge.net/p/open-vm-tools/mailman/message/32550385/
> +OPENVMTOOLS_AUTORECONF = YES
> +OPENVMTOOLS_CONF_OPT = --without-icu --without-x --without-gtk2
> --without-gtkmm --without-kernel-modules
> +# -Wno-deprecated-declarations is a workaround for a bug in open-vm-tools
> +# See http://sourceforge.net/p/open-vm-tools/mailman/message/31473171/
> +OPENVMTOOLS_CONF_ENV = CFLAGS="$(TARGET_CFLAGS)
> -Wno-deprecated-declarations"
> +
> +OPENVMTOOLS_DEPENDENCIES = libglib2
> +
> +# When libfuse is available, openvmtools can build vmblock-fuse, so
> +# make sure that libfuse gets built first
> +ifeq ($(BR2_PACKAGE_LIBFUSE),y)
> +OPENVMTOOLS_DEPENDENCIES += libfuse
> +endif
> +
> +ifeq ($(BR2_PACKAGE_OPENVMTOOLS_PROCPS),y)
> +OPENVMTOOLS_CONF_ENV += CUSTOM_PROCPS_NAME=procps
> +OPENVMTOOLS_CONF_OPT += --with-procps
> +OPENVMTOOLS_DEPENDENCIES += procps-ng
> +else
> +OPENVMTOOLS_CONF_OPT += --without-procps
> +endif
> +
> +ifeq ($(BR2_PACKAGE_OPENVMTOOLS_DNET),y)
> +# Needed because if it is defined configure will
> +# use a different method to check for dnet
> +OPENVMTOOLS_CONF_ENV += CUSTOM_DNET_CPPFLAGS=" "
> +OPENVMTOOLS_CONF_OPT += --with-dnet
> +OPENVMTOOLS_DEPENDENCIES += libdnet
> +else
> +OPENVMTOOLS_CONF_OPT += --without-dnet
> +endif
> +
> +ifeq ($(BR2_PACKAGE_OPENVMTOOLS_PAM),y)
> +OPENVMTOOLS_CONF_OPT += --with-pam
> +OPENVMTOOLS_MAKE_OPT += CFLAGS+="-Wno-unused-local-typedefs"
> +OPENVMTOOLS_DEPENDENCIES += linux-pam
> +else
> +OPENVMTOOLS_CONF_OPT += --without-pam
> +endif
> +
> +# symlink needed by lib/system/systemLinux.c (or will cry in
> /var/log/messages)
> +# /sbin/shutdown needed for Guest OS restart/shutdown from hypervisor
> +define OPENVMTOOLS_POST_INSTALL_TARGET_THINGIES
> +       ln -fs os-release $(TARGET_DIR)/etc/lfs-release
> +       if [ ! -e $(TARGET_DIR)/sbin/shutdown ]; then \
> +               $(INSTALL) -D -m 755 package/openvmtools/shutdown \
> +                       $(TARGET_DIR)/sbin/shutdown; \
> +       fi
> +endef
> +
> +OPENVMTOOLS_POST_INSTALL_TARGET_HOOKS +=
> OPENVMTOOLS_POST_INSTALL_TARGET_THINGIES
> +
> +define OPENVMTOOLS_INSTALL_INIT_SYSV
> +       $(INSTALL) -D -m 755 package/openvmtools/S10vmtoolsd \
> +               $(TARGET_DIR)/etc/init.d/S10vmtoolsd
> +endef
> +
> +define OPENVMTOOLS_INSTALL_INIT_SYSTEMD
> +       $(INSTALL) -D -m 644 package/openvmtools/vmtoolsd.service \
> +               $(TARGET_DIR)/etc/systemd/system/vmtoolsd.service
> +       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +       ln -fs ../vmtoolsd.service \
> +
>  $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vmtoolsd.service
> +endef
> +
> +$(eval $(autotools-package))
> diff --git a/package/openvmtools/shutdown b/package/openvmtools/shutdown
> new file mode 100644
> index 0000000..bca9765
> --- /dev/null
> +++ b/package/openvmtools/shutdown
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +#compatibility script for openvmtools
> +if [ "$1" == "-r" ]; then
> +/sbin/reboot
> +else
> +/sbin/poweroff
> +fi
> diff --git a/package/openvmtools/vmtoolsd.service
> b/package/openvmtools/vmtoolsd.service
> new file mode 100644
> index 0000000..17a4df4
> --- /dev/null
> +++ b/package/openvmtools/vmtoolsd.service
> @@ -0,0 +1,14 @@
> +[Unit]
> +Description=vmtoolsd for openvmtools
> +After=syslog.target network.target
> +
> +[Service]
> +Type=forking
> +PIDFile=/var/run/vmtoolsd.pid
> +ExecStart=/usr/bin/vmtoolsd -b /var/run/vmtoolsd.pid
> +Restart=on-failure
> +KillMode=process
> +KillSignal=SIGKILL
> +
> +[Install]
> +WantedBy=multi-user.target
> --
> 1.7.10.4
>
>
Peter Korsgaard Sept. 13, 2014, 9:47 p.m. UTC | #2
>>>>> "Karoly" == Karoly Kasza <kaszak@gmail.com> writes:

 > New package: openvmtools
 > Signed-off-by: Karoly Kasza <kaszak@gmail.com>
 > ---

 > Changes v6 -> v7:
 >   - PAM support now depends on BR2_PREFER_STATIC_LIB
 >   - LDFLAGS="-L$(TARGET_DIR)/usr/lib" removed from procps section
 >   - Reference to $(STAGING_DIR) removed from DNET section
 >   - Additional comments added

Have you tested this against mainline buildroot? Compilation fails as
libglib2 also defines a g_info macro like openvmtools does since 2.40.

Committed with that fixed, thanks.
Karoly Kasza Sept. 14, 2014, 5:58 p.m. UTC | #3
Hi Peter,


> Have you tested this against mainline buildroot? Compilation fails as
> libglib2 also defines a g_info macro like openvmtools does since 2.40.
>
>
I tested it multiple times, the compile never failed for me because of this
bug (own toolchain, all 3 libc options tested).
I even tried it today after reading your mail, I removed the 3rd patch from
the package directory, and it compiles nicely w/ libglib2-2.40.0 w/ all
three libc possibilities.
I guess this only occurs when compiling with options that are disabled in
our build (maybe X11 support or libICU)?
Thanks for the heads up, I'll be looking out for that one.

Regards,
Karoly
Thomas Petazzoni Sept. 15, 2014, 7:21 a.m. UTC | #4
Dear Karoly Kasza,

On Tue,  2 Sep 2014 18:13:36 +0200, Karoly Kasza wrote:
> New package: openvmtools
> 
> Signed-off-by: Karoly Kasza <kaszak@gmail.com>

There are some build failures caused by this new package, see
http://autobuild.buildroot.org/?reason=openvmtools-9.4.6-1770165. The
build failure looks like:

syncDriverPosix.c: In function 'SyncDriverIsRemoteFSType':
syncDriverPosix.c:76:30: error: argument to 'sizeof' in 'strncmp' call is the same expression as the second source; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
                       sizeof gRemoteFSTypes[i]) == 0) {

Could you have a look at what happens?

Thanks a lot!

Thomas
Karoly Kasza Sept. 15, 2014, 11:19 a.m. UTC | #5
Hi,

At first sight something happens with the ctng toolchain, while using own
toolchain or Sourcery w/ the same packages/options the problem does not
occur. I'm looking in the x86_64-ctng_locales-linux-gnu toolchain right now.

BR
Karoly

On Mon, Sep 15, 2014 at 9:21 AM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Karoly Kasza,
>
> On Tue,  2 Sep 2014 18:13:36 +0200, Karoly Kasza wrote:
> > New package: openvmtools
> >
> > Signed-off-by: Karoly Kasza <kaszak@gmail.com>
>
> There are some build failures caused by this new package, see
> http://autobuild.buildroot.org/?reason=openvmtools-9.4.6-1770165. The
> build failure looks like:
>
> syncDriverPosix.c: In function 'SyncDriverIsRemoteFSType':
> syncDriverPosix.c:76:30: error: argument to 'sizeof' in 'strncmp' call is
> the same expression as the second source; did you mean to provide an
> explicit length? [-Werror=sizeof-pointer-memaccess]
>                        sizeof gRemoteFSTypes[i]) == 0) {
>
> Could you have a look at what happens?
>
> Thanks a lot!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
Thomas Petazzoni Sept. 15, 2014, 11:38 a.m. UTC | #6
Dear Károly Kasza,

On Mon, 15 Sep 2014 13:19:06 +0200, Károly Kasza wrote:

> At first sight something happens with the ctng toolchain, while using own
> toolchain or Sourcery w/ the same packages/options the problem does not
> occur. I'm looking in the x86_64-ctng_locales-linux-gnu toolchain right now.

Note that it does not happen only with a ctng toolchain. See for
example
http://autobuild.buildroot.org/results/d1b/d1bf0d43389ff536ec79dd5d6a7cd0b12293233d//,
where the same problem happens with a BR toolchain.

Thomas
Karoly Kasza Sept. 15, 2014, 1:51 p.m. UTC | #7
Found it.
This is because of gcc 4.8's intended behaviour on sizeof() function in
cases when calling on a pointer.
See https://gcc.gnu.org/gcc-4.8/porting_to.html "New warnings for pointer
access".
It also exists as an unconfirmed bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54381.
This behaviour is only gcc 4.8, while 4.9 and pre-4.8 versions shouldn't do
this (Sourcery uses 4.7 and 4.6, I used the own toolchain w/ 4.9)

On the open-vm-tools mail list, it came up
http://sourceforge.net/p/open-vm-tools/mailman/message/32550520/ , but they
used -Wno-sizeof-pointer-memaccess for compilation - basically silencing
the warning.

Would you recommend using -Wno-sizeof-pointer-memaccess in the .mk file or
just use a 1 line patch to syncDriverPosix.c - dereferencing
gRemoteFSTypes[i] with an asterisk?


On Mon, Sep 15, 2014 at 1:38 PM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear Károly Kasza,
>
> On Mon, 15 Sep 2014 13:19:06 +0200, Károly Kasza wrote:
>
> > At first sight something happens with the ctng toolchain, while using own
> > toolchain or Sourcery w/ the same packages/options the problem does not
> > occur. I'm looking in the x86_64-ctng_locales-linux-gnu toolchain right
> now.
>
> Note that it does not happen only with a ctng toolchain. See for
> example
>
> http://autobuild.buildroot.org/results/d1b/d1bf0d43389ff536ec79dd5d6a7cd0b12293233d//
> ,
> where the same problem happens with a BR toolchain.
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
Thomas Petazzoni Sept. 15, 2014, 1:56 p.m. UTC | #8
Dear Károly Kasza,

On Mon, 15 Sep 2014 15:51:50 +0200, Károly Kasza wrote:

> Found it.
> This is because of gcc 4.8's intended behaviour on sizeof() function in
> cases when calling on a pointer.
> See https://gcc.gnu.org/gcc-4.8/porting_to.html "New warnings for pointer
> access".
> It also exists as an unconfirmed bug:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54381.
> This behaviour is only gcc 4.8, while 4.9 and pre-4.8 versions shouldn't do
> this (Sourcery uses 4.7 and 4.6, I used the own toolchain w/ 4.9)
> 
> On the open-vm-tools mail list, it came up
> http://sourceforge.net/p/open-vm-tools/mailman/message/32550520/ , but they
> used -Wno-sizeof-pointer-memaccess for compilation - basically silencing
> the warning.
> 
> Would you recommend using -Wno-sizeof-pointer-memaccess in the .mk file or
> just use a 1 line patch to syncDriverPosix.c - dereferencing
> gRemoteFSTypes[i] with an asterisk?

Thanks for the investigation!

As the solution, I would change the package to not use -Werror. Maybe
it has a configure option to do so? If not, adding one would be good
(so that the patch could potentially be upstreamed), or just changing
the package to not use -Werror at all.

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 883dd66..374694b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1171,6 +1171,7 @@  endif
 	source "package/ncdu/Config.in"
 	source "package/numactl/Config.in"
 	source "package/nut/Config.in"
+	source "package/openvmtools/Config.in"
 	source "package/powerpc-utils/Config.in"
 	source "package/polkit/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
diff --git a/package/openvmtools/Config.in b/package/openvmtools/Config.in
new file mode 100644
index 0000000..319b653
--- /dev/null
+++ b/package/openvmtools/Config.in
@@ -0,0 +1,61 @@ 
+config BR2_PACKAGE_OPENVMTOOLS
+	bool "openvmtools"
+	depends on BR2_i386 || BR2_x86_64
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
+	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	depends on BR2_LARGEFILE
+	depends on BR2_ENABLE_LOCALE
+	select BR2_PACKAGE_LIBGLIB2
+	help
+	  Open Virtual Machine Tools for VMware guest OS
+
+	  http://open-vm-tools.sourceforge.net/
+
+	  ICU locales and X11 tools are currently not supported.
+
+	  NOTE: Support for vmblock-fuse will be enabled in openvmtools if the
+	        libfuse package is selected.
+
+if BR2_PACKAGE_OPENVMTOOLS
+
+config BR2_PACKAGE_OPENVMTOOLS_PROCPS
+	bool "procps support"
+	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	select BR2_PACKAGE_PROCPS_NG
+	help
+	  Enable support for procps / meminfo
+
+comment "procps support needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS"
+	depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+
+config BR2_PACKAGE_OPENVMTOOLS_DNET
+	bool "dnet support"
+	depends on BR2_INET_IPV6
+	select BR2_PACKAGE_LIBDNET
+	help
+	  Enable support for libdnet / nicinfo
+
+comment "dnet support needs a toolchain w/ IPv6"
+	depends on !BR2_INET_IPV6
+
+config BR2_PACKAGE_OPENVMTOOLS_PAM
+	bool "PAM support"
+	select BR2_PACKAGE_LINUX_PAM
+	# linux-pam needs locale and wchar, but we already have this
+	# dependency on the main symbol, above.
+	depends on !BR2_PREFER_STATIC_LIB
+	help
+	  Support for PAM in openvmtools
+
+comment "PAM support needs a toolchain w/ dynamic library"
+	depends on BR2_PREFER_STATIC_LIB
+
+endif
+
+comment "openvmtools needs a toolchain w/ wchar, threads, RPC, largefile, locale"
+	depends on BR2_i386 || BR2_x86_64
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR ||!BR2_TOOLCHAIN_HAS_THREADS || \
+	!BR2_TOOLCHAIN_HAS_NATIVE_RPC || !BR2_LARGEFILE || !BR2_ENABLE_LOCALE
diff --git a/package/openvmtools/S10vmtoolsd b/package/openvmtools/S10vmtoolsd
new file mode 100644
index 0000000..969ba93
--- /dev/null
+++ b/package/openvmtools/S10vmtoolsd
@@ -0,0 +1,33 @@ 
+#!/bin/sh
+#
+# Starts vmtoolsd for openvmtools
+#
+
+EXEC="/usr/bin/vmtoolsd"
+ARGS="-b"
+PID="/var/run/vmtoolsd.pid"
+
+case "$1" in
+  start)
+    echo -n "Starting vmtoolsd: "
+    start-stop-daemon -S -q -x $EXEC -- $ARGS $PID
+    if [ $? != 0 ]; then
+      echo "FAILED"
+      exit 1
+    else
+      echo "OK"
+    fi
+  ;;
+  stop)
+    echo -n "Stopping vmtoolsd: "
+    start-stop-daemon -K -q -p $PID
+    echo "OK"
+  ;;
+  restart|reload)
+    $0 stop
+    $0 start
+  ;;
+  *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+esac
diff --git a/package/openvmtools/openvmtools-01-has_bsd_printf.patch b/package/openvmtools/openvmtools-01-has_bsd_printf.patch
new file mode 100644
index 0000000..889f7d1
--- /dev/null
+++ b/package/openvmtools/openvmtools-01-has_bsd_printf.patch
@@ -0,0 +1,26 @@ 
+lib/misc/msgList.c: missing #ifdef
+
+This macro checks for BSD style printf(), which is not present
+when compiling for uClibc. The linked functions are unnecessary in
+this case, and they break compilation.
+
+Signed-off-by: Karoly Kasza <kaszak@gmail.com>
+
+--- open-vm-tools-9.4.6-1770165.orig/lib/misc/msgList.c	2014-07-02 00:21:14.000000000 +0200
++++ open-vm-tools-9.4.6-1770165/lib/misc/msgList.c	2014-07-29 13:40:40.000000000 +0200
+@@ -487,6 +487,7 @@
+    return messages->id;
+ }
+ 
++#ifdef HAS_BSD_PRINTF
+ 
+ /*
+  *----------------------------------------------------------------------
+@@ -566,6 +567,7 @@
+    }
+ }
+ 
++#endif
+ 
+ /*
+  *----------------------------------------------------------------------
diff --git a/package/openvmtools/openvmtools-02-network_script.patch b/package/openvmtools/openvmtools-02-network_script.patch
new file mode 100644
index 0000000..67705cc
--- /dev/null
+++ b/package/openvmtools/openvmtools-02-network_script.patch
@@ -0,0 +1,21 @@ 
+scripts/linux/network: exit normally if no network control script
+
+When using suspend/resume from the hypervisor, openvmtools checks for the
+networking script, and exists with an error if not found, making the hypervisor
+raise a warning message. This workaround silences that error message.
+
+Signed-off-by: Karoly Kasza <kaszak@gmail.com>
+
+--- open-vm-tools-9.4.6-1770165.orig/scripts/linux/network	2014-07-02 00:21:14.000000000 +0200
++++ open-vm-tools-9.4.6-1770165/scripts/linux/network	2014-08-07 16:34:21.963514273 +0200
+@@ -88,7 +88,9 @@
+ run_network_script()
+ {
+    script=`find_networking_script`
+-   [ "$script" != "error" ] || Panic "Cannot find system networking script."
++#   [ "$script" != "error" ] || Panic "Cannot find system networking script."
++# Modified for buildroot
++   [ "$script" != "error" ] || exit 0
+ 
+    # Using SysV "service" if it exists, otherwise fall back to run the script directly
+    service=`which service 2>/dev/null`
diff --git a/package/openvmtools/openvmtools.mk b/package/openvmtools/openvmtools.mk
new file mode 100644
index 0000000..6361d6b
--- /dev/null
+++ b/package/openvmtools/openvmtools.mk
@@ -0,0 +1,79 @@ 
+################################################################################
+#
+# openvmtools
+#
+################################################################################
+
+OPENVMTOOLS_VERSION = 9.4.6-1770165
+OPENVMTOOLS_SOURCE = open-vm-tools-$(OPENVMTOOLS_VERSION).tar.gz
+OPENVMTOOLS_SITE = http://downloads.sourceforge.net/project/open-vm-tools/open-vm-tools/stable-9.4.x
+OPENVMTOOLS_LICENSE = LGPLv2.1
+OPENVMTOOLS_LICENSE_FILES = COPYING
+# Autoreconf needed because package is distributed without a configure script
+# See http://sourceforge.net/p/open-vm-tools/mailman/message/32550385/
+OPENVMTOOLS_AUTORECONF = YES
+OPENVMTOOLS_CONF_OPT = --without-icu --without-x --without-gtk2 --without-gtkmm --without-kernel-modules
+# -Wno-deprecated-declarations is a workaround for a bug in open-vm-tools
+# See http://sourceforge.net/p/open-vm-tools/mailman/message/31473171/
+OPENVMTOOLS_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -Wno-deprecated-declarations"
+
+OPENVMTOOLS_DEPENDENCIES = libglib2
+
+# When libfuse is available, openvmtools can build vmblock-fuse, so
+# make sure that libfuse gets built first
+ifeq ($(BR2_PACKAGE_LIBFUSE),y)
+OPENVMTOOLS_DEPENDENCIES += libfuse
+endif
+
+ifeq ($(BR2_PACKAGE_OPENVMTOOLS_PROCPS),y)
+OPENVMTOOLS_CONF_ENV += CUSTOM_PROCPS_NAME=procps
+OPENVMTOOLS_CONF_OPT += --with-procps
+OPENVMTOOLS_DEPENDENCIES += procps-ng
+else
+OPENVMTOOLS_CONF_OPT += --without-procps
+endif
+
+ifeq ($(BR2_PACKAGE_OPENVMTOOLS_DNET),y)
+# Needed because if it is defined configure will
+# use a different method to check for dnet
+OPENVMTOOLS_CONF_ENV += CUSTOM_DNET_CPPFLAGS=" "
+OPENVMTOOLS_CONF_OPT += --with-dnet
+OPENVMTOOLS_DEPENDENCIES += libdnet
+else
+OPENVMTOOLS_CONF_OPT += --without-dnet
+endif
+
+ifeq ($(BR2_PACKAGE_OPENVMTOOLS_PAM),y)
+OPENVMTOOLS_CONF_OPT += --with-pam
+OPENVMTOOLS_MAKE_OPT += CFLAGS+="-Wno-unused-local-typedefs"
+OPENVMTOOLS_DEPENDENCIES += linux-pam
+else
+OPENVMTOOLS_CONF_OPT += --without-pam
+endif
+
+# symlink needed by lib/system/systemLinux.c (or will cry in /var/log/messages)
+# /sbin/shutdown needed for Guest OS restart/shutdown from hypervisor
+define OPENVMTOOLS_POST_INSTALL_TARGET_THINGIES
+	ln -fs os-release $(TARGET_DIR)/etc/lfs-release
+	if [ ! -e $(TARGET_DIR)/sbin/shutdown ]; then \
+		$(INSTALL) -D -m 755 package/openvmtools/shutdown \
+			$(TARGET_DIR)/sbin/shutdown; \
+	fi
+endef
+
+OPENVMTOOLS_POST_INSTALL_TARGET_HOOKS += OPENVMTOOLS_POST_INSTALL_TARGET_THINGIES
+
+define OPENVMTOOLS_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 package/openvmtools/S10vmtoolsd \
+		$(TARGET_DIR)/etc/init.d/S10vmtoolsd
+endef
+
+define OPENVMTOOLS_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 package/openvmtools/vmtoolsd.service \
+		$(TARGET_DIR)/etc/systemd/system/vmtoolsd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../vmtoolsd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/vmtoolsd.service
+endef
+
+$(eval $(autotools-package))
diff --git a/package/openvmtools/shutdown b/package/openvmtools/shutdown
new file mode 100644
index 0000000..bca9765
--- /dev/null
+++ b/package/openvmtools/shutdown
@@ -0,0 +1,7 @@ 
+#!/bin/sh
+#compatibility script for openvmtools
+if [ "$1" == "-r" ]; then
+/sbin/reboot
+else
+/sbin/poweroff
+fi
diff --git a/package/openvmtools/vmtoolsd.service b/package/openvmtools/vmtoolsd.service
new file mode 100644
index 0000000..17a4df4
--- /dev/null
+++ b/package/openvmtools/vmtoolsd.service
@@ -0,0 +1,14 @@ 
+[Unit]
+Description=vmtoolsd for openvmtools
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/vmtoolsd.pid
+ExecStart=/usr/bin/vmtoolsd -b /var/run/vmtoolsd.pid
+Restart=on-failure
+KillMode=process
+KillSignal=SIGKILL
+
+[Install]
+WantedBy=multi-user.target