[Saucy][PATCH] UBUNTU: [debian] ship 'cpupower' in linux-tools
Kamal Mostafa
kamal at canonical.com
Fri Aug 9 23:03:46 UTC 2013
BugLink: http://bugs.launchpad.net/bugs/1158668
New Build-depends: libpci-dev
Adds to binary package "linux-tools-$(abi_version)"
/usr/bin/cpupower_$(abi_version)
/usr/lib/libcpupower.so.$(abi_version)
Adds to binary package "linux-tools-common"
/usr/bin/cpupower
/usr/share/man/man1/cpupower-set.1.gz
/usr/share/man/man1/cpupower-frequency-set.1.gz
/usr/share/man/man1/cpupower-frequency-info.1.gz
/usr/share/man/man1/cpupower-monitor.1.gz
/usr/share/man/man1/cpupower-info.1.gz
/usr/share/man/man1/cpupower-idle-info.1.gz
/usr/share/man/man1/cpupower.1.gz
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
debian.master/control.stub.in | 2 +-
debian/rules.d/2-binary-arch.mk | 17 +++++++++++++++++
debian/rules.d/3-binary-indep.mk | 3 +++
debian/tools/cpupower | 16 ++++++++++++++++
4 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 debian/tools/cpupower
diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
index 1bc503c..f45d269 100644
--- a/debian.master/control.stub.in
+++ b/debian.master/control.stub.in
@@ -3,7 +3,7 @@ Section: devel
Priority: optional
Maintainer: Ubuntu Kernel Team <kernel-team at lists.ubuntu.com>
Standards-Version: 3.9.4.0
-Build-Depends: debhelper (>= 5), cpio, module-init-tools, kernel-wedge (>= 2.24ubuntu1), makedumpfile [amd64 i386], libelf-dev, libnewt-dev, binutils-dev, rsync, libdw-dev, dpkg (>= 1.16.0~ubuntu4), pkg-config, flex, bison, libunwind8-dev, openssl, libaudit-dev, bc, python-dev, gcc-4.7 [armhf], gawk
+Build-Depends: debhelper (>= 5), cpio, module-init-tools, kernel-wedge (>= 2.24ubuntu1), makedumpfile [amd64 i386], libelf-dev, libnewt-dev, binutils-dev, rsync, libdw-dev, libpci-dev, dpkg (>= 1.16.0~ubuntu4), pkg-config, flex, bison, libunwind8-dev, openssl, libaudit-dev, bc, python-dev, gcc-4.7 [armhf], gawk
Build-Depends-Indep: xmlto, docbook-utils, ghostscript, transfig, bzip2, sharutils, asciidoc
Vcs-Git: http://kernel.ubuntu.com/git-repos/ubuntu/ubuntu-saucy.git
XS-Testsuite: autopkgtest
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 5087804..1957779 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -458,6 +458,14 @@ endif
$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
@echo Debug: $@
ifeq ($(do_tools),true)
+
+ # Allow for multiple installed versions of cpupower and libcpupower.so:
+ # Override LIB_MIN in order to to generate a versioned .so named
+ # libcpupower.so.$(abi_release) and link cpupower with that.
+ make -C $(builddirpa)/tools/power/cpupower \
+ CROSS_COMPILE=$(CROSS_COMPILE) \
+ LIB_MIN=$(abi_release) CPUFREQ_BENCH=false
+
ifeq ($(do_tools_perf),true)
cd $(builddirpa)/tools/perf && \
make prefix=/usr HAVE_CPLUS_DEMANGLE=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPYTHON=1 NO_LIBPERL=1 PYTHON=python2.7
@@ -478,6 +486,15 @@ install-perarch: $(stampdir)/stamp-build-perarch
# Add the tools.
ifeq ($(do_tools),true)
install -d $(toolspkgdir)/usr/bin
+ install -d $(toolspkgdir)/usr/lib
+
+ install -m755 $(builddirpa)/tools/power/cpupower/cpupower \
+ $(toolspkgdir)/usr/bin/cpupower_$(abi_release)
+ # Install only the full versioned libcpupower.so.$(abi_release), not
+ # the usual symlinks to it.
+ install -m644 $(builddirpa)/tools/power/cpupower/libcpupower.so.$(abi_release) \
+ $(toolspkgdir)/usr/lib/
+
ifeq ($(do_tools_perf),true)
install -m755 $(builddirpa)/tools/perf/perf \
$(toolspkgdir)/usr/bin/perf_$(abi_release)
diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index ea6ce68..4e62f51 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -92,6 +92,9 @@ ifeq ($(do_tools),true)
install -d $(toolsbin)
install -d $(toolsman)/man1
+ install -m755 debian/tools/cpupower $(toolsbin)/cpupower
+ install -m644 $(CURDIR)/tools/power/cpupower/man/*.1 $(toolsman)/man1/
+
ifeq ($(do_tools_perf),true)
install -m755 debian/tools/perf $(toolsbin)/perf
endif
diff --git a/debian/tools/cpupower b/debian/tools/cpupower
new file mode 100644
index 0000000..9a66eb8
--- /dev/null
+++ b/debian/tools/cpupower
@@ -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}
+cpupower="cpupower_$version"
+
+if ! which "$cpupower" > /dev/null; then
+ echo "$cpupower not found" >&2
+ echo "You may need to install linux-tools-$version" >&2
+ exit 2
+fi
+
+exec "$cpupower" "$@"
--
1.8.1.2
More information about the kernel-team
mailing list