From patchwork Mon Nov 11 18:33:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 290462 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3C72C2C00A8 for ; Tue, 12 Nov 2013 05:33:45 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VfwIo-00012c-FS; Mon, 11 Nov 2013 18:33:34 +0000 Received: from mail-we0-f175.google.com ([74.125.82.175]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VfwIh-00012A-OL for kernel-team@lists.ubuntu.com; Mon, 11 Nov 2013 18:33:27 +0000 Received: by mail-we0-f175.google.com with SMTP id p61so2394807wes.34 for ; Mon, 11 Nov 2013 10:33:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DTywY6+pkmwspujsRtsZ503CC87F8HGR8O7VrOPetLM=; b=lJKGylX8wp4fVQOEXbPG1Nid+RBZT09ULkd4sMDbh6h6JMPNmUk0KBx9TRpPJV1q6R q2/2qy8rkIj1WhpCNADJSSaEB8j75jVOnzM+8Q9LwzF8+ZpNuOcFVDKStXNPFW4whu2B 1C2IjaV1i8h7d//NO53OvO/kirB1F3KSWXs2exApIrIxmkp1csB3teaJoIW4nDnxCj4q JjxIhTFfOPPssP7uSo7Q0bAl/7UzvigiBj8HBeLFSemyfqB66ej4F4Q1FkC4aGfo/XEb sKmY38SQh4zT0iUht2SR5lMIHzWgJVsQuiW2WMw7pG8jpboObwkNlGHOiVeBhNuBTqIV c12g== X-Gm-Message-State: ALoCoQlkpR6nijzyHOtYNebk3MUlHxZqjxt6w47F4w2I5UxZhUTNZG79RDSoJtuYP75fVvQo+o7T X-Received: by 10.180.94.38 with SMTP id cz6mr13236226wib.27.1384194807444; Mon, 11 Nov 2013 10:33:27 -0800 (PST) Received: from localhost ([2001:470:6973:2:f849:60aa:1af9:4dc0]) by mx.google.com with ESMTPSA id bs15sm36698969wib.10.2013.11.11.10.33.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 11 Nov 2013 10:33:26 -0800 (PST) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [SRU precise/master-next] [PATCH 1/1] UBUNTU: tools -- upgrade to common generic helper Date: Mon, 11 Nov 2013 18:33:21 +0000 Message-Id: <1384194802-29641-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1384194802-29641-1-git-send-email-apw@canonical.com> References: <1384194802-29641-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 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 --- 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 diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index de3583a..73a251e 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -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 diff --git a/debian/tools/generic b/debian/tools/generic index 61b427d..4aa5649 100644 --- a/debian/tools/generic +++ b/debian/tools/generic @@ -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 diff --git a/debian/tools/perf b/debian/tools/perf deleted file mode 100644 index ab35fab..0000000 --- a/debian/tools/perf +++ /dev/null @@ -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" "$@" diff --git a/debian/tools/turbostat b/debian/tools/turbostat deleted file mode 100644 index ac4af7c..0000000 --- a/debian/tools/turbostat +++ /dev/null @@ -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" "$@" diff --git a/debian/tools/x86_energy_perf_policy b/debian/tools/x86_energy_perf_policy deleted file mode 100644 index 7b97a9e..0000000 --- a/debian/tools/x86_energy_perf_policy +++ /dev/null @@ -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" "$@"