[PATCH 0/5] Fix single-name single-content rule for kernel packages

3 views
Skip to first unread message

Felix Moessbauer

unread,
Aug 13, 2026, 12:45:48 PM (7 days ago) Aug 13
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
Similar to upstream Debian, our kernel source packages are architecture
specific. By that, we also have to encode the architecture (or machine)
in the name of the package. Otherwise existing packages might get
reused on rebuilds with other targets (or multiarch)

In isar, this has ever been modeled incorrectly (the kernels .dsc file
was arch=any despite being arch specific). This is easy to fix, but
also depending on the kernels was done incorrectly (a KERNEL_NAME =
mainline is not specific enough, as mainline on arm64 is technically a
different kernel (source package) than mainline on amd64.

Patch 5 carries the implementation of option (1) from [1].

[1] https://groups.google.com/g/isar-users/c/JmB2FuEXZBU/m/azKokFVsAwAJ

The series has been tested in -t cross, -t kernel CI.

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (5):
testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic
kernel: bind x86_64_defconfig to amd64 architecture instead of machine
kernel: make source package architecture specific
kernel: move common parts of linux-mainline to inc
kernel: use architecture specific names for kernels

RECIPE-API-CHANGELOG.md | 18 ++++++++
meta-isar/conf/machine/beagleplay.conf | 2 +-
meta-isar/conf/machine/de0-nano-soc.conf | 2 +-
meta-isar/conf/machine/hikey.conf | 2 +-
meta-isar/conf/machine/qemuamd64-cip.conf | 2 +-
meta-isar/conf/machine/sifive-fu540.conf | 2 +-
meta-isar/conf/machine/stm32mp15x.conf | 2 +-
.../linux/linux-cip_4.4.166-cip29.bb | 5 ++-
.../recipes-kernel/linux/linux-mainline.inc | 45 +++++++++++++++++++
.../linux/linux-mainline_6.12.85.bb | 39 +---------------
.../recipes-kernel/linux/linux-phy_6.12.85.bb | 2 +-
meta/classes-recipe/linux-kernel.bbclass | 3 +-
.../linux-module/files/debian/control.tmpl | 2 +-
.../linux/files/debian/control.tmpl | 10 ++---
testsuite/citest.py | 23 +++++++---
15 files changed, 100 insertions(+), 59 deletions(-)
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline.inc

--
2.55.0

Jan Kiszka

unread,
Aug 13, 2026, 1:45:30 PM (7 days ago) Aug 13
to Felix Moessbauer, isar-...@googlegroups.com
On 13.08.26 18:44, Felix Moessbauer wrote:
> Similar to upstream Debian, our kernel source packages are architecture
> specific. By that, we also have to encode the architecture (or machine)
> in the name of the package. Otherwise existing packages might get
> reused on rebuilds with other targets (or multiarch)
>
> In isar, this has ever been modeled incorrectly (the kernels .dsc file
> was arch=any despite being arch specific). This is easy to fix, but
> also depending on the kernels was done incorrectly (a KERNEL_NAME =
> mainline is not specific enough, as mainline on arm64 is technically a
> different kernel (source package) than mainline on amd64.
>

It is more complicated than this:

A source packages becomes architecture or even machine-specific if we
bundle the concretely built config file with it. If KERNEL_DEFCONFIG is
empty (default), a kernel source package is actually buildable for any
architecture, thus remains generic.

Now, if the user of our linux-kernel class decides to add a specific
config to the sources, it is now the the question how generic that
config is: only specific to the currently built architecture or even
specific to the selected machine? It is misleading to say, though, that
a source package which carries a machine-specific config is only
arch-specific. It's machine-specific. But hardly anyone would try to
build such a kernel for incompatible machines or even for a different
architectures.

Theoretically, we could even stick multiple configs into the source
package, e.g. the whole cip-kernel-config repo, and select the one used
for a particular target build based on DISTRO_ARCH. That would resolve
the source package issue for such kernels as well.

But I suspect it would still not help us with the native kbuild packages
if they have dependencies on the specific config. Then they would need
to carry the DISTRO_ARCH (the config selector) in their names. Would be
interesting to understand if that already bits us today with the
KERNEL_DEFCONFIG="" case. Did you check?

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Jan Kiszka

unread,
Aug 13, 2026, 1:50:42 PM (7 days ago) Aug 13
to Felix Moessbauer, isar-...@googlegroups.com
On 13.08.26 19:45, Jan Kiszka wrote:
> On 13.08.26 18:44, Felix Moessbauer wrote:
>> Similar to upstream Debian, our kernel source packages are architecture
>> specific. By that, we also have to encode the architecture (or machine)
>> in the name of the package. Otherwise existing packages might get
>> reused on rebuilds with other targets (or multiarch)
>>
>> In isar, this has ever been modeled incorrectly (the kernels .dsc file
>> was arch=any despite being arch specific). This is easy to fix, but
>> also depending on the kernels was done incorrectly (a KERNEL_NAME =
>> mainline is not specific enough, as mainline on arm64 is technically a
>> different kernel (source package) than mainline on amd64.
>>
>
> It is more complicated than this:
>
> A source packages becomes architecture or even machine-specific if we
> bundle the concretely built config file with it. If KERNEL_DEFCONFIG is
> empty (default), a kernel source package is actually buildable for any
> architecture, thus remains generic.

Correction: KERNEL_DEFCONFIG can even be set. The question is whether we
have a conditionally added external config file, and that condition
depends on the architecture or machine. Only that latter step makes the
source package arch or machine-specific. And that is a recipe author
decision...

Jan

Jan Kiszka

unread,
Aug 13, 2026, 2:07:00 PM (7 days ago) Aug 13
to Felix Moessbauer, isar-...@googlegroups.com
On 13.08.26 19:50, Jan Kiszka wrote:
> On 13.08.26 19:45, Jan Kiszka wrote:
>> On 13.08.26 18:44, Felix Moessbauer wrote:
>>> Similar to upstream Debian, our kernel source packages are architecture
>>> specific. By that, we also have to encode the architecture (or machine)
>>> in the name of the package. Otherwise existing packages might get
>>> reused on rebuilds with other targets (or multiarch)
>>>
>>> In isar, this has ever been modeled incorrectly (the kernels .dsc file
>>> was arch=any despite being arch specific). This is easy to fix, but
>>> also depending on the kernels was done incorrectly (a KERNEL_NAME =
>>> mainline is not specific enough, as mainline on arm64 is technically a
>>> different kernel (source package) than mainline on amd64.
>>>
>>
>> It is more complicated than this:
>>
>> A source packages becomes architecture or even machine-specific if we
>> bundle the concretely built config file with it. If KERNEL_DEFCONFIG is
>> empty (default), a kernel source package is actually buildable for any
>> architecture, thus remains generic.
>
> Correction: KERNEL_DEFCONFIG can even be set. The question is whether we
> have a conditionally added external config file, and that condition
> depends on the architecture or machine. Only that latter step makes the
> source package arch or machine-specific. And that is a recipe author
> decision...
>

Wait - it's actually arch or machine specific templating that bites us
here: If KERNEL_DEFCONFIG or any other bitbake variable that influences
the source package content (including the debian/ folder) if differing
across builds while having the same name for the source package, that
will obviously cause a mess. This is also where the CIP kernel from
isar-cip-core gets different source-wise although it has identical
configs on board.

So, the better solution for such multi-purpose kernels is to introduce
build-time config selection, rather than templating.

Felix Moessbauer

unread,
Aug 17, 2026, 7:34:32 AM (3 days ago) Aug 17
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
Similar to upstream Debian, our kernel source packages are architecture
specific. By that, we also have to encode the architecture (or machine)
in the name of the package. Otherwise existing packages might get
reused on rebuilds with other targets (or multiarch)

In isar, this has ever been modeled incorrectly (the kernels .dsc file
was arch=any despite being arch specific). This is easy to fix, but
also depending on the kernels was done incorrectly (a KERNEL_NAME =
mainline is not specific enough, as mainline on arm64 is technically a
different kernel (source package) than mainline on amd64.

Patch 5 carries the implementation of option (1) from [1].

[1] https://groups.google.com/g/isar-users/c/JmB2FuEXZBU/m/azKokFVsAwAJ

The series has been tested in -t cross, -t kernel CI.

Changes since v1:

- no functional change
- rework API changelog and user manual

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (5):
testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic
kernel: bind x86_64_defconfig to amd64 architecture instead of machine
kernel: make source package architecture specific
kernel: move common parts of linux-mainline to inc
kernel: use architecture specific names for kernels

RECIPE-API-CHANGELOG.md | 3 ++
doc/user_manual.md | 13 +++++-
meta-isar/conf/machine/beagleplay.conf | 2 +-
meta-isar/conf/machine/de0-nano-soc.conf | 2 +-
meta-isar/conf/machine/hikey.conf | 2 +-
meta-isar/conf/machine/qemuamd64-cip.conf | 2 +-
meta-isar/conf/machine/sifive-fu540.conf | 2 +-
meta-isar/conf/machine/stm32mp15x.conf | 2 +-
.../linux/linux-cip_4.4.166-cip29.bb | 5 ++-
.../recipes-kernel/linux/linux-mainline.inc | 45 +++++++++++++++++++
.../linux/linux-mainline_6.12.85.bb | 39 +---------------
.../recipes-kernel/linux/linux-phy_6.12.85.bb | 2 +-
meta/classes-recipe/linux-kernel.bbclass | 3 +-
.../linux-module/files/debian/control.tmpl | 2 +-
.../linux/files/debian/control.tmpl | 10 ++---
testsuite/citest.py | 23 +++++++---
16 files changed, 97 insertions(+), 60 deletions(-)

Felix Moessbauer

unread,
Aug 17, 2026, 7:34:32 AM (3 days ago) Aug 17
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
This defconfig is a reasonable default for all amd64 machines. We now
make it the default for that architecture for linux-cip and
linux-mainline. Further, we only add it to the SRC_URI if actually
needed.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb | 3 ++-
meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
index 1f4d75bc..e2775c8d 100644
--- a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
+++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
@@ -13,4 +13,5 @@ SRC_URI += " \

SRCREV = "af3adf9f9c633ac0e1d68487d7fad22285dda8a3"

-KERNEL_DEFCONFIG:qemuamd64-cip = "x86_64_defconfig"
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 10444680..786a9db8 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -11,7 +11,6 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else

SRC_URI += " \
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
- file://x86_64_defconfig \
file://ftpm-module.cfg \
file://subdir \
file://no-root-nfs.cfg;apply=no"
@@ -20,7 +19,8 @@ SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd

S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"

-KERNEL_DEFCONFIG:qemuamd64 = "x86_64_defconfig"
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"

LINUX_VERSION_EXTENSION = "-isar"

--
2.55.0

Felix Moessbauer

unread,
Aug 17, 2026, 7:34:33 AM (3 days ago) Aug 17
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
Currently we mark our kernel source packages as Arch=any all, despite
the content of the package is architecture specific. Here, we make the
package architecture specific by avoiding any Arch=any identifier in the
control file. This results in having Architecture: ${DISTRO_ARCH} all in
the generated .dsc file. The same applies to the custom kernel modules.

A special case is the "linux-kbuild-${KERNEL_NAME_PROVIDED}-
${DISTRO_ARCH}-cross" package, which is specific to the BUILD_ARCH, as
it contains host tooling binaries for the host, which are derived from
the target specific kernel.

Ensuring that we do not generate multiple kernel packages with different
content but the same name (for multiple architectures) will be done in
later commits.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta/classes-recipe/linux-kernel.bbclass | 3 ++-
.../linux-module/files/debian/control.tmpl | 2 +-
meta/recipes-kernel/linux/files/debian/control.tmpl | 10 +++++-----
3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/meta/classes-recipe/linux-kernel.bbclass b/meta/classes-recipe/linux-kernel.bbclass
index ac587b17..74a49aa8 100644
--- a/meta/classes-recipe/linux-kernel.bbclass
+++ b/meta/classes-recipe/linux-kernel.bbclass
@@ -78,6 +78,7 @@ TEMPLATE_FILES += " \

TEMPLATE_VARS += " \
BPN \
+ BUILD_ARCH \
KBUILD_DEPENDS \
KERNEL_ARCH \
KERNEL_DEBIAN_DEPENDS \
@@ -274,7 +275,7 @@ def get_additional_build_profiles(d):
profiles += ' pkg.{}.libcdev-arch-all'.format(d.getVar('BPN'))
return profiles

-KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')), 'all\nMulti-Arch: foreign', 'any', d) }"
+KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.libcdev-arch-all'.format(d.getVar('BPN')), 'all\nMulti-Arch: foreign', d.getVar('DISTRO_ARCH'), d) }"
DEB_BUILD_PROFILES += "${@get_additional_build_profiles(d)}"

do_prepare_build[cleandirs] += "${S}/debian"
diff --git a/meta/recipes-kernel/linux-module/files/debian/control.tmpl b/meta/recipes-kernel/linux-module/files/debian/control.tmpl
index d8f4aded..3c222979 100644
--- a/meta/recipes-kernel/linux-module/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux-module/files/debian/control.tmpl
@@ -7,6 +7,6 @@ Maintainer: ${MAINTAINER}
Rules-Requires-Root: no

Package: ${PN}
-Architecture: any
+Architecture: ${DISTRO_ARCH}
Depends: ${KERNEL_IMAGE_PKG}, kmod
Description: ${DESCRIPTION}
diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index 77c4048b..f89a1f56 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -8,7 +8,7 @@ Rules-Requires-Root: no

Package: linux-image-${KERNEL_NAME_PROVIDED}
Build-Profiles: <pkg.${BPN}.kernel>
-Architecture: any
+Architecture: ${DISTRO_ARCH}
Depends: ${KERNEL_DEBIAN_DEPENDS}
Description: ${KERNEL_NAME_PROVIDED} Linux kernel, version @KR@
This package contains the Linux kernel, modules and corresponding other
@@ -16,7 +16,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kernel, version @KR@

Package: linux-headers-${KERNEL_NAME_PROVIDED}
Build-Profiles: <pkg.${BPN}.kernel>
-Architecture: any
+Architecture: ${DISTRO_ARCH}
Depends: ${KERNEL_HEADERS_DEBIAN_DEPENDS}, ${perl:Depends}, ${shlibs:Depends}
Description: ${KERNEL_NAME_PROVIDED} Linux kernel headers for @KR@
This package provides kernel header files for @KR@ on ${DISTRO_ARCH}
@@ -47,14 +47,14 @@ Description: Linux Kernel Headers for development (for cross-compiling)
Package: linux-image-${KERNEL_NAME_PROVIDED}-dbg
Build-Profiles: <pkg.${BPN}.kernel>
Section: debug
-Architecture: any
+Architecture: ${DISTRO_ARCH}
Description: Linux kernel debugging symbols for @KR@
This package will come in handy if you need to debug the kernel. It provides
all the necessary debug symbols for the kernel and its modules.

Package: linux-kbuild-${KERNEL_NAME_PROVIDED}
Build-Profiles: <pkg.${BPN}.kbuild !pkg.${BPN}.cross>
-Architecture: any
+Architecture: ${DISTRO_ARCH}
Depends: ${perl:Depends}, ${shlibs:Depends}
Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@
This package provides kernel kbuild scripts and tools for @KR@
@@ -62,7 +62,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@

Package: linux-kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross
Build-Profiles: <pkg.${BPN}.kbuild pkg.${BPN}.cross>
-Architecture: any
+Architecture: ${BUILD_ARCH}
Multi-Arch: foreign
Depends: ${perl:Depends}, ${shlibs:Depends}
Conflicts: linux-kbuild-${KERNEL_NAME_PROVIDED}
--
2.55.0

Felix Moessbauer

unread,
Aug 17, 2026, 7:34:34 AM (3 days ago) Aug 17
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The kernel source packages are architecture specific. By that, we also
have to encode the architecture in the KERNEL_NAME, if that is not
already implicitly the case (e.g. when building a kernel for a specific
machine).

For the kernel recipes which are generic (like mainline and cip), we
simply extend the PN with -${DISTRO_ARCH}, so bitbake can find the
dependency and instanciate an architecture specific variant.

By that, we also need to adapt the default in test_per_kernel, which
explicitly builds the module for the kernel that corresponds to the
multiconfig target.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
RECIPE-API-CHANGELOG.md | 3 +++
doc/user_manual.md | 13 ++++++++++++-
meta-isar/conf/machine/beagleplay.conf | 2 +-
meta-isar/conf/machine/de0-nano-soc.conf | 2 +-
meta-isar/conf/machine/hikey.conf | 2 +-
meta-isar/conf/machine/qemuamd64-cip.conf | 2 +-
meta-isar/conf/machine/sifive-fu540.conf | 2 +-
meta-isar/conf/machine/stm32mp15x.conf | 2 +-
.../recipes-kernel/linux/linux-cip_4.4.166-cip29.bb | 2 ++
.../recipes-kernel/linux/linux-mainline_6.12.85.bb | 2 ++
testsuite/citest.py | 2 +-
11 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 2db05169..15b47cce 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1175,6 +1175,9 @@ DPKG_ARCH ?= "${DISTRO_ARCH}"

Firmware packages are an exception because they are built for only one architecture.

+**Note**: This rule also applies to kernel packages. Set `KERNEL_NAME` to an
+architecture- or machine-specific name, as appropriate.
+
### Add Hyper-V machine support

A new machine `hyper-v` has been introduced for building images
diff --git a/doc/user_manual.md b/doc/user_manual.md
index dcc3f560..cb47c157 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -628,11 +628,22 @@ For example, in your machine configuration:

```bitbake
KERNEL_NAME = "armmp"
-KERNEL_NAMES = "armmp mainline"
+KERNEL_NAMES = "armmp mainline-arm64"
```

When `KERNEL_NAMES` is set, recipes inheriting the `per-kernel` class will generate variants for each listed kernel. Installation of each must be explicitly handled in the image.

+Kernel source packages contain architecture-specific content. Therefore, builds
+for multiple architectures must publish source packages with distinct names.
+For a kernel built for only one target, the name may remain unchanged.
+
+Generic kernel recipes can append `${DISTRO_ARCH}` to `PN`, to provide the
+kernel for all architectures.
+
+```
+PN .= "-${DISTRO_ARCH}"
+```
+
---

## Add a New Image
diff --git a/meta-isar/conf/machine/beagleplay.conf b/meta-isar/conf/machine/beagleplay.conf
index d030256d..8cefd939 100644
--- a/meta-isar/conf/machine/beagleplay.conf
+++ b/meta-isar/conf/machine/beagleplay.conf
@@ -5,7 +5,7 @@

DISTRO_ARCH ?= "arm64"

-KERNEL_NAME ?= "mainline"
+KERNEL_NAME ?= "mainline-${DISTRO_ARCH}"

IMAGE_FSTYPES ?= "wic"
WKS_FILE ?= "beagleplay.wks.in"
diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf
index 78f841df..7059822a 100644
--- a/meta-isar/conf/machine/de0-nano-soc.conf
+++ b/meta-isar/conf/machine/de0-nano-soc.conf
@@ -5,7 +5,7 @@

DISTRO_ARCH ?= "armhf"

-KERNEL_NAME ?= "mainline"
+KERNEL_NAME ?= "mainline-${DISTRO_ARCH}"

U_BOOT_CONFIG:de0-nano-soc = "socfpga_de0_nano_soc_defconfig"
U_BOOT_BIN:de0-nano-soc = "u-boot-with-spl.sfp"
diff --git a/meta-isar/conf/machine/hikey.conf b/meta-isar/conf/machine/hikey.conf
index 019e1910..1e696b4d 100644
--- a/meta-isar/conf/machine/hikey.conf
+++ b/meta-isar/conf/machine/hikey.conf
@@ -5,7 +5,7 @@

DISTRO_ARCH = "arm64"

-KERNEL_NAME ?= "mainline"
+KERNEL_NAME ?= "mainline-${DISTRO_ARCH}"

IMAGE_FSTYPES = "wic"
WKS_FILE ?= "hikey"
diff --git a/meta-isar/conf/machine/qemuamd64-cip.conf b/meta-isar/conf/machine/qemuamd64-cip.conf
index e7eaa2d6..9d633362 100644
--- a/meta-isar/conf/machine/qemuamd64-cip.conf
+++ b/meta-isar/conf/machine/qemuamd64-cip.conf
@@ -5,4 +5,4 @@

include conf/machine/qemuamd64.conf

-KERNEL_NAME = "cip"
+KERNEL_NAME = "cip-${DISTRO_ARCH}"
diff --git a/meta-isar/conf/machine/sifive-fu540.conf b/meta-isar/conf/machine/sifive-fu540.conf
index c9bbc57b..07846f99 100644
--- a/meta-isar/conf/machine/sifive-fu540.conf
+++ b/meta-isar/conf/machine/sifive-fu540.conf
@@ -5,7 +5,7 @@

DISTRO_ARCH = "riscv64"

-KERNEL_NAME ?= "mainline"
+KERNEL_NAME ?= "mainline-${DISTRO_ARCH}"

IMAGE_FSTYPES ?= "wic"
WKS_FILE ?= "sifive-fu540"
diff --git a/meta-isar/conf/machine/stm32mp15x.conf b/meta-isar/conf/machine/stm32mp15x.conf
index 7aa410a5..aa453d8f 100644
--- a/meta-isar/conf/machine/stm32mp15x.conf
+++ b/meta-isar/conf/machine/stm32mp15x.conf
@@ -5,7 +5,7 @@

DISTRO_ARCH ?= "armhf"

-KERNEL_NAME ?= "mainline"
+KERNEL_NAME ?= "mainline-${DISTRO_ARCH}"

U_BOOT_CONFIG:stm32mp15x = "stm32mp15_trusted_defconfig"
U_BOOT_BIN:stm32mp15x = "u-boot.stm32"
diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
index e2775c8d..bb196b5a 100644
--- a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
+++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
@@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: MIT

+PN .= "-${DISTRO_ARCH}"
+
inherit linux-kernel

SRC_URI += " \
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 11b90127..13c694b0 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -5,4 +5,6 @@
#
# SPDX-License-Identifier: MIT

+PN .= "-${DISTRO_ARCH}"
+
require recipes-kernel/linux/linux-mainline.inc
diff --git a/testsuite/citest.py b/testsuite/citest.py
index f5d54904..c2ac144a 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -627,7 +627,7 @@ class KernelTests(CIBaseTest):
"""Test per-kernel recipe variants for external kernel modules."""

targets = ['mc:qemuarm64-bookworm:isar-image-ci']
- kernel_names = self.params.get('kernel_names', default='mainline')
+ kernel_names = self.params.get('kernel_names', default='mainline-arm64')
kernel_names = [k.strip() for k in kernel_names.split(',') if k.strip()]
modules = [f"example-module-{k}" for k in kernel_names]
modules.append('example-module-${KERNEL_NAME}')
--
2.55.0

Felix Moessbauer

unread,
Aug 17, 2026, 7:34:34 AM (3 days ago) Aug 17
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
As a preparation to provide linux-mainline for multiple targets, we move
the common parts (currently everything) to an .inc file and include that
in the kernel recipes.

No functional change.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
.../recipes-kernel/linux/linux-mainline.inc | 45 +++++++++++++++++++
.../linux/linux-mainline_6.12.85.bb | 39 +---------------
.../recipes-kernel/linux/linux-phy_6.12.85.bb | 2 +-
3 files changed, 47 insertions(+), 39 deletions(-)
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline.inc

diff --git a/meta-isar/recipes-kernel/linux/linux-mainline.inc b/meta-isar/recipes-kernel/linux/linux-mainline.inc
new file mode 100644
index 00000000..d93c8e51
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/linux-mainline.inc
@@ -0,0 +1,45 @@
+# Example recipe for building the mainline kernel
+#
+# This software is a part of Isar.
+# Copyright (c) Siemens AG, 2026
+#
+# SPDX-License-Identifier: MIT
+
+inherit linux-kernel
+
+ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else d.getVar('PV') }"
+
+SRC_URI += " \
+ https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
+ file://ftpm-module.cfg \
+ file://subdir \
+ file://no-root-nfs.cfg;apply=no"
+
+SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd070aed"
+
+S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
+
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
+
+LINUX_VERSION_EXTENSION = "-isar"
+
+KERNEL_CONFIG_FRAGMENTS = "subdir/no-ubifs-fs.cfg"
+
+check_fragments_applied() {
+ grep -q "# CONFIG_MTD is not set" ${S}/debian/rules ||
+ cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
+ if ! grep "# CONFIG_MTD is not set" \$(O)/.config && \\
+ ! grep "# CONFIG_MTD_UBI is not set" \$(O)/.config; then \\
+ grep "# CONFIG_UBIFS_FS is not set" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_UBIFS_FS still enabled" && exit 1); \\
+ fi
+ grep "CONFIG_ROOT_NFS=y" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_ROOT_NFS not enabled" && exit 1)
+EOF
+}
+
+# For testing purposes only
+dpkg_configure_kernel:append() {
+ check_fragments_applied
+}
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 786a9db8..11b90127 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -5,41 +5,4 @@
#
# SPDX-License-Identifier: MIT

-inherit linux-kernel
-
-ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else d.getVar('PV') }"
-
-SRC_URI += " \
- https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
- file://ftpm-module.cfg \
- file://subdir \
- file://no-root-nfs.cfg;apply=no"
-
-SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd070aed"
-
-S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
-
-SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
-KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
-
-LINUX_VERSION_EXTENSION = "-isar"
-
-KERNEL_CONFIG_FRAGMENTS = "subdir/no-ubifs-fs.cfg"
-
-check_fragments_applied() {
- grep -q "# CONFIG_MTD is not set" ${S}/debian/rules ||
- cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
- if ! grep "# CONFIG_MTD is not set" \$(O)/.config && \\
- ! grep "# CONFIG_MTD_UBI is not set" \$(O)/.config; then \\
- grep "# CONFIG_UBIFS_FS is not set" \$(O)/.config || \\
- (echo "Self-check failed: CONFIG_UBIFS_FS still enabled" && exit 1); \\
- fi
- grep "CONFIG_ROOT_NFS=y" \$(O)/.config || \\
- (echo "Self-check failed: CONFIG_ROOT_NFS not enabled" && exit 1)
-EOF
-}
-
-# For testing purposes only
-dpkg_configure_kernel:append() {
- check_fragments_applied
-}
+require recipes-kernel/linux/linux-mainline.inc
diff --git a/meta-isar/recipes-kernel/linux/linux-phy_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-phy_6.12.85.bb
index a61befe2..33265f6b 100644
--- a/meta-isar/recipes-kernel/linux/linux-phy_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-phy_6.12.85.bb
@@ -1,4 +1,4 @@
-require recipes-kernel/linux/linux-mainline_${PV}.bb
+require recipes-kernel/linux/linux-mainline.inc

SRC_URI:remove = "file://ftpm-module.cfg"
SRC_URI:remove = "file://subdir/no-ubifs-fs.cfg"
--
2.55.0

Jan Kiszka

unread,
Aug 18, 2026, 2:24:05 AM (2 days ago) Aug 18
to Felix Moessbauer, isar-...@googlegroups.com
On 17.08.26 13:34, Felix Moessbauer wrote:
> Currently we mark our kernel source packages as Arch=any all, despite
> the content of the package is architecture specific. Here, we make the

You are still stating something imprecise here, and that should be
fixed: The package is not only architecture specific. It is depending an
a number of variables and files that do have arch dependencies but can
also have more. Please clarify this so that people don't get confused.

> package architecture specific by avoiding any Arch=any identifier in the
> control file. This results in having Architecture: ${DISTRO_ARCH} all in
> the generated .dsc file. The same applies to the custom kernel modules.
>
> A special case is the "linux-kbuild-${KERNEL_NAME_PROVIDED}-
> ${DISTRO_ARCH}-cross" package, which is specific to the BUILD_ARCH, as
> it contains host tooling binaries for the host, which are derived from
> the target specific kernel.
>
> Ensuring that we do not generate multiple kernel packages with different
> content but the same name (for multiple architectures) will be done in
> later commits.

...or different machine configs or even image variants (e.g. debug vs.
production config). It is risky to suggest that just making a kernel
arch-specific would be enough for all scenarios.
Interestingly, Debian does not seem to set an architecture for
linux-headers*. What is the value then, all or any?
And for linux-kbuild, it uses the architecture "linux-any" - what's that?

Jan Kiszka

unread,
Aug 18, 2026, 2:27:05 AM (2 days ago) Aug 18
to Felix Moessbauer, isar-...@googlegroups.com
On 17.08.26 13:34, Felix Moessbauer wrote:
> The kernel source packages are architecture specific. By that, we also
> have to encode the architecture in the KERNEL_NAME, if that is not
> already implicitly the case (e.g. when building a kernel for a specific
> machine).

Same feedback as on patch 3.
Here, you actually exand on the specifics. Maybe add that operation mode
(debug vs. production config) as another variation example so that
people realize what they are doing when customizing the kernel recipes.
Can be more than two sentences if needed.

Jan

Jan Kiszka

unread,
Aug 18, 2026, 2:27:30 AM (2 days ago) Aug 18
to Felix Moessbauer, isar-...@googlegroups.com
On 17.08.26 13:34, Felix Moessbauer wrote:
> This defconfig is a reasonable default for all amd64 machines. We now
> make it the default for that architecture for linux-cip and
> linux-mainline. Further, we only add it to the SRC_URI if actually
> needed.
>

You should leave a reasoning here as well.

> Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
> ---
> meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb | 3 ++-
> meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb | 4 ++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
> index 1f4d75bc..e2775c8d 100644
> --- a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
> +++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
> @@ -13,4 +13,5 @@ SRC_URI += " \
>
> SRCREV = "af3adf9f9c633ac0e1d68487d7fad22285dda8a3"
>
> -KERNEL_DEFCONFIG:qemuamd64-cip = "x86_64_defconfig"
> +SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"

We already have file://x86_64_defconfig in SRC_URI - drop that other
statement then.

> +KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
> diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
> index 10444680..786a9db8 100644
> --- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
> +++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
> @@ -11,7 +11,6 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else
>
> SRC_URI += " \
> https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
> - file://x86_64_defconfig \
> file://ftpm-module.cfg \
> file://subdir \
> file://no-root-nfs.cfg;apply=no"
> @@ -20,7 +19,8 @@ SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd
>
> S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
>
> -KERNEL_DEFCONFIG:qemuamd64 = "x86_64_defconfig"
> +SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
> +KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
>
> LINUX_VERSION_EXTENSION = "-isar"
>

Jan

MOESSBAUER, Felix

unread,
3:45 AM (9 hours ago) 3:45 AM
to Kiszka, Jan, isar-...@googlegroups.com
On Tue, 2026-08-18 at 08:23 +0200, Jan Kiszka wrote:
> On 17.08.26 13:34, Felix Moessbauer wrote:
> > Currently we mark our kernel source packages as Arch=any all, despite
> > the content of the package is architecture specific. Here, we make the
>
> You are still stating something imprecise here, and that should be
> fixed: The package is not only architecture specific. It is depending an
> a number of variables and files that do have arch dependencies but can
> also have more. Please clarify this so that people don't get confused.

Will do in the v3

>
> > package architecture specific by avoiding any Arch=any identifier in the
> > control file. This results in having Architecture: ${DISTRO_ARCH} all in
> > the generated .dsc file. The same applies to the custom kernel modules.
> >
> > A special case is the "linux-kbuild-${KERNEL_NAME_PROVIDED}-
> > ${DISTRO_ARCH}-cross" package, which is specific to the BUILD_ARCH, as
> > it contains host tooling binaries for the host, which are derived from
> > the target specific kernel.
> >
> > Ensuring that we do not generate multiple kernel packages with different
> > content but the same name (for multiple architectures) will be done in
> > later commits.
>
> ...or different machine configs or even image variants (e.g. debug vs.
> production config). It is risky to suggest that just making a kernel
> arch-specific would be enough for all scenarios.

yes

They do. The linux-headers-<version>-<arch> packages are architecture
specific, the linux-headers-<version>-common are arch=all.

In isar we don't split this package.

That's the wildcard for any architecture that uses Linux (in contrast
to any, which would also match gnu-hurd / hurd-i386). As we are Linux
only anyways, this should not matter for us.

Felix

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
Similar to upstream Debian, our kernel source packages are (among others)
architecture specific. By that, we also have to encode the architecture
(or machine) in the name of the package. Otherwise existing packages might
get reused on rebuilds with other targets (or multiarch)

In isar, this has ever been modeled incorrectly (the kernels .dsc file
was arch=any despite being arch specific). This is easy to fix, but
also depending on the kernels was done incorrectly (a KERNEL_NAME =
mainline is not specific enough, as mainline on arm64 is technically a
different kernel (source package) than mainline on amd64.

Patch 5 carries the implementation of option (1) from [1].

[1] https://groups.google.com/g/isar-users/c/JmB2FuEXZBU/m/azKokFVsAwAJ

The series has been tested in -t cross, -t kernel CI.

Changes since v2:

- improve commit messages according to Jan's feedback
- improve API changelog
- p2: drop redundant x86_64_defconfig

Changes since v1:

- no functional change
- rework API changelog and user manual

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (5):
testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic
kernel: bind x86_64_defconfig to amd64 architecture instead of machine
kernel: make source package architecture specific
kernel: move common parts of linux-mainline to inc
kernel: use architecture specific names for kernels

RECIPE-API-CHANGELOG.md | 4 ++
doc/user_manual.md | 13 +++++-
meta-isar/conf/machine/beagleplay.conf | 2 +-
meta-isar/conf/machine/de0-nano-soc.conf | 2 +-
meta-isar/conf/machine/hikey.conf | 2 +-
meta-isar/conf/machine/qemuamd64-cip.conf | 2 +-
meta-isar/conf/machine/sifive-fu540.conf | 2 +-
meta-isar/conf/machine/stm32mp15x.conf | 2 +-
.../linux/linux-cip_4.4.166-cip29.bb | 7 ++-
.../recipes-kernel/linux/linux-mainline.inc | 45 +++++++++++++++++++
.../linux/linux-mainline_6.12.85.bb | 39 +---------------
.../recipes-kernel/linux/linux-phy_6.12.85.bb | 2 +-
meta/classes-recipe/linux-kernel.bbclass | 3 +-
.../linux-module/files/debian/control.tmpl | 2 +-
.../linux/files/debian/control.tmpl | 10 ++---
testsuite/citest.py | 23 +++++++---
16 files changed, 99 insertions(+), 61 deletions(-)
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline.inc

--
2.55.0

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
We currently hard-code the relation between these targets and the
expected recipes that are built. As a preparation to use target specific
kernel names, we generalize the test to read the actual KERNEL_NAME from
the bitbake vars.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
testsuite/citest.py | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/testsuite/citest.py b/testsuite/citest.py
index ca4b7cd8..f5d54904 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -640,6 +640,10 @@ class KernelTests(CIBaseTest):

def test_libc_dev_deploy(self):
"""Test that the linux-libc-dev packages are deployed (parse only)."""
+ def kernel_recipe(target):
+ kernel_name = CIUtils.getVars('KERNEL_NAME', target=target)
+ return f'linux-{kernel_name}'
+
targets = [
'mc:hikey-bookworm:isar-image-ci',
'mc:hikey-trixie:isar-image-ci'
@@ -650,23 +654,28 @@ class KernelTests(CIBaseTest):
self.init()
buildlist, _ = self.generate_dependency_graph(targets, lines=lines)

+ bookworm_kernel = kernel_recipe('mc:hikey-bookworm:isar-image-ci')
+ trixie_kernel = kernel_recipe('mc:hikey-trixie:isar-image-ci')
+
with open(buildlist, 'r') as f:
built = set(line.strip() for line in f if line.strip())

# trixie produces arch=all linux-libc-dev packages, which are built by
# the dedicated -libctarget variant.
self.assertIn(
- 'mc:hikey-trixie:linux-mainline-libctarget', built,
- "trixie: linux-mainline-libctarget (linux-libc-dev is not built)")
+ f'mc:hikey-trixie:{trixie_kernel}-libctarget', built,
+ f"trixie: {trixie_kernel}-libctarget "
+ "(linux-libc-dev is not built)")

# bookworm produces an arch-specific linux-libc-dev, built by the base
# recipe itself; no -libctarget variant is needed.
self.assertIn(
- 'mc:hikey-bookworm:linux-mainline', built,
- "bookworm: linux-mainline (linux-libc-dev is not built)")
+ f'mc:hikey-bookworm:{bookworm_kernel}', built,
+ f"bookworm: {bookworm_kernel} (linux-libc-dev is not built)")
self.assertNotIn(
- 'mc:hikey-bookworm:linux-mainline-libctarget', built,
- "bookworm: unexpected -libctarget variant is built")
+ f'mc:hikey-bookworm:{bookworm_kernel}-libctarget', built,
+ f"bookworm: unexpected {bookworm_kernel}-libctarget "
+ "variant is built")

# The unrelated cip kernel must not be pulled in as libc-dev provider.
for target in built:
--
2.55.0

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
This defconfig is a reasonable default for all amd64 machines. We now
make it the default for that architecture for linux-cip and
linux-mainline.

As a preparation to build architecture specific source packages for the
kernel, we only add the x86 defconfig to the SRC_URI if actually needed.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb | 5 +++--
meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
index 1f4d75bc..cc3a5a0e 100644
--- a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
+++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
@@ -9,8 +9,9 @@ inherit linux-kernel

SRC_URI += " \
git://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git;protocol=https;branch=linux-4.4.y-cip;destsuffix=${P} \
- file://x86_64_defconfig"
+"

SRCREV = "af3adf9f9c633ac0e1d68487d7fad22285dda8a3"

-KERNEL_DEFCONFIG:qemuamd64-cip = "x86_64_defconfig"
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 10444680..786a9db8 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -11,7 +11,6 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else

SRC_URI += " \
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
- file://x86_64_defconfig \
file://ftpm-module.cfg \
file://subdir \
file://no-root-nfs.cfg;apply=no"
@@ -20,7 +19,8 @@ SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd

S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"

-KERNEL_DEFCONFIG:qemuamd64 = "x86_64_defconfig"
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"

LINUX_VERSION_EXTENSION = "-isar"

--
2.55.0

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
As a preparation to provide linux-mainline for multiple targets, we move
the common parts (currently everything) to an .inc file and include that
in the kernel recipes.

No functional change.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
.../recipes-kernel/linux/linux-mainline.inc | 45 +++++++++++++++++++
.../linux/linux-mainline_6.12.85.bb | 39 +---------------
.../recipes-kernel/linux/linux-phy_6.12.85.bb | 2 +-
3 files changed, 47 insertions(+), 39 deletions(-)
create mode 100644 meta-isar/recipes-kernel/linux/linux-mainline.inc
+S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
+
+SRC_URI:append:amd64 = " file://${KERNEL_DEFCONFIG}"
+KERNEL_DEFCONFIG:amd64 = "x86_64_defconfig"
+
+LINUX_VERSION_EXTENSION = "-isar"
+
+KERNEL_CONFIG_FRAGMENTS = "subdir/no-ubifs-fs.cfg"
+
+check_fragments_applied() {
+ grep -q "# CONFIG_MTD is not set" ${S}/debian/rules ||
+ cat << EOF | sed -i '/^override_dh_auto_build/ r /dev/stdin' ${S}/debian/rules
+ if ! grep "# CONFIG_MTD is not set" \$(O)/.config && \\
+ ! grep "# CONFIG_MTD_UBI is not set" \$(O)/.config; then \\
+ grep "# CONFIG_UBIFS_FS is not set" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_UBIFS_FS still enabled" && exit 1); \\
+ fi
+ grep "CONFIG_ROOT_NFS=y" \$(O)/.config || \\
+ (echo "Self-check failed: CONFIG_ROOT_NFS not enabled" && exit 1)
+EOF
+}
+
+# For testing purposes only
+dpkg_configure_kernel:append() {
+ check_fragments_applied
+}
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 786a9db8..11b90127 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -5,41 +5,4 @@
#
# SPDX-License-Identifier: MIT

-inherit linux-kernel
-
-ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else d.getVar('PV') }"
-
-SRC_URI += " \
- https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
- file://ftpm-module.cfg \
- file://subdir \
- file://no-root-nfs.cfg;apply=no"
-
-SRC_URI[sha256sum] = "e35ac999f40a6874493d8d60f33f1150d7a89ae5841c428da82257fbcd070aed"
-
-S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
-

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
Currently we mark our kernel source packages as Arch=any all, despite
the content of the package is specific to the architecture and possibly
machine and other aspects. While the machine and other variables that
influence the content of the package should be encoded in the kernel
name, the architecture should align with the machine arch.

We now make the package architecture specific by avoiding any Arch=any
identifier in the control file. This results in having
Architecture: ${DISTRO_ARCH} all in the generated .dsc file. The same
applies to the custom kernel modules.

A special case is the "linux-kbuild-${KERNEL_NAME_PROVIDED}-
${DISTRO_ARCH}-cross" package, which is specific to the BUILD_ARCH, as
it contains host tooling binaries for the host, which are derived from
the target specific kernel.

Ensuring that we do not generate multiple kernel packages with different
content but the same name (e.g. from different machine configs or image
variants like prod / debug configs) will be done in later commits.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
--
2.55.0

Felix Moessbauer

unread,
4:03 AM (8 hours ago) 4:03 AM
to isar-...@googlegroups.com, jan.k...@siemens.com, Felix Moessbauer
The kernel source packages are specific to at least the architecture,
but also other aspects like machine and prod / debug configurations.

The linux-mainline and linux-cip kernels here are only architecture
specific, so we now encode the architecture in the KERNEL_NAME. For other
kernels that are already specific to a machine, we don't encode the
architecture in the name as this would be redundant.

For the kernel recipes which are generic (like mainline and cip), we
simply extend the PN with -${DISTRO_ARCH}, so bitbake can find the
dependency and instanciate an architecture specific variant.

By that, we also need to adapt the default in test_per_kernel, which
explicitly builds the module for the kernel that corresponds to the
multiconfig target.

Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
RECIPE-API-CHANGELOG.md | 4 ++++
doc/user_manual.md | 13 ++++++++++++-
meta-isar/conf/machine/beagleplay.conf | 2 +-
meta-isar/conf/machine/de0-nano-soc.conf | 2 +-
meta-isar/conf/machine/hikey.conf | 2 +-
meta-isar/conf/machine/qemuamd64-cip.conf | 2 +-
meta-isar/conf/machine/sifive-fu540.conf | 2 +-
meta-isar/conf/machine/stm32mp15x.conf | 2 +-
.../recipes-kernel/linux/linux-cip_4.4.166-cip29.bb | 2 ++
.../recipes-kernel/linux/linux-mainline_6.12.85.bb | 2 ++
testsuite/citest.py | 2 +-
11 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 2db05169..15b608dd 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1175,6 +1175,10 @@ DPKG_ARCH ?= "${DISTRO_ARCH}"

Firmware packages are an exception because they are built for only one architecture.

+**Note**: This rule also applies to kernel packages. Set `KERNEL_NAME` to an
+architecture- or machine-specific name, as appropriate. If the kernel is built
+in different modes (such as prod or debug), encode the mode in the name too.
+
diff --git a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
index cc3a5a0e..e2e51304 100644
--- a/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
+++ b/meta-isar/recipes-kernel/linux/linux-cip_4.4.166-cip29.bb
@@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: MIT

