public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Fix single-name single-content rule for kernel packages
@ 2026-08-20  8:03 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic 'Felix Moessbauer' via isar-users
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-1-felix.moessbauer%40siemens.com.

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

* [PATCH v3 1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic
  2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
@ 2026-08-20  8:03 ` 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 2/5] kernel: bind x86_64_defconfig to amd64 architecture instead of machine 'Felix Moessbauer' via isar-users
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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.moessbauer@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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-2-felix.moessbauer%40siemens.com.

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

* [PATCH v3 2/5] kernel: bind x86_64_defconfig to amd64 architecture instead of machine
  2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic 'Felix Moessbauer' via isar-users
@ 2026-08-20  8:03 ` 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 3/5] kernel: make source package architecture specific 'Felix Moessbauer' via isar-users
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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.moessbauer@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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-3-felix.moessbauer%40siemens.com.

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

* [PATCH v3 3/5] kernel: make source package architecture specific
  2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 2/5] kernel: bind x86_64_defconfig to amd64 architecture instead of machine 'Felix Moessbauer' via isar-users
@ 2026-08-20  8:03 ` 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 4/5] kernel: move common parts of linux-mainline to inc 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 5/5] kernel: use architecture specific names for kernels 'Felix Moessbauer' via isar-users
  4 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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.moessbauer@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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-4-felix.moessbauer%40siemens.com.

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

* [PATCH v3 4/5] kernel: move common parts of linux-mainline to inc
  2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
                   ` (2 preceding siblings ...)
  2026-08-20  8:03 ` [PATCH v3 3/5] kernel: make source package architecture specific 'Felix Moessbauer' via isar-users
@ 2026-08-20  8:03 ` 'Felix Moessbauer' via isar-users
  2026-08-20  8:03 ` [PATCH v3 5/5] kernel: use architecture specific names for kernels 'Felix Moessbauer' via isar-users
  4 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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.moessbauer@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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-5-felix.moessbauer%40siemens.com.

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

* [PATCH v3 5/5] kernel: use architecture specific names for kernels
  2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
                   ` (3 preceding siblings ...)
  2026-08-20  8:03 ` [PATCH v3 4/5] kernel: move common parts of linux-mainline to inc 'Felix Moessbauer' via isar-users
@ 2026-08-20  8:03 ` 'Felix Moessbauer' via isar-users
  4 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-08-20  8:03 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, 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.moessbauer@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.
+
 ### 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 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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820080310.3285076-6-felix.moessbauer%40siemens.com.

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

end of thread, other threads:[~2026-08-20  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-20  8:03 [PATCH v3 0/5] Fix single-name single-content rule for kernel packages 'Felix Moessbauer' via isar-users
2026-08-20  8:03 ` [PATCH v3 1/5] testsuite: make test_libc_dev_deploy KERNEL_NAME agnostic 'Felix Moessbauer' via isar-users
2026-08-20  8:03 ` [PATCH v3 2/5] kernel: bind x86_64_defconfig to amd64 architecture instead of machine 'Felix Moessbauer' via isar-users
2026-08-20  8:03 ` [PATCH v3 3/5] kernel: make source package architecture specific 'Felix Moessbauer' via isar-users
2026-08-20  8:03 ` [PATCH v3 4/5] kernel: move common parts of linux-mainline to inc 'Felix Moessbauer' via isar-users
2026-08-20  8:03 ` [PATCH v3 5/5] kernel: use architecture specific names for kernels 'Felix Moessbauer' via isar-users

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