Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/linux-tools: add support for Hyper-V tools
@ 2019-12-06 13:31 Simon Rowe
  2019-12-06 13:33 ` Simon Rowe
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Rowe @ 2019-12-06 13:31 UTC (permalink / raw)
  To: buildroot

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

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
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-06 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-06 13:31 [Buildroot] [PATCH 1/1] package/linux-tools: add support for Hyper-V tools Simon Rowe
2019-12-06 13:33 ` Simon Rowe
2019-12-06 14:17   ` Thomas Petazzoni
2019-12-06 14:20     ` Pascal de Bruijn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox