diff mbox series

[1/1] package/linux-tools: add support for Hyper-V tools

Message ID 1575639071-32764-1-git-send-email-simon.rowe@citrix.com
State Not Applicable
Headers show
Series [1/1] package/linux-tools: add support for Hyper-V tools | expand

Commit Message

Simon Rowe Dec. 6, 2019, 1:31 p.m. UTC
Add support for selection and compiling the Hyper-V tools on buildroot.

These tools are available to be compiled since kernel 3.15 but only had
an install target since 4.16.

Signed-off-by: Simon Rowe <simon.rowe@citrix.com>
---
 package/linux-tools/Config.in           |  8 ++++++++
 package/linux-tools/linux-tool-hv.mk.in | 29 +++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 package/linux-tools/linux-tool-hv.mk.in

Comments

Simon Rowe Dec. 6, 2019, 1:33 p.m. UTC | #1
What's the probability of that, someone else just sent a patch 15 
minutes ago while I was testing this one,

Simon
Thomas Petazzoni Dec. 6, 2019, 2:17 p.m. UTC | #2
Hello,

+Pascal in Cc.

On Fri, 6 Dec 2019 13:33:50 +0000
Simon Rowe <simon.rowe@eu.citrix.com> wrote:

> What's the probability of that, someone else just sent a patch 15 
> minutes ago while I was testing this one,

Pascal: the approach of Simon is to have a single option to
build/install all tools. Do we really need one option per tool like you
implemented? In which use cases would only a subset of the tools be
needed? What is the installed size of each tool?

Thanks,

Thomas
Pascal de Bruijn Dec. 6, 2019, 2:20 p.m. UTC | #3
From:   Thomas Petazzoni <thomas.petazzoni@bootlin.com> 

 To:   Simon Rowe <simon.rowe@eu.citrix.com> 
 Cc:   Simon Rowe <simon.rowe@citrix.com>, <buildroot@buildroot.org>, Yann E. MORIN <yann.morin.1998@free.fr>, Pascal de Bruijn <p.debruijn@unilogic.nl> 
 Sent:   12/6/2019 3:17 PM 
 Subject:   Re: [Buildroot] [PATCH 1/1] package/linux-tools: add support for Hyper-V tools 

Hello, 
 
+Pascal in Cc. 
 
On Fri, 6 Dec 2019 13:33:50 +0000 
Simon Rowe <simon.rowe@eu.citrix.com> wrote: 
 
> What's the probability of that, someone else just sent a patch 15  
> minutes ago while I was testing this one, 
 
Pascal: the approach of Simon is to have a single option to 
build/install all tools. Do we really need one option per tool like you 
implemented? In which use cases would only a subset of the tools be 
needed? What is the installed size of each tool? 


The size of each tool is very limited, so that's at best a secondary concern.



But for example the fcopy service basically gives the virtualization host provider direct access to the guest filesystem., which is not something everybody may want to actively facilitate.


Having these different services nicely separated out, is specifically one of the nice things opposed to VMware's openvmtools/vmtoolsd.



Regards,
Pascal de Bruijn
diff mbox series

Patch

diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index ab8cc38..947ef05 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -25,6 +25,14 @@  config BR2_PACKAGE_LINUX_TOOLS_GPIO
 
 	  These tools are available only from kernel version 4.8.
 
+config BR2_PACKAGE_LINUX_TOOLS_HV
+	bool "hv"
+	select BR2_PACKAGE_LINUX_TOOLS
+	help
+	  hv is a collection of tools to interact with Hyper-V.
+
+	  These tools are available only from kernel version 4.16.
+
 config BR2_PACKAGE_LINUX_TOOLS_IIO
 	bool "iio"
 	select BR2_PACKAGE_LINUX_TOOLS
diff --git a/package/linux-tools/linux-tool-hv.mk.in b/package/linux-tools/linux-tool-hv.mk.in
new file mode 100644
index 0000000..803eb7e
--- /dev/null
+++ b/package/linux-tools/linux-tool-hv.mk.in
@@ -0,0 +1,29 @@ 
+################################################################################
+#
+# hv
+#
+################################################################################
+
+LINUX_TOOLS += hv
+
+HV_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
+
+define HV_BUILD_CMDS
+	$(Q)if ! grep install $(LINUX_DIR)/tools/hv/Makefile >/dev/null 2>&1 ; then \
+		echo "Your kernel version is too old and does not have install section in the hv tools." ; \
+		echo "At least kernel 4.16 must be used." ; \
+		exit 1 ; \
+	fi
+
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/hv \
+		$(HV_MAKE_OPTS)
+endef
+
+# DESTDIR used since kernel version 4.14
+define HV_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/hv \
+		$(HV_MAKE_OPTS) \
+		INSTALL_ROOT=$(TARGET_DIR) \
+		DESTDIR=$(TARGET_DIR) \
+		install
+endef