br2-ext linux-kernel-extensions support
PATCH v5 1/1 br2-ext linux-kernel-extensions support
From: "McCabe, Robert J" <[email protected]>
Allows br2-externals to inject custom code into the kernel tree.
--- docs/manual/customize-outside-br.txt | 14 ++++++++++++++ linux/linux.mk | 13 +++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-)
docs/manual/customize-outside-br.txt +14 -0
@@ -219,6 +219,12 @@ BR2_ROOTFS_OVERLAY=$(BR2_EXTERNAL_BAR_42_PATH)/board/<boardname>/overlay/ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=$(BR2_EXTERNAL_BAR_42_PATH)/board/<boardname>/kernel.config ---- +===== Custom linux-kernel-extensions + + Custom linux extensions (see xref:linux-kernel-ext[]) can be added by + storing them in the `linux/` directory at the root of your + br2-external tree. + ===== Example layout Here is an example layout using all features of br2-external (the sample
@@ -315,6 +321,14 @@ illustration, of course): | |$(eval $(toolchain-external-package)) | `---- | + |- linux/Config.ext.in + | |config BR2_LINUX_KERNEL_EXT_EXAMPLE_DRIVER + | | bool "example-external-driver" + | | help + | | Example external driver + | |--- + |- linux/linux-ext-example-driver.mk + | |- configs/my-board_defconfig | |BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BAR_42_PATH)/patches/" | |BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_BAR_42_PATH)/board/my-board/overlay/"
linux/linux.mk +9 -4
@@ -514,14 +514,19 @@ endef # # 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, -# like below, before we call one of the *-package macro is usally not -# working. +# last directory component in the path. As such, including other Makefiles, +# like below, before we call one of the *-package macros usually doesn't +# work. # However, since the files we include here are in the same directory as # the current Makefile, we are OK. But this is a hard requirement: files -# included here *must* be in the same directory! +# included here *must* either be in this same directory OR within a +# another directory with the name "linux" (in the BR2_EXTERNAL case). include $(sort $(wildcard linux/linux-ext-*.mk)) +#Import linux-kernel-extensions from externals +include $(sort $(wildcard $(foreach ext,$(BR2_EXTERNAL_DIRS), \ + $(ext)/linux/linux-ext-*.mk))) + LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext)))
--
2.17.1
PATCH v5 1/1 br2-ext linux-kernel-extensions support
Robert, All,
On 2019-09-28 12:49 -0500, robert.mccabe at rockwellcollins.com spake thusly:
Quoted 6 lines
From: "McCabe, Robert J" <[email protected]>
Allows br2-externals to inject custom code into the kernel tree.
Signed-off-by McCabe, Robert J <[email protected]>---
Thanks for staying during the back-n-forth. ;-)
Regards,
Yann E. MORIN.
Quoted 67 lines
docs/manual/customize-outside-br.txt | 14 ++++++++++++++ linux/linux.mk | 13 +++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-)docs/manual/customize-outside-br.txt +14
-0@@ -219,6 +219,12 @@ BR2_ROOTFS_OVERLAY=$(BR2_EXTERNAL_BAR_42_PATH)/board/<boardname>/overlay/ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=$(BR2_EXTERNAL_BAR_42_PATH)/board/<boardname>/kernel.config ---- +===== Custom linux-kernel-extensions + + Custom linux extensions (see xref:linux-kernel-ext[]) can be added by + storing them in the `linux/` directory at the root of your + br2-external tree. + ===== Example layout Here is an example layout using all features of br2-external (the sample@@ -315,6 +321,14 @@ illustration, of course): | |$(eval $(toolchain-external-package)) | `---- | + |- linux/Config.ext.in + | |config BR2_LINUX_KERNEL_EXT_EXAMPLE_DRIVER + | | bool "example-external-driver" + | | help + | | Example external driver + | |--- + |- linux/linux-ext-example-driver.mk + | |- configs/my-board_defconfig | |BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BAR_42_PATH)/patches/" | |BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_BAR_42_PATH)/board/my-board/overlay/"linux/linux.mk +9
-5@@ -514,14 +514,19 @@ endef # # 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, -# like below, before we call one of the *-package macro is usally not -# working. +# last directory component in the path. As such, including other Makefiles, +# like below, before we call one of the *-package macros usually doesn't +# work. # However, since the files we include here are in the same directory as # the current Makefile, we are OK. But this is a hard requirement: files -# included here *must* be in the same directory! +# included here *must* either be in this same directory OR within a +# another directory with the name "linux" (in the BR2_EXTERNAL case). include $(sort $(wildcard linux/linux-ext-*.mk)) +#Import linux-kernel-extensions from externals +include $(sort $(wildcard $(foreach ext,$(BR2_EXTERNAL_DIRS), \ + $(ext)/linux/linux-ext-*.mk))) + LINUX_PATCH_DEPENDENCIES += $(foreach ext,$(LINUX_EXTENSIONS),\ $(if $(BR2_LINUX_KERNEL_EXT_$(call UPPERCASE,$(ext))),$(ext))) --2.17.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
Thomas Petazzoni
AppliedPATCH v5 1/1 br2-ext linux-kernel-extensions support
In reply to robert.mccabe at rockwellcollins.comQuoted 9 lines · On Sat, 28 Sep 2019 12:49:37 -0500 robert.mccabe at rockwellcollins.com wrote:
From: "McCabe, Robert J" <[email protected]>
Allows br2-externals to inject custom code into the kernel tree.
Signed-off-by McCabe, Robert J <[email protected]>--- docs/manual/customize-outside-br.txt | 14 ++++++++++++++ linux/linux.mk | 13 +++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-)
Applied to master after tweaking the commit title, making some small improvements in the manual, and adding a missing space in a comment.
Thanks for this contribution, and thanks Yann for following this topic until it reached the point where it can be merged!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com