From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: stefan-koch@siemens.com, jan.kiszka@siemens.com,
anaumann@emlix.com,
Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 2/4] linux-custom: fix name collision on cross profile
Date: Thu, 6 Nov 2025 15:11:20 +0100 [thread overview]
Message-ID: <20251106141122.2887558-3-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20251106141122.2887558-1-felix.moessbauer@siemens.com>
The cross build profile is currently used to control which packages are
built in a DISTRO_ARCH != HOST_ARCH scenario. This is fundamentally
wrong, as the cross profile is one of the standard debian build profiles
which is used to control if sbuild runs in cross mode. Further, the
build profile spec [1] forbids to conditionally generate binary packages
based on this profile. We now split this profile off into a custom one
to not interfere with the standard cross profile.
Due to the split, we now also need to set our cross profile explicitly
in the desired cases, which we now control via the cross-pkgs overrides.
[1] https://wiki.debian.org/BuildProfileSpec#Registered_profile_names
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/recipes-kernel/linux/files/debian/control.tmpl | 6 +++---
meta/recipes-kernel/linux/linux-custom.inc | 10 ++++++++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index 01b1a63f..ee87cf92 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -33,7 +33,7 @@ Description: Linux support headers for userspace development
are used by the installed headers for GNU glibc and other system libraries.
Package: linux-libc-dev-${DISTRO_ARCH}-cross
-Build-Profiles: <!pkg.${BPN}.nolibcdev cross !pkg.${BPN}.kbuild>
+Build-Profiles: <!pkg.${BPN}.nolibcdev pkg.${BPN}.cross !pkg.${BPN}.kbuild>
Section: devel
Provides: linux-kernel-headers-${DISTRO_ARCH}-cross
Architecture: all
@@ -53,7 +53,7 @@ Description: Linux kernel debugging symbols for @KR@
all the necessary debug symbols for the kernel and its modules.
Package: linux-kbuild-${KERNEL_NAME_PROVIDED}
-Build-Profiles: <pkg.${BPN}.kbuild !cross>
+Build-Profiles: <pkg.${BPN}.kbuild !pkg.${BPN}.cross>
Architecture: any
Depends: ${perl:Depends}, ${shlibs:Depends}
Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@
@@ -61,7 +61,7 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@
This is useful for people who need to build external modules
Package: linux-kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross
-Build-Profiles: <pkg.${BPN}.kbuild cross>
+Build-Profiles: <pkg.${BPN}.kbuild pkg.${BPN}.cross>
Architecture: any
Multi-Arch: foreign
Depends: ${perl:Depends}, ${shlibs:Depends}
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 1f46bb31..9dd9abb5 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -110,8 +110,13 @@ KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
# Determine cross-profile override
python() {
- if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-native" not in d.getVar("OVERRIDES").split(":"):
- d.appendVar("OVERRIDES", ":cross-profile")
+ if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")):
+ if "class-native" not in d.getVar("OVERRIDES").split(":"):
+ # cross compiling
+ d.appendVar("OVERRIDES", ":cross-profile")
+ else:
+ # generating -cross packages (in HOST_ARCH) from a -native variant
+ d.appendVar("OVERRIDES", ":cross-pkgs")
}
# Default profiles and provides
@@ -126,6 +131,7 @@ BUILD_PROFILES:cross-profile = "pkg.${BPN}.kernel"
# -native: kbuild package for host
BUILD_PROFILES:class-native = "pkg.${BPN}.kbuild"
+BUILD_PROFILES:append:cross-pkgs = " pkg.${BPN}.cross"
RECIPE_PROVIDES:class-native = " \
linux-headers-${KERNEL_NAME_PROVIDED} \
linux-kbuild-${KERNEL_NAME_PROVIDED}"
--
2.39.5
--
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/20251106141122.2887558-3-felix.moessbauer%40siemens.com.
next prev parent reply other threads:[~2025-11-06 14:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 14:11 [PATCH v3 0/4] propagate distro-specific dependencies of arch all packages 'Felix Moessbauer' via isar-users
2025-11-06 14:11 ` [PATCH v3 1/4] linux-custom: prefix profile names according to BuildProfileSpec 'Felix Moessbauer' via isar-users
2025-11-06 16:55 ` 'Jan Kiszka' via isar-users
2025-11-07 8:19 ` 'MOESSBAUER, Felix' via isar-users
2025-11-06 14:11 ` 'Felix Moessbauer' via isar-users [this message]
2025-11-06 14:11 ` [PATCH v3 3/4] do not add cross profile when building native package 'Felix Moessbauer' via isar-users
2025-11-06 14:11 ` [PATCH v3 4/4] propagate distro-specific dependencies of arch all packages 'Felix Moessbauer' via isar-users
2025-11-07 10:09 ` [PATCH v3 0/4] " Zhihang Wei
2025-11-07 10:20 ` 'MOESSBAUER, Felix' 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=20251106141122.2887558-3-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=anaumann@emlix.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=stefan-koch@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