Skip to contentSkip to conversation

package/linux-tools: add support for Hyper-V tools

PATCH New Simon Rowe 4 participants 4 messages Dec 6, 2019

lore
Share & tools
lore

Simon Rowe

author
#0 lore raw

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

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.

---
 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
package/linux-tools/Config.in +8 -0
index ab8cc38..947ef05 100644
@@ -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
package/linux-tools/linux-tool-hv.mk.in new file +29 -0
new file mode 100644
index 0000000..803eb7e
@@ -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
Signature · 1 line
1.8.3.1
#1 lore raw

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

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

Simon

#2 lore raw

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

Hello,

+Pascal in Cc.

Quoted 2 lines · On Fri, 6 Dec 2019 13:33:50 +0000 Simon Rowe <[email protected]> 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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

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

From: Thomas Petazzoni <[email protected]>

To: Simon Rowe <[email protected]>
Cc: Simon Rowe <[email protected]>, <[email protected]>, Yann E. MORIN <[email protected]>, Pascal de Bruijn <[email protected]>
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.

Quoted 2 lines · On Fri, 6 Dec 2019 13:33:50 +0000 Simon Rowe <[email protected]> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191206/6d69a562/attachment.html>