From patchwork Tue Jul 14 00:09:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 494831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id B261814076C for ; Tue, 14 Jul 2015 10:20:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9451395741; Tue, 14 Jul 2015 00:20:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4iJkeED-Egp9; Tue, 14 Jul 2015 00:19:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 73D8C9574A; Tue, 14 Jul 2015 00:19:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4F14D1C21E7 for ; Tue, 14 Jul 2015 00:19:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B4E0FA2C76 for ; Tue, 14 Jul 2015 00:19:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H9RT8x58-mwA for ; Tue, 14 Jul 2015 00:19:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from zimbra3.corp.accelance.fr (zimbra3.corp.accelance.fr [213.162.49.233]) by fraxinus.osuosl.org (Postfix) with ESMTP id A9E09A2C31 for ; Tue, 14 Jul 2015 00:19:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id CE3A97ED9D for ; Tue, 14 Jul 2015 02:19:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 49sYJyR7HPb4; Tue, 14 Jul 2015 02:19:44 +0200 (CEST) Received: from atlas.home (AToulouse-657-1-1031-128.w92-134.abo.wanadoo.fr [92.134.9.128]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id 895ED7ED9F; Tue, 14 Jul 2015 02:19:44 +0200 (CEST) From: Romain Naour To: buildroot@buildroot.org Date: Tue, 14 Jul 2015 02:09:59 +0200 Message-Id: <1436832602-25682-2-git-send-email-romain.naour@openwide.fr> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1436832602-25682-1-git-send-email-romain.naour@openwide.fr> References: <1436832602-25682-1-git-send-email-romain.naour@openwide.fr> Subject: [Buildroot] [PATCH v3 1/4] linux: add linux-tools infra X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit add an infrastructure to build linux kernel tools available in the kernel sources. Currently, the only linux kernel tool packaged in Buildroot is perf and it's packaged as a separate generic package. This is a problem for licence information raised in this thread [1]. Since these tools require to build a Linux kernel, we can use some hooks in linux package like we did for linux extensions [2] and remove the perf package. [1] http://lists.busybox.net/pipermail/buildroot/2015-May/128783.html [2] http://lists.busybox.net/pipermail/buildroot/2015-March/121835.html Signed-off-by: Romain Naour Reviewed-by: "Yann E. MORIN" --- v3: unconditionally set LINUX_INSTALL_STAGING to YES v2: remove LINUX_TOOL prefix --- linux/linux.mk | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/linux/linux.mk b/linux/linux.mk index b602a04..ca58c4a 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -325,6 +325,8 @@ define LINUX_INSTALL_TARGET_CMDS $(LINUX_INSTALL_HOST_TOOLS) endef +# Include all our externsions and tools definitions. +# # Note: our package infrastructure uses the full-path of the last-scanned # Makefile to determine what package we're currently defining, using the # last directory component in the path. As such, including other Makefile, @@ -334,6 +336,7 @@ endef # the current Makefile, we are OK. But this is a hard requirement: files # included here *must* be in the same directory! include $(sort $(wildcard linux/linux-ext-*.mk)) +include $(sort $(wildcard linux/linux-tool-*.mk)) LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext))) @@ -342,6 +345,27 @@ LINUX_PRE_PATCH_HOOKS += $(foreach ext,$(LINUX_EXTENSIONS),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),\ $(call UPPERCASE,$(ext))_PREPARE_KERNEL)) +# Install Linux kernel tools in staging directory since some tools +# may install shared libraries and headers (e.g. cpupower). The +# kernel image is NOT installed in staging directory. +LINUX_INSTALL_STAGING = YES + +LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\ + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\ + $($(call UPPERCASE,$(tool))_DEPENDENCIES))) + +LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\ + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\ + $(call UPPERCASE,$(tool))_BUILD_CMDS)) + +LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\ + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\ + $(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS)) + +LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\ + $(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\ + $(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS)) + $(eval $(kconfig-package)) # Support for rebuilding the kernel after the cpio archive has