mbox series

[v5,0/4] linux-custom: Split up binaries from kernel headers to kbuild package

Message ID 20240131160001.322247-1-stefan-koch@siemens.com
Headers show
Series linux-custom: Split up binaries from kernel headers to kbuild package | expand

Message

Koch, Stefan Jan. 31, 2024, 3:59 p.m. UTC
Hi

This updated v5 patchset implement suggestions from reviewed v4 patchset.
It's now a set of four patches:
- linux-custom: Set PROVIDES variable using bitbake overrides
- linux-custom: Split up binaries from kernel headers to kbuild package
- linux-custom: Provide target and host specific kernel kbuild packages
- docs: Update custom_kernel docs for split up of kernel scripts and tools

The first commit sets the PROVIDES variable using
bitbake overrides instead of python code.

Swap out the binaries from the kernel headers
into kernel kbuild package is the main use-case
introduced by the second commit
"Split up binaries from kernel headers to kbuild package"

The third commit "Provide target and host specific kernel kbuild packages"
introduces that the binaries could be swapped out into host and target
specific kernel kbuild packages.

These are the main development goals:

1. Solve already known isar custom kernel
limitations from doc/custom_kernel.inc
- kernel headers package does not support both native
  and cross compilation of kernel modules when cross built

2. Honor recommendations for future from doc/custom_kernel.inc
- Generate kernel headers packages for both host and target
  when using cross build

3. Add extensions known from debian kernel packages structure
- Generate a kernel headers package without binaries
- Create specific kernel kbuild packages that
  will ship the "scripts" and "tools" binaries
- Use symlinks to point to the "scripts" and "tools" binaries

4. Be user friendly
- Avoid redundant configuration of kernel source definitions with user
  actions to enable kbuild package generation
- Use already known way to include linux-custom.inc in just one
  own bitbake recipe that provides the kernel source definitions
- Keep known user behavior for existing build configurations:
  just update isar, and use the new linux-kbuild bitbake target
  to create the kbuild target package when cross building

Best regards

Stefan

Stefan Koch (4):
  linux-custom: Set PROVIDES variable using bitbake overrides
  linux-custom: Split up binaries from kernel headers to kbuild package
  linux-custom: Provide target and host specific kernel kbuild packages
  docs: Update custom_kernel docs for split up of kernel scripts and
    tools

 doc/custom_kernel.md                          | 18 +++--
 .../linux/classes/kbuildtarget.bbclass        |  8 ++
 .../linux/files/debian/control.tmpl           | 15 +++-
 .../linux/files/debian/isar/build.tmpl        | 13 +++-
 .../linux/files/debian/isar/common.tmpl       | 11 +++
 .../linux/files/debian/isar/install.tmpl      | 75 ++++++++++++++-----
 meta/recipes-kernel/linux/linux-custom.inc    | 70 +++++++++++++----
 7 files changed, 167 insertions(+), 43 deletions(-)
 create mode 100644 meta/recipes-kernel/linux/classes/kbuildtarget.bbclass

Comments

MOESSBAUER, Felix Feb. 6, 2024, 12:51 p.m. UTC | #1
Hi Stefan,

this works as expected and is a great improvement.
Thanks for the contribution.

Tested-by: Felix Moessbauer <felix.moessbauer@siemens.com>

BR Felix

On Wed, 2024-01-31 at 16:59 +0100, Stefan Koch wrote:
> Hi
> 
> This updated v5 patchset implement suggestions from reviewed v4
> patchset.
> It's now a set of four patches:
> - linux-custom: Set PROVIDES variable using bitbake overrides
> - linux-custom: Split up binaries from kernel headers to kbuild
> package
> - linux-custom: Provide target and host specific kernel kbuild
> packages
> - docs: Update custom_kernel docs for split up of kernel scripts and
> tools
> 
> The first commit sets the PROVIDES variable using
> bitbake overrides instead of python code.
> 
> Swap out the binaries from the kernel headers
> into kernel kbuild package is the main use-case
> introduced by the second commit
> "Split up binaries from kernel headers to kbuild package"
> 
> The third commit "Provide target and host specific kernel kbuild
> packages"
> introduces that the binaries could be swapped out into host and
> target
> specific kernel kbuild packages.
> 
> These are the main development goals:
> 
> 1. Solve already known isar custom kernel
> limitations from doc/custom_kernel.inc
> - kernel headers package does not support both native
>   and cross compilation of kernel modules when cross built
> 
> 2. Honor recommendations for future from doc/custom_kernel.inc
> - Generate kernel headers packages for both host and target
>   when using cross build
> 
> 3. Add extensions known from debian kernel packages structure
> - Generate a kernel headers package without binaries
> - Create specific kernel kbuild packages that
>   will ship the "scripts" and "tools" binaries
> - Use symlinks to point to the "scripts" and "tools" binaries
> 
> 4. Be user friendly
> - Avoid redundant configuration of kernel source definitions with
> user
>   actions to enable kbuild package generation
> - Use already known way to include linux-custom.inc in just one
>   own bitbake recipe that provides the kernel source definitions
> - Keep known user behavior for existing build configurations:
>   just update isar, and use the new linux-kbuild bitbake target
>   to create the kbuild target package when cross building
> 
> Best regards
> 
> Stefan
> 
> Stefan Koch (4):
>   linux-custom: Set PROVIDES variable using bitbake overrides
>   linux-custom: Split up binaries from kernel headers to kbuild
> package
>   linux-custom: Provide target and host specific kernel kbuild
> packages
>   docs: Update custom_kernel docs for split up of kernel scripts and
>     tools
> 
>  doc/custom_kernel.md                          | 18 +++--
>  .../linux/classes/kbuildtarget.bbclass        |  8 ++
>  .../linux/files/debian/control.tmpl           | 15 +++-
>  .../linux/files/debian/isar/build.tmpl        | 13 +++-
>  .../linux/files/debian/isar/common.tmpl       | 11 +++
>  .../linux/files/debian/isar/install.tmpl      | 75 ++++++++++++++---
> --
>  meta/recipes-kernel/linux/linux-custom.inc    | 70 +++++++++++++----
>  7 files changed, 167 insertions(+), 43 deletions(-)
>  create mode 100644 meta/recipes-
> kernel/linux/classes/kbuildtarget.bbclass
>