From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com, Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 3/5] kernel: make source package architecture specific
Date: Thu, 20 Aug 2026 10:03:08 +0200 [thread overview]
Message-ID: <20260820080310.3285076-4-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260820080310.3285076-1-felix.moessbauer@siemens.com>
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.
next prev parent reply other threads:[~2026-08-20 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820080310.3285076-4-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox