UBUNTU: Hyper-V KVP daemon -- add to the tools package
authorAndy Whitcroft <apw@canonical.com>
Fri, 6 Apr 2012 17:52:43 +0000 (18:52 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 9 Apr 2012 14:21:12 +0000 (08:21 -0600)
BugLink: http://bugs.launchpad.net/bugs/977246

Add the Hyper-V KVP userspace daemon to the kernel tools package.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

debian/rules.d/2-binary-arch.mk
debian/rules.d/3-binary-indep.mk
debian/tools/generic [new file with mode: 0644]

index 60b83d2..8308925 100644 (file)
@@ -401,6 +401,7 @@ ifeq ($(do_tools),true)
        if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
                cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE); \
                cd $(builddir)/tools/tools/power/x86/turbostat && make CROSS_COMPILE=$(CROSS_COMPILE); \
+               cd $(builddir)/tools/tools/hv && make CROSS_COMPILE=$(CROSS_COMPILE) CFLAGS=-I../../include; \
        fi
 endif
        @touch $@
@@ -417,6 +418,9 @@ ifeq ($(do_tools),true)
                        $(toolspkgdir)/usr/bin/x86_energy_perf_policy_$(abi_release); \
                install -s -m755 $(builddir)/tools/tools/power/x86/turbostat/turbostat \
                        $(toolspkgdir)/usr/bin/turbostat_$(abi_release); \
+               install -d $(toolspkgdir)/usr/sbin; \
+               install -s -m755 $(builddir)/tools/tools/hv/hv_kvp_daemon \
+                       $(toolspkgdir)/usr/sbin/hv_kvp_daemon_$(abi_release); \
        fi
 endif
 
index 462d721..de3583a 100644 (file)
@@ -81,6 +81,7 @@ endif
 
 install-tools: toolspkg = $(tools_common_pkg_name)
 install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin
+install-tools: toolssbin = $(CURDIR)/debian/$(toolspkg)/usr/sbin
 install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man
 install-tools: install-source
 ifeq ($(do_tools),true)
@@ -95,6 +96,8 @@ ifeq ($(do_tools),true)
        if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
                install -m755 debian/tools/x86_energy_perf_policy $(toolsbin)/x86_energy_perf_policy; \
                install -m755 debian/tools/turbostat $(toolsbin)/turbostat; \
+               install -d $(toolssbin) ; \
+               install -m755 debian/tools/generic $(toolssbin)/hv_kvp_daemon; \
        fi
 
        rm -rf $(builddir)/tools
@@ -110,6 +113,7 @@ ifeq ($(do_tools),true)
                install -d $(toolsman)/man8; \
                install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8; \
                install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8; \
+               install -m644 $(CURDIR)/tools/hv/*.8 $(toolsman)/man8; \
        fi
 endif
 
diff --git a/debian/tools/generic b/debian/tools/generic
new file mode 100644 (file)
index 0000000..61b427d
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+full_version=`uname -r`
+
+# Removing flavour from version i.e. generic or server.
+flavour_abi=${full_version#*-}
+flavour=${flavour_abi#*-}
+version=${full_version%-$flavour}
+this="$0_$version"
+
+if [ ! -f "$this" ]; then
+    echo "$this not found" >&2
+    echo "You may need to install linux-tools-$version" >&2
+    exit 2
+fi
+
+exec "$this" "$@"