Skip to contentSkip to conversation

linux: add linux-tools infra

PATCH Superseded Romain Naour 2 participants 6 messages Jul 12, 2015 – Jul 13, 2015

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 linux: add linux-tools infra

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

---
 linux/linux.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
linux/linux.mk +24 -0
index eca1450..d483c11 100644
@@ -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 = $(if $(strip $(LINUX_TOOLS)),YES,NO)
+
+LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		$(LINUX_TOOL_$(call UPPERCASE,$(tool))_DEPENDENCIES)))
+
+LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_BUILD_CMDS))
+
+LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
+
+LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
+
 $(eval $(kconfig-package))
 
 # Support for rebuilding the kernel after the cpio archive has
Signature · 1 line
2.4.3
#1 lore raw

PATCH 2/3 linux-tools: add cpupower

This patch is based on the patch send by James Knight:
http://lists.busybox.net/pipermail/buildroot/2015-May/128754.html

---
 linux/Config.in              |  3 +++
 linux/Config.tools.in        | 11 +++++++++++
 linux/linux-tool-cpupower.mk | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100644 linux/Config.tools.in
 create mode 100644 linux/linux-tool-cpupower.mk
linux/Config.in +3 -0
index 8c86a1a..097cde5 100644
@@ -364,6 +364,9 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 # Linux extensions
 source "linux/Config.ext.in"
 
+# Linux tools
+source "linux/Config.tools.in"
+
 endif # BR2_LINUX_KERNEL
 
 endmenu
linux/Config.tools.in new file +11 -0
new file mode 100644
index 0000000..008e68c
@@ -0,0 +1,11 @@
+menu "Linux Kernel Tools"
+
+config BR2_LINUX_KERNEL_TOOL_CPUPOWER
+	bool "cpupower"
+	depends on !BR2_bfin # pciutils
+	select BR2_PACKAGE_PCIUTILS
+	help
+	  cpupower is a collection of tools to examine and tune power
+	  saving related features of your processor.
+
+endmenu
linux/linux-tool-cpupower.mk new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.4.3
#2 lore raw

PATCH 2/3 linux-tools: add cpupower

Romain, All,

On 2015-07-12 18:44 +0200, Romain Naour spake thusly:

Quoted 5 lines

This patch is based on the patch send by James Knight:
http://lists.busybox.net/pipermail/buildroot/2015-May/128754.html

I'm not too fond of the way we check for the correct version. Alas, there's not really a better way (and that's how perf does it too)...

Regards,
Yann E. MORIN.

Quoted 93 lines
---
 linux/Config.in              |  3 +++
 linux/Config.tools.in        | 11 +++++++++++
 linux/linux-tool-cpupower.mk | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100644 linux/Config.tools.in
 create mode 100644 linux/linux-tool-cpupower.mk
linux/Config.in +3 -0
index 8c86a1a..097cde5 100644
@@ -364,6 +364,9 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 # Linux extensions
 source "linux/Config.ext.in"
 
+# Linux tools
+source "linux/Config.tools.in"
+
 endif # BR2_LINUX_KERNEL
 
 endmenu
linux/Config.tools.in new file +11 -0
new file mode 100644
index 0000000..008e68c
@@ -0,0 +1,11 @@
+menu "Linux Kernel Tools"
+
+config BR2_LINUX_KERNEL_TOOL_CPUPOWER
+	bool "cpupower"
+	depends on !BR2_bfin # pciutils
+	select BR2_PACKAGE_PCIUTILS
+	help
+	  cpupower is a collection of tools to examine and tune power
+	  saving related features of your processor.
+
+endmenu
linux/linux-tool-cpupower.mk new file +41 -0
new file mode 100644
index 0000000..0938fac
@@ -0,0 +1,41 @@
+################################################################################
+#
+# Linux kernel cpupower tool
+#
+################################################################################
+
+LINUX_TOOLS += cpupower
+
+LINUX_TOOL_CPUPOWER_DEPENDENCIES = pciutils
+
+define LINUX_TOOL_CPUPOWER_BUILD_CMDS
+	$(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
+		echo "Your kernel version is too old and does not have the cpupower tool." ; \
+		echo "At least kernel 3.4 must be used." ; \
+		exit 1 ; \
+	fi
+	
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		CROSS=$(TARGET_CROSS) \
+		CPUFREQ_BENCH=false \
+		DEBUG=false \
+		cpupower
+endef
+
+define LINUX_TOOL_CPUPOWER_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		CROSS=$(TARGET_CROSS) \
+		CPUFREQ_BENCH=false \
+		DEBUG=false \
+		DESTDIR=$(STAGING_DIR) \
+		cpupower_install
+endef
+
+define LINUX_TOOL_CPUPOWER_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
+		CROSS=$(TARGET_CROSS) \
+		CPUFREQ_BENCH=false \
+		DEBUG=false \
+		DESTDIR=$(TARGET_DIR) \
+		cpupower_install
+endef
Signature · 6 lines
2.4.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 3/3 package/perf: migrate perf to use the new linux-tools infrastructure

In reply to Romain Naour

Remove perf package and add legacy handling.

---
 Config.in.legacy                                 |  7 +++++++
 linux/Config.tools.in                            | 18 ++++++++++++++++
 package/perf/perf.mk => linux/linux-tool-perf.mk | 26 ++++++++++--------------
 package/Config.in                                |  1 -
 package/perf/Config.in                           | 21 -------------------
 5 files changed, 36 insertions(+), 37 deletions(-)
 rename package/perf/perf.mk => linux/linux-tool-perf.mk (78%)
 delete mode 100644 package/perf/Config.in
Config.in.legacy +7 -0
index edf9912..a5f84e8 100644
@@ -107,6 +107,13 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2015.08"
 
+config BR2_PACKAGE_PERF
+	bool "perf"
+	select BR2_LEGACY
+	select BR2_LINUX_KERNEL_TOOL_PERF
+	help
+	  Perf package has been moved to linux tools package.
+
 config BR2_PACKAGE_GPU_VIV_BIN_MX6Q
 	bool "gpu-viv-bin-mx6q"
 	select BR2_LEGACY
linux/Config.tools.in +18 -0
index 008e68c..0c94d55 100644
@@ -8,4 +8,22 @@ config BR2_LINUX_KERNEL_TOOL_CPUPOWER
 	  cpupower is a collection of tools to examine and tune power
 	  saving related features of your processor.
 
+config BR2_LINUX_KERNEL_TOOL_PERF
+	bool "perf"
+	help
+	  perf (sometimes "Perf Events" or perf tools, originally
+	  "Performance Counters for Linux") - is a performance
+	  analyzing tool in Linux, available from kernel version
+	  2.6.31. User-space controlling utility, called 'perf' has
+	  git-like interface with subcommands. It is capable of
+	  statistical profiling of entire system (both kernel and user
+	  code), single CPU or severals threads.
+
+	  This package builds and install the userspace 'perf'
+	  command. It is up to the user to ensure that the kernel
+	  configuration has all the suitable options enabled to allow a
+	  proper operation of 'perf'.
+
+	  https://perf.wiki.kernel.org/
+
 endmenu
linux/linux-tool-perf.mk renamed from package/perf/perf.mk +11 -15
similarity index 78%
rename from package/perf/perf.mk
rename to linux/linux-tool-perf.mk
index 36989fc..a91a511 100644
@@ -1,16 +1,14 @@
 ################################################################################
 #
-# perf
+# Linux kernel Perf tool
 #
 ################################################################################
 
-# Source taken from the Linux kernel tree
-PERF_SOURCE =
-PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
+LINUX_TOOLS += perf
 
-PERF_DEPENDENCIES = linux host-flex host-bison
+LINUX_TOOL_PERF_DEPENDENCIES = host-flex host-bison
 
-PERF_MAKE_FLAGS = \
+LINUX_TOOL_PERF_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
 	NO_LIBAUDIT=1 \
 	NO_NEWT=1 \
@@ -29,16 +27,16 @@ PERF_MAKE_FLAGS = \
 # backtrace will contain only several functions from the top of stack,
 # instead of the complete backtrace.
 ifeq ($(BR2_arc),y)
-PERF_MAKE_FLAGS += NO_BACKTRACE=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_BACKTRACE=1
 endif
 
 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
-PERF_DEPENDENCIES += elfutils
+LINUX_TOOL_PERF_DEPENDENCIES += elfutils
 else
-PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
 endif
 
-define PERF_BUILD_CMDS
+define LINUX_TOOL_PERF_BUILD_CMDS
 	$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
 		echo "Your kernel version is too old and does not have the perf tool." ; \
 		echo "At least kernel 2.6.31 must be used." ; \
@@ -54,15 +52,13 @@ define PERF_BUILD_CMDS
 		fi \
 	fi
 	$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
-		$(PERF_MAKE_FLAGS) O=$(@D)
+		$(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D)
 endef
 
 # After installation, we remove the Perl and Python scripts from the
 # target.
-define PERF_INSTALL_TARGET_CMDS
+define LINUX_TOOL_PERF_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
-		$(PERF_MAKE_FLAGS) O=$(@D) install
+		$(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D) install
 	$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
 endef
-
-$(eval $(generic-package))
package/Config.in +0 -1
index e1b81a9..4e2e5a9 100644
@@ -88,7 +88,6 @@ endif
 	source "package/netperf/Config.in"
 	source "package/oprofile/Config.in"
 	source "package/pax-utils/Config.in"
-	source "package/perf/Config.in"
 	source "package/pv/Config.in"
 	source "package/racehound/Config.in"
 	source "package/ramsmp/Config.in"
package/perf/Config.in deleted +0 -21
deleted file mode 100644
index 05c9870..0000000
@@ -1,21 +0,0 @@
-config BR2_PACKAGE_PERF
-	bool "perf"
-	depends on BR2_LINUX_KERNEL
-	help
-	  perf (sometimes "Perf Events" or perf tools, originally
-	  "Performance Counters for Linux") - is a performance
-	  analyzing tool in Linux, available from kernel version
-	  2.6.31. User-space controlling utility, called 'perf' has
-	  git-like interface with subcommands. It is capable of
-	  statistical profiling of entire system (both kernel and user
-	  code), single CPU or severals threads.
-
-	  This package builds and install the userspace 'perf'
-	  command. It is up to the user to ensure that the kernel
-	  configuration has all the suitable options enabled to allow a
-	  proper operation of 'perf'.
-
-	  https://perf.wiki.kernel.org/
-
-comment "perf needs a Linux kernel to be built"
-	depends on !BR2_LINUX_KERNEL
Signature · 1 line
2.4.3
#4 lore raw

PATCH 3/3 package/perf: migrate perf to use the new linux-tools infrastructure

Romain, All,

On 2015-07-12 18:44 +0200, Romain Naour spake thusly:

Quoted 3 lines

Remove perf package and add legacy handling.

Regards,
Yann E. MORIN.

Quoted 169 lines
---
 Config.in.legacy                                 |  7 +++++++
 linux/Config.tools.in                            | 18 ++++++++++++++++
 package/perf/perf.mk => linux/linux-tool-perf.mk | 26 ++++++++++--------------
 package/Config.in                                |  1 -
 package/perf/Config.in                           | 21 -------------------
 5 files changed, 36 insertions(+), 37 deletions(-)
 rename package/perf/perf.mk => linux/linux-tool-perf.mk (78%)
 delete mode 100644 package/perf/Config.in
Config.in.legacy +7 -0
index edf9912..a5f84e8 100644
@@ -107,6 +107,13 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2015.08"
 
+config BR2_PACKAGE_PERF
+	bool "perf"
+	select BR2_LEGACY
+	select BR2_LINUX_KERNEL_TOOL_PERF
+	help
+	  Perf package has been moved to linux tools package.
+
 config BR2_PACKAGE_GPU_VIV_BIN_MX6Q
 	bool "gpu-viv-bin-mx6q"
 	select BR2_LEGACY
linux/Config.tools.in +18 -0
index 008e68c..0c94d55 100644
@@ -8,4 +8,22 @@ config BR2_LINUX_KERNEL_TOOL_CPUPOWER
 	  cpupower is a collection of tools to examine and tune power
 	  saving related features of your processor.
 
+config BR2_LINUX_KERNEL_TOOL_PERF
+	bool "perf"
+	help
+	  perf (sometimes "Perf Events" or perf tools, originally
+	  "Performance Counters for Linux") - is a performance
+	  analyzing tool in Linux, available from kernel version
+	  2.6.31. User-space controlling utility, called 'perf' has
+	  git-like interface with subcommands. It is capable of
+	  statistical profiling of entire system (both kernel and user
+	  code), single CPU or severals threads.
+
+	  This package builds and install the userspace 'perf'
+	  command. It is up to the user to ensure that the kernel
+	  configuration has all the suitable options enabled to allow a
+	  proper operation of 'perf'.
+
+	  https://perf.wiki.kernel.org/
+
 endmenu
linux/linux-tool-perf.mk renamed from package/perf/perf.mk +11 -15
similarity index 78%
rename from package/perf/perf.mk
rename to linux/linux-tool-perf.mk
index 36989fc..a91a511 100644
@@ -1,16 +1,14 @@
 ################################################################################
 #
-# perf
+# Linux kernel Perf tool
 #
 ################################################################################
 
-# Source taken from the Linux kernel tree
-PERF_SOURCE =
-PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
+LINUX_TOOLS += perf
 
-PERF_DEPENDENCIES = linux host-flex host-bison
+LINUX_TOOL_PERF_DEPENDENCIES = host-flex host-bison
 
-PERF_MAKE_FLAGS = \
+LINUX_TOOL_PERF_MAKE_FLAGS = \
 	$(LINUX_MAKE_FLAGS) \
 	NO_LIBAUDIT=1 \
 	NO_NEWT=1 \
@@ -29,16 +27,16 @@ PERF_MAKE_FLAGS = \
 # backtrace will contain only several functions from the top of stack,
 # instead of the complete backtrace.
 ifeq ($(BR2_arc),y)
-PERF_MAKE_FLAGS += NO_BACKTRACE=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_BACKTRACE=1
 endif
 
 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
-PERF_DEPENDENCIES += elfutils
+LINUX_TOOL_PERF_DEPENDENCIES += elfutils
 else
-PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
+LINUX_TOOL_PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
 endif
 
-define PERF_BUILD_CMDS
+define LINUX_TOOL_PERF_BUILD_CMDS
 	$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
 		echo "Your kernel version is too old and does not have the perf tool." ; \
 		echo "At least kernel 2.6.31 must be used." ; \
@@ -54,15 +52,13 @@ define PERF_BUILD_CMDS
 		fi \
 	fi
 	$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
-		$(PERF_MAKE_FLAGS) O=$(@D)
+		$(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D)
 endef
 
 # After installation, we remove the Perl and Python scripts from the
 # target.
-define PERF_INSTALL_TARGET_CMDS
+define LINUX_TOOL_PERF_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
-		$(PERF_MAKE_FLAGS) O=$(@D) install
+		$(LINUX_TOOL_PERF_MAKE_FLAGS) O=$(@D) install
 	$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
 endef
-
-$(eval $(generic-package))
package/Config.in +0 -1
index e1b81a9..4e2e5a9 100644
@@ -88,7 +88,6 @@ endif
 	source "package/netperf/Config.in"
 	source "package/oprofile/Config.in"
 	source "package/pax-utils/Config.in"
-	source "package/perf/Config.in"
 	source "package/pv/Config.in"
 	source "package/racehound/Config.in"
 	source "package/ramsmp/Config.in"
package/perf/Config.in deleted +0 -21
deleted file mode 100644
index 05c9870..0000000
@@ -1,21 +0,0 @@
-config BR2_PACKAGE_PERF
-	bool "perf"
-	depends on BR2_LINUX_KERNEL
-	help
-	  perf (sometimes "Perf Events" or perf tools, originally
-	  "Performance Counters for Linux") - is a performance
-	  analyzing tool in Linux, available from kernel version
-	  2.6.31. User-space controlling utility, called 'perf' has
-	  git-like interface with subcommands. It is capable of
-	  statistical profiling of entire system (both kernel and user
-	  code), single CPU or severals threads.
-
-	  This package builds and install the userspace 'perf'
-	  command. It is up to the user to ensure that the kernel
-	  configuration has all the suitable options enabled to allow a
-	  proper operation of 'perf'.
-
-	  https://perf.wiki.kernel.org/
-
-comment "perf needs a Linux kernel to be built"
-	depends on !BR2_LINUX_KERNEL
Signature · 6 lines
2.4.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/3 linux: add linux-tools infra

In reply to Romain Naour

Romain, All,

On 2015-07-12 18:44 +0200, Romain Naour spake thusly:

Quoted 8 lines

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].

Quoted 8 lines

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

(Needless to say I like this! ;-] )

Regards,
Yann E. MORIN.

Quoted 60 lines
---
 linux/linux.mk | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
linux/linux.mk +24 -0
index eca1450..d483c11 100644
@@ -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 = $(if $(strip $(LINUX_TOOLS)),YES,NO)
+
+LINUX_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		$(LINUX_TOOL_$(call UPPERCASE,$(tool))_DEPENDENCIES)))
+
+LINUX_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_BUILD_CMDS))
+
+LINUX_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
+
+LINUX_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
+	$(if $(BR2_LINUX_KERNEL_TOOL_$(call UPPERCASE,$(tool))),\
+		LINUX_TOOL_$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
+
 $(eval $(kconfig-package))
 
 # Support for rebuilding the kernel after the cpio archive has
Signature · 6 lines
2.4.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'