From patchwork Mon Mar 15 19:02:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 47779 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 23618B7D4F for ; Tue, 16 Mar 2010 06:02:12 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NrFYE-0003Dv-VG; Mon, 15 Mar 2010 19:02:07 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NrFYB-0003CW-Ow for kernel-team@lists.ubuntu.com; Mon, 15 Mar 2010 19:02:03 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1NrFY9-0006fx-NB for ; Mon, 15 Mar 2010 19:02:02 +0000 Received: from 79-70-113-22.dynamic.dsl.as9105.com ([79.70.113.22] helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NrFY9-00055w-EW for kernel-team@lists.ubuntu.com; Mon, 15 Mar 2010 19:02:01 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: linux-tools -- pull out the perf binary into a binary package V2 Date: Mon, 15 Mar 2010 19:02:00 +0000 Message-Id: <1268679720-8107-1-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com [Updated patch, same contents better ordering in 2-*.mk which vastly improves the reviewability.] We are getting complex dependancies on the linux-image package as a result of including the perf binary in the package. This ties us to the versions of binutils and libc on the build release, which limits the installability of that kernel on older releases. This is a problem for testing. Move the binary over to a release and architecture specific binary package linux-tools-VERSION-ABI. Rename the current linux-tools package over to linux-tools-common and depend the binary packages on it. We will also need to add a new linux-tools meta package to the linux-meta package. Signed-off-by: Andy Whitcroft Acked-by: Tim Gardner Acked-by: Stefan Bader --- debian.master/control.stub.in | 15 +++++++-- debian/rules.d/0-common-vars.mk | 3 +- debian/rules.d/2-binary-arch.mk | 61 ++++++++++++++++++++++++++----------- debian/rules.d/3-binary-indep.mk | 6 ++-- debian/tools/perf | 6 ++- 5 files changed, 64 insertions(+), 27 deletions(-) diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in index 4b507ae..afb4ae9 100644 --- a/debian.master/control.stub.in +++ b/debian.master/control.stub.in @@ -45,13 +45,12 @@ Description: Linux kernel specific documentation for version PKGVER /usr/share/doc/SRCPKGNAME-doc/00-INDEX for a list of what is contained in each file. -Package: SRCPKGNAME-tools +Package: SRCPKGNAME-tools-common Architecture: all Section: admin Priority: optional Depends: ${misc:Depends} -Conflicts: SRCPKGNAME-tools-2.6 -Replaces: SRCPKGNAME-tools-2.6 +Replaces: SRCPKGNAME-tools (<= 2.6.32-16.25) Description: Linux kernel specific tools for version PKGVER This package provides the various tools in the PKGVER kernel source. @@ -77,3 +76,13 @@ Description: Linux Kernel Headers for development are used by the installed headers for GNU glibc and other system libraries. They are NOT meant to be used to build third-party modules for your kernel. Use SRCPKGNAME-headers-* packages for that. + +Package: linux-tools-PKGVER-ABINUM +Architecture: i386 amd64 lpia ia64 powerpc sparc armel +Section: devel +Priority: optional +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common +Description: Linux kernel tools for version PKGVER-ABINUM + This package provides kernel tools for version PKGVER-ABINUM on + DESC. + diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index d069cad..5e064d1 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -127,7 +127,8 @@ do_tools=false ifneq ($(wildcard $(CURDIR)/tools),) do_tools=true endif -tools_pkg_name=$(src_pkg_name)-tools +tools_pkg_name=$(src_pkg_name)-tools-$(abi_release) +tools_common_pkg_name=$(src_pkg_name)-tools-common # Support parallel= in DEB_BUILD_OPTIONS (see #209008) # diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 4caf3bd..fea4a11 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -24,15 +24,8 @@ $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(arc cat $^ | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE="Ubuntu $(release)-$(revision)-$* $(release)$(extraversion)"/' > $(builddir)/build-$*/.config find $(builddir)/build-$* -name "*.ko" | xargs rm -f $(build_cd) $(kmake) $(build_O) silentoldconfig prepare scripts -ifeq ($(do_tools),true) - install -d $(builddir)/tools-$* - for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools-$*/; done - rm $(builddir)/tools-$*/tools - rsync -a tools/ $(builddir)/tools-$*/tools/ -endif touch $@ - # Do the actual build, including image and modules build-%: $(stampdir)/stamp-build-% @# Empty for make to be happy @@ -41,9 +34,6 @@ $(stampdir)/stamp-build-%: prepare-% @echo "Building $*..." $(build_cd) $(kmake) $(build_O) $(conc_level) $(build_image) $(build_cd) $(kmake) $(build_O) $(conc_level) modules -ifeq ($(do_tools),true) - cd $(builddir)/tools-$*/tools/perf && make -endif @touch $@ # Install the finished build @@ -102,13 +92,6 @@ endif $(pkgdir)/lib/modules/$(abi_release)-$*/initrd/; \ fi - # Add the tools. -ifeq ($(do_tools),true) - install -d $(pkgdir)/usr/bin - install -s -m755 $(builddir)/tools-$*/tools/perf/perf \ - $(pkgdir)/usr/bin/perf_$(abi_release)-$* -endif - # Now the image scripts install -d $(pkgdir)/DEBIAN for script in postinst postrm preinst prerm; do \ @@ -336,7 +319,49 @@ endif $(stampdir)/stamp-flavours: @echo $(flavours) > $@ -binary-debs: $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours)) +# +# per-architecture packages +# +$(stampdir)/stamp-prepare-perarch: + @echo "Preparing perarch ..." +ifeq ($(do_tools),true) + install -d $(builddir)/tools-$* + for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools-$*/; done + rm $(builddir)/tools-$*/tools + rsync -a tools/ $(builddir)/tools-$*/tools/ +endif + touch $@ + +$(stampdir)/stamp-build-perarch: prepare-perarch +ifeq ($(do_tools),true) + cd $(builddir)/tools-$*/tools/perf && make +endif + @touch $@ + +install-perarch: toolspkgdir = $(CURDIR)/debian/$(tools_pkg_name) +install-perarch: $(stampdir)/stamp-build-perarch + # Add the tools. +ifeq ($(do_tools),true) + install -d $(toolspkgdir)/usr/bin + install -s -m755 $(builddir)/tools-$*/tools/perf/perf \ + $(toolspkgdir)/usr/bin/perf_$(abi_release) +endif + +binary-perarch: toolspkg = $(tools_pkg_name) +binary-perarch: install-perarch +ifeq ($(do_tools),true) + dh_installchangelogs -p$(toolspkg) + dh_installdocs -p$(toolspkg) + dh_compress -p$(toolspkg) + dh_fixperms -p$(toolspkg) + dh_shlibdeps -p$(toolspkg) + dh_installdeb -p$(toolspkg) + dh_gencontrol -p$(toolspkg) + dh_md5sums -p$(toolspkg) + dh_builddeb -p$(toolspkg) +endif + +binary-debs: binary-perarch $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours)) build-arch: $(addprefix build-,$(flavours)) diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index 9a99736..c670e5f 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -62,9 +62,9 @@ ifeq ($(do_source_package_content),true) rm -rf $(srcdir) endif -toolspkg = $(tools_pkg_name) -toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin -toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man +install-tools: toolspkg = $(tools_common_pkg_name) +install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin +install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man install-tools: dh_testdir dh_testroot diff --git a/debian/tools/perf b/debian/tools/perf index cfc2f87..1a9915f 100644 --- a/debian/tools/perf +++ b/debian/tools/perf @@ -1,2 +1,4 @@ -#!/bin/sh -exec perf_`uname -r` "$@" +#!/bin/bash +version=`uname -r` +version=${version%-*} +exec "perf_$version" "$@"