Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support
@ 2019-09-27 15:26 robert.mccabe at rockwellcollins.com
  2019-09-27 18:05 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: robert.mccabe at rockwellcollins.com @ 2019-09-27 15:26 UTC (permalink / raw)
  To: buildroot

From: "McCabe, Robert J" <robert.mccabe@rockwellcollins.com>

Allows br2-externals to inject custom code into the kernel tree.

Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com>
---
 docs/manual/customize-outside-br.txt | 14 ++++++++++++++
 linux/linux.mk                       | 13 +++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt
index 6ab01bcb1f..0588c478e7 100644
--- a/docs/manual/customize-outside-br.txt
+++ b/docs/manual/customize-outside-br.txt
@@ -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 code may be added to the Linux kernel tree as discussed in
+xref:linux-kernel-ext[] by adding +linux/linux-ext-*.mk+ to the
+br2-external tree.
+
 ===== Example layout

 Here is an example layout using all features of br2-external (the sample
@@ -314,6 +320,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/"
diff --git a/linux/linux.mk b/linux/linux.mk
index 29d2f0ee69..921558eeb2 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -513,14 +513,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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support
  2019-09-27 15:26 [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support robert.mccabe at rockwellcollins.com
@ 2019-09-27 18:05 ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2019-09-27 18:05 UTC (permalink / raw)
  To: buildroot

Robert, All,

On 2019-09-27 10:26 -0500, robert.mccabe at rockwellcollins.com spake thusly:
> From: "McCabe, Robert J" <robert.mccabe@rockwellcollins.com>
> 
> Allows br2-externals to inject custom code into the kernel tree.
> 
> Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com>

Reviewed-by: Yann E. MORIN <yann.morin.1998@free.fr>

However, see a small nitpick below...

> ---
>  docs/manual/customize-outside-br.txt | 14 ++++++++++++++
>  linux/linux.mk                       | 13 +++++++++----
>  2 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt
> index 6ab01bcb1f..0588c478e7 100644
> --- a/docs/manual/customize-outside-br.txt
> +++ b/docs/manual/customize-outside-br.txt
> @@ -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 code may be added to the Linux kernel tree as discussed in

I think the wording is inadequate. We don't really want to discuss
"custom code". The documentation currently does not delves into the
details of what a linux extension does, except it somehow "prepares" the
linux tree; the macro itself is suffixed with _PREPARE_KERNEL:

    09: define FOO_PREPARE_KERNEL
    10:     $(FOO_DIR)/prepare-kernel-tree.sh --linux-dir=$(@D)
    11: endef

I would just rephrase that as:

    Custom linux extensions (see xref:linux-kernel-ext[]) can be added
    by storing them in the `linux/` director at the root of your
    br2-external tree.

But apart from that, I'm OK with the patch.

Regards,
Yann E. MORIN.

> +xref:linux-kernel-ext[] by adding +linux/linux-ext-*.mk+ to the
> +br2-external tree.
> +
>  ===== Example layout
> 
>  Here is an example layout using all features of br2-external (the sample
> @@ -314,6 +320,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/"
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 29d2f0ee69..921558eeb2 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -513,14 +513,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
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support
@ 2019-09-28 17:49 robert.mccabe at rockwellcollins.com
  2019-09-28 19:51 ` Yann E. MORIN
  2019-09-28 20:13 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: robert.mccabe at rockwellcollins.com @ 2019-09-28 17:49 UTC (permalink / raw)
  To: buildroot

From: "McCabe, Robert J" <robert.mccabe@rockwellcollins.com>

Allows br2-externals to inject custom code into the kernel tree.

Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com>
---
 docs/manual/customize-outside-br.txt | 14 ++++++++++++++
 linux/linux.mk                       | 13 +++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt
index 7d3e2b1714..c3fe3d2b80 100644
--- a/docs/manual/customize-outside-br.txt
+++ b/docs/manual/customize-outside-br.txt
@@ -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/"
diff --git a/linux/linux.mk b/linux/linux.mk
index 95bde1aba5..32c0621a24 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support
  2019-09-28 17:49 robert.mccabe at rockwellcollins.com
@ 2019-09-28 19:51 ` Yann E. MORIN
  2019-09-28 20:13 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2019-09-28 19:51 UTC (permalink / raw)
  To: buildroot

Robert, All,

On 2019-09-28 12:49 -0500, robert.mccabe at rockwellcollins.com spake thusly:
> From: "McCabe, Robert J" <robert.mccabe@rockwellcollins.com>
> 
> Allows br2-externals to inject custom code into the kernel tree.
> 
> Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com>
> ---

Acked-by: Yann E. MORIN <yann.morin.1998@free.fr>

Thanks for staying during the back-n-forth. ;-)

Regards,
Yann E. MORIN.

>  docs/manual/customize-outside-br.txt | 14 ++++++++++++++
>  linux/linux.mk                       | 13 +++++++++----
>  2 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt
> index 7d3e2b1714..c3fe3d2b80 100644
> --- a/docs/manual/customize-outside-br.txt
> +++ b/docs/manual/customize-outside-br.txt
> @@ -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/"
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 95bde1aba5..32c0621a24 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -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
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support
  2019-09-28 17:49 robert.mccabe at rockwellcollins.com
  2019-09-28 19:51 ` Yann E. MORIN
@ 2019-09-28 20:13 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2019-09-28 20:13 UTC (permalink / raw)
  To: buildroot

On Sat, 28 Sep 2019 12:49:37 -0500
robert.mccabe at rockwellcollins.com wrote:

> From: "McCabe, Robert J" <robert.mccabe@rockwellcollins.com>
> 
> Allows br2-externals to inject custom code into the kernel tree.
> 
> Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com>
> ---
>  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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-28 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-27 15:26 [Buildroot] [PATCH v5] br2-ext linux-kernel-extensions support robert.mccabe at rockwellcollins.com
2019-09-27 18:05 ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2019-09-28 17:49 robert.mccabe at rockwellcollins.com
2019-09-28 19:51 ` Yann E. MORIN
2019-09-28 20:13 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox