From patchwork Thu Apr 2 11:27:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 6147151 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D9969F2EC for ; Thu, 2 Apr 2015 11:27:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C44A2038C for ; Thu, 2 Apr 2015 11:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10B6920392 for ; Thu, 2 Apr 2015 11:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750771AbbDBL1y (ORCPT ); Thu, 2 Apr 2015 07:27:54 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:34094 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbbDBL1x (ORCPT ); Thu, 2 Apr 2015 07:27:53 -0400 Received: by lagg8 with SMTP id g8so57829769lag.1 for ; Thu, 02 Apr 2015 04:27:51 -0700 (PDT) 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=4Ysvt75ruXNM+LmrAMypRWIwEskHQztNG8ZL9hei8Zs=; b=jD6lv222M+Gx5hbGt3BGRRJHJDwu8qyhv4Hvp5baCgPU7GZUEz0MaGol10pkTpvj4+ npnoLd+phvl/IV/H+6QES3EHV7l04lGQ4cHnsbDbsACLtRrrpZ83g4ErzhgAlecJmAlL Vljla2GoPqSU28Pa1tiAla2pkEqkCj6AZwrQL8jcGnd3UgAUyxgtyeyTy+AjnIkB5p7J F7baawJKKL6dchlw23b+lZ5EooSgXuSWSfRh/IddNl2pMkeHclUMm/qFohjzAC7K6HWn 8uq4iYnzaPW/0Y4CwWiQ3iSbf3nG8ZcFkQLTaaT9vW5I542gsJR+knYrIcEnyest43SC sjKg== X-Gm-Message-State: ALoCoQnKjajNqjL6r8FjKEZYXBBktDf/z8hL29PHV5c2MambaTmAzzAxjG+2wIWX3hPaQ8ryb2dP X-Received: by 10.152.43.43 with SMTP id t11mr4949296lal.74.1427974071905; Thu, 02 Apr 2015 04:27:51 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id k3sm979450lah.40.2015.04.02.04.27.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Apr 2015 04:27:51 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.cz, debian-kernel@lists.debian.org Cc: Riku Voipio Subject: [PATCH 4/4] RFC: builddeb: add linux-tools package with perf Date: Thu, 2 Apr 2015 14:27:30 +0300 Message-Id: <51b2a18cb7801c2866233a19506c4eead4727887.1427968988.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Riku Voipio Perf is shipped in debian in linux-tools-$version package. Extend the existing to builddeb script to build perf if BUILD_TOOLS=y is added the make deb-pkg line Some features of this patch I'm uncomfortable with: 1. Relative paths are resoved to absolute ones Especially with separate O= buildd, perf build from tools/perf dir fail. 2. Unsetting LDFLAGS make -> shell (builddeb) -> make expands variables. The LDFLAGS as set by toplevel makefile are for kernel, so we just unset the flag here. 3. Replaces ubuntu/debian packages instead attempting to fit to the linux-base/linux-tools-common frameworks. I think people who want to run "make deb-pkg" for their kernels would rather keep this simple. 4. More tools than just perf could be built - unfortunately most tools fail to have a working "install" target and/or else have build process inconsistent with other tools. A topic for another patch series. Signed-off-by: Riku Voipio --- scripts/package/builddeb | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 36185d6..2d6d547 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -92,11 +92,13 @@ fwdir="$objtree/debian/fwtmp" kernel_headers_dir="$objtree/debian/hdrtmp" libc_headers_dir="$objtree/debian/headertmp" dbg_dir="$objtree/debian/dbgtmp" +tools_dir="$objtree/debian/toolstmp" packagename=linux-image-$version fwpackagename=linux-firmware-image-$version kernel_headers_packagename=linux-headers-$version libc_headers_packagename=linux-libc-dev dbg_packagename=$packagename-dbg +tools_packagename=linux-tools-$version if [ "$ARCH" = "um" ] ; then packagename=user-mode-linux-$version @@ -119,7 +121,7 @@ esac BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" # Setup the directory structure -rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" +rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" "$tools_dir" mkdir -p "$tmpdir/lib" "$tmpdir/boot" mkdir -p "$fwdir/lib/firmware/$version/" mkdir -p "$kernel_headers_dir/lib/modules/$version/" @@ -387,4 +389,31 @@ EOF create_package "$dbg_packagename" "$dbg_dir" fi +if [ -n "$BUILD_TOOLS" ] +then + # HACK - change output dir from relative to absolute + mkdir -p $tools_dir + tools_dest=`readlink -f $tools_dir` + if [ -n "$O" ] + then + output=`readlink -f $objtree` + mkdir -p $output/tools/perf + output="O=$output/tools/perf" + fi + $MAKE -C $srctree/tools/perf $output LDFLAGS= srctree=$KBUILD_SRC prefix=$tools_dest/usr install + cat <> debian/control + +Package: $tools_packagename +Architecture: any +Replaces: linux-base, linux-tools-common +Depends: \${shlibs:Depends} +Description: Performance analysis tools for Linux $version + This package contains the 'perf' performance analysis tools for Linux + kernel version $version . +EOF + + dpkg-shlibdeps $tools_dest/usr/bin/* $tools_dest/usr/lib/traceevent/plugins/* + create_package "$tools_packagename" "$tools_dir" +fi + exit 0