@@ -566,3 +566,34 @@ supported, but a warning is issued when it is used. Future versions will drop
When building a custom kernel module, the `KBuild` file might be located in
a subdirectory. To support this use-case, set `MODULE_DIR=$(PWD)/subdir` in
the module build recipe.
+
+### Split up binaries from kernel headers to kbuild package for linux-custom
+
+Swap out the binaries from the kernel headers
+into kernel kbuild package.
+
+ * Split up binaries from kernel headers to kbuild package:
+ Introduce specific kernel kbuild packages that
+ ship the "scripts" and "tools" binaries.
+ The kernel headers fulfill this using symlinks to point
+ to the "scripts" and "tools" of the kernel kbuild package.
+
+ * Provide target and host specific kernel kbuild packages:
+ Introduce target and host specific kernel kbuild packages that
+ ship the "scripts" and "tools" binaries.
+
+ The "-kbuildtarget" and "-native" multiarch bitbake targets are useable to
+ run additional target or host specific builds for kbuild scripts and tools.
+
+ Using the "-kbuildtarget" bitbake target enables the build of
+ a target specific kbuild package at cross builds.
+ So using "linux-kbuild" provides the package for the target platform.
+
+ Using the "-native" bitbake target enables the build of
+ a host specific kbuild package at cross builds.
+ When cross building using "linux-kbuild-native"
+ provides the package for the host platform.
+
+ Only the "host" specific package is built automatically at cross builds.
+
+ * Support emulated module build with cross-compiled kernel for linux-module
@@ -38,12 +38,18 @@ The linux-custom recipe provides support for:
7. Allow the name of the kernel image to be changed via `KERNEL_FILE` (defaults
to `vmlinuz`)
- 8. Produce a `linux-headers` package which includes kernel headers and kbuild
- scripts/tools
+ 8. Produce a `linux-headers` package which includes kernel headers
- 9. The `linux-headers` package shall support native and cross compiles of
- out-of-tree kernel modules. However, when built in cross-compilation mode,
- it cannot be used on the target so far.
+ 9. Produce a `linux-kbuild` package for both `target` and `host` arch
+ which includes kbuild scripts and tools.
+ Using `linux-kbuild` provides the package for the target and when
+ cross building `linux-kbuild-native` provides the package for the host.
+
+ So the `linux-headers` package supports native and cross compiles of
+ out-of-tree kernel modules. Even, when built in cross-compilation mode,
+ it can be used on the target using the `linux-kbuild` package.
+
+ Only the `host` specific package is built automatically at cross builds.
10. Produce a `linux-libc-dev` package to support user-land builds
@@ -72,8 +78,6 @@ In the future, the recipe may be extended to:
3. Be compatible with Ubuntu
- 4. When cross-building, generate kernel-headers for both host and target
-
## Examples
The linux-custom recipe is currently used by the linux-mainline package and is
Signed-off-by: Stefan Koch <stefan-koch@siemens.com> --- RECIPE-API-CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ doc/custom_kernel.md | 18 +++++++++++------- 2 files changed, 42 insertions(+), 7 deletions(-)