@@ -92,10 +92,10 @@ ifeq ($(do_tools),true)
install -d $(toolsbin)
install -d $(toolsman)/man1
- install -m755 debian/tools/perf $(toolsbin)/perf
+ install -m755 debian/tools/generic $(toolsbin)/perf
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 -m755 debian/tools/generic $(toolsbin)/x86_energy_perf_policy; \
+ install -m755 debian/tools/generic $(toolsbin)/turbostat; \
install -d $(toolssbin) ; \
install -m755 debian/tools/generic $(toolssbin)/hv_kvp_daemon; \
fi
@@ -1,16 +1,30 @@
#!/bin/bash
full_version=`uname -r`
+# First check for a fully qualified version.
+this="/usr/lib/linux-tools/$full_version/`basename $0`"
+if [ -f "$this" ]; then
+ exec "$this" "$@"
+fi
+
+# FALLBACK for older kernel layouts
# 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
+ exec "$this" "$@"
+fi
-if [ ! -f "$this" ]; then
- echo "$this not found" >&2
- echo "You may need to install linux-tools-$version" >&2
- exit 2
+# If we have the appropriate package installed but no
+# tool then the tool does not exist.
+if [ -d "/usr/lib/linux-tools/$full_version" ]; then
+ echo "`basename $0` not available for kernel $version" >&2
+ exit 2
fi
-exec "$this" "$@"
+# Give them a hint as to what to install.
+echo "`basename $0` not found for kernel $version" >&2
+echo "You may need to install linux-tools-$version-$flavour" >&2
+exit 2
deleted file mode 100644
@@ -1,16 +0,0 @@
-#!/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}
-perf="perf_$version"
-
-if ! which "$perf" > /dev/null; then
- echo "$perf not found" >&2
- echo "You may need to install linux-tools-$version" >&2
- exit 2
-fi
-
-exec "$perf" "$@"
deleted file mode 100644
@@ -1,16 +0,0 @@
-#!/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}
-turbostat="turbostat_$version"
-
-if ! which "$turbostat" > /dev/null; then
- echo "$turbostat not found" >&2
- echo "You may need to install linux-tools-$version" >&2
- exit 2
-fi
-
-exec "$turbostat" "$@"
deleted file mode 100644
@@ -1,16 +0,0 @@
-#!/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}
-x86_energy_perf_policy="x86_energy_perf_policy_$version"
-
-if ! which "$x86_energy_perf_policy" > /dev/null; then
- echo "$x86_energy_perf_policy not found" >&2
- echo "You may need to install linux-tools-$version" >&2
- exit 2
-fi
-
-exec "$x86_energy_perf_policy" "$@"
In order to allow us to have tools from both the current releases and newer LTS backport releases we need the updated generic helper which understands all possible locations. At the same time take the opportunity to standardise on a single helper. BugLink: http://bugs.launchpad.net/bugs/1205284 Signed-off-by: Andy Whitcroft <apw@canonical.com> --- debian/rules.d/3-binary-indep.mk | 6 +++--- debian/tools/generic | 24 +++++++++++++++++++----- debian/tools/perf | 16 ---------------- debian/tools/turbostat | 16 ---------------- debian/tools/x86_energy_perf_policy | 16 ---------------- 5 files changed, 22 insertions(+), 56 deletions(-) delete mode 100644 debian/tools/perf delete mode 100644 debian/tools/turbostat delete mode 100644 debian/tools/x86_energy_perf_policy