+PN .= "-${DISTRO_ARCH}"
+
inherit linux-kernel

SRC_URI += " \
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
index 11b90127..13c694b0 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.12.85.bb
@@ -5,4 +5,6 @@
#
# SPDX-License-Identifier: MIT

+PN .= "-${DISTRO_ARCH}"
+
require recipes-kernel/linux/linux-mainline.inc
diff --git a/testsuite/citest.py b/testsuite/citest.py
index f5d54904..c2ac144a 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -627,7 +627,7 @@ class KernelTests(CIBaseTest):
"""Test per-kernel recipe variants for external kernel modules."""

targets = ['mc:qemuarm64-bookworm:isar-image-ci']
- kernel_names = self.params.get('kernel_names', default='mainline')
+ kernel_names = self.params.get('kernel_names', default='mainline-arm64')
kernel_names = [k.strip() for k in kernel_names.split(',') if k.strip()]
modules = [f"example-module-{k}" for k in kernel_names]
modules.append('example-module-${KERNEL_NAME}')
--
2.55.0

Jan Kiszka

unread,
4:13 AM (8 hours ago) 4:13 AM
to Moessbauer, Felix (FT RPD CED OES-DE), isar-...@googlegroups.com
On 20.08.26 09:45, Moessbauer, Felix (FT RPD CED OES-DE) wrote:
> On Tue, 2026-08-18 at 08:23 +0200, Jan Kiszka wrote:
>> On 17.08.26 13:34, Felix Moessbauer wrote:>>> @@ -62,7 +62,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kbuild
scripts and tools for @KR@
>>>
>>> Package: linux-kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross
>>> Build-Profiles: <pkg.${BPN}.kbuild pkg.${BPN}.cross>
>>> -Architecture: any
>>> +Architecture: ${BUILD_ARCH}
>>> Multi-Arch: foreign
>>> Depends: ${perl:Depends}, ${shlibs:Depends}
>>> Conflicts: linux-kbuild-${KERNEL_NAME_PROVIDED}
>>
>> And for linux-kbuild, it uses the architecture "linux-any" - what's that?
>
> That's the wildcard for any architecture that uses Linux (in contrast
> to any, which would also match gnu-hurd / hurd-i386). As we are Linux
> only anyways, this should not matter for us.
>
In other words, Debian uses "any" here.

MOESSBAUER, Felix

unread,
4:29 AM (8 hours ago) 4:29 AM
to Kiszka, Jan, isar-...@googlegroups.com

Well... Yes, but this in the end is identical to build arch, as long as
the generated source package is not shared across build hosts.

But good point. We probably want to drop this patch, as I was looking
at the linux-signed-<arch> packages which are indeed architecture
specific. But the generic linux package is not (and the linux-kbuild is
part of the "linux" package, while the kernels and headers are part of
the "linux-signed-<arch>" package). As we don't do this split IMHO both
variants are fine, but dropping this patch is simpler.

Felix

Reply all
Reply to author
Forward
0 new messages