public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>,
	stefan-koch@siemens.com,
	Adriaan Schmidt <adriaan.schmidt@siemens.com>,
	Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v3 2/5] linux-custom: Model cross-built kbuild package separately
Date: Fri, 17 May 2024 18:35:39 +0200	[thread overview]
Message-ID: <54c70edb8d5334a5aa5983d6559b75e0d552515a.1715963742.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1715963742.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Rename to kbuild package containing tools to cross-build modules
linux-kbuild-<name>-<arch>-cross. The headers package now depends on
either the native kbuild or a cross variant, unconditionally. This
allows to have unstable source packages between native and cross and is
generally cleaner to describe the cross version.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/recipes-kernel/linux/files/debian/control.tmpl  | 12 +++++++++++-
 .../linux/files/debian/isar/common.tmpl              |  2 ++
 .../linux/files/debian/isar/install.tmpl             |  6 +++++-
 meta/recipes-kernel/linux/linux-custom.inc           |  5 +----
 4 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index 6f8f8afe..e0e932a0 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -51,9 +51,19 @@ 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: <kbuild>
+Build-Profiles: <kbuild !cross>
 Architecture: any
 Depends: ${perl:Depends}, ${shlib:Depends}
 Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@
  This package provides kernel 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: <kbuild cross>
+Architecture: any
+Multi-Arch: foreign
+Depends: ${perl:Depends}, ${shlib:Depends}
+Conflicts: linux-kbuild-${KERNEL_NAME_PROVIDED}
+Description: ${KERNEL_NAME_PROVIDED} Linux kbuild scripts and tools for @KR@
+ This package provides kernel kbuild scripts and tools for @KR@
+ This is useful for people who need to build external modules
diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
index e3a1d8a0..86af70c5 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
@@ -11,6 +11,7 @@ KERNEL_PKG_KERN_HEADERS=linux-headers-${KERNEL_NAME_PROVIDED}
 KERNEL_PKG_LIBC_HEADERS=linux-libc-dev
 KERNEL_PKG_LIBC_HEADERS_CROSS=linux-libc-dev-${DISTRO_ARCH}-cross
 KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED}
+KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-${DISTRO_ARCH}-cross
 
 # Force creating debian package with valid host arch for -native build
 # Use a cross build to comply with arch specific kernel defconfigs
@@ -32,6 +33,7 @@ deb_kern_hdr_dir=${deb_top_dir}/${KERNEL_PKG_KERN_HEADERS}
 deb_libc_hdr_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS}
 deb_libc_hdr_cross_dir=${deb_top_dir}/${KERNEL_PKG_LIBC_HEADERS_CROSS}
 deb_kern_kbuild_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD}
+deb_kern_kbuild_cross_dir=${deb_top_dir}/${KERNEL_PKG_KERN_KBUILD_CROSS}
 
 # Array of packages to be generated
 declare -A kern_pkgs
diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index 77856aee..00011517 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -35,7 +35,11 @@ do_install() {
 
     if echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then
         # Install kernel scripts and tools
-        install_kbuild ${deb_kern_kbuild_dir}
+        if echo "${DEB_BUILD_PROFILES}" | grep -q "cross"; then
+            install_kbuild ${deb_kern_kbuild_cross_dir}
+        else
+            install_kbuild ${deb_kern_kbuild_dir}
+        fi
     fi
 
     if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 3fd0c6c2..c54c287f 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -111,9 +111,6 @@ BBCLASSEXTEND:append:cross-profile = " kbuildtarget"
 # build only kernel with the default variant of the recipe
 BUILD_PROFILES:cross-profile = "kernel"
 
-# Select correct kbuild package for isar cross-build
-HEADERS_DEPENDS:cross-profile = ", linux-kbuild-${KERNEL_NAME_PROVIDED}:${HOST_ARCH} | linux-kbuild-${KERNEL_NAME_PROVIDED}"
-
 # -native: kbuild package for host
 BUILD_PROFILES:class-native = "kbuild"
 RECIPE_PROVIDES:class-native = " \
@@ -151,7 +148,7 @@ RECIPE_PROVIDES:remove:cross-profile = " \
     linux-kbuild-${KERNEL_NAME_PROVIDED}"
 
 # Append headers depends
-HEADERS_DEPENDS = ", linux-kbuild-${KERNEL_NAME_PROVIDED}"
+HEADERS_DEPENDS = ", linux-kbuild-${KERNEL_NAME_PROVIDED} | linux-kbuild-${KERNEL_NAME_PROVIDED}-${DISTRO_ARCH}-cross"
 KERNEL_HEADERS_DEBIAN_DEPENDS:append = "${HEADERS_DEPENDS}"
 
 # Append provides
-- 
2.35.3


  parent reply	other threads:[~2024-05-17 16:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 16:35 [PATCH v3 0/5] More kbuild improvements, single-build source packages, cross profile fix Jan Kiszka
2024-05-17 16:35 ` [PATCH v3 1/5] dpkg-base: Fix enabling of cross build profile Jan Kiszka
2024-05-17 16:35 ` Jan Kiszka [this message]
2024-05-17 16:35 ` [PATCH v3 3/5] linux-custom: Resolve native source package differences Jan Kiszka
2024-05-17 16:35 ` [PATCH v3 4/5] dpkg: Retrieve Debian source name from variable Jan Kiszka
2024-05-17 16:35 ` [PATCH v3 5/5] dpkg-source: Build source package only once Jan Kiszka
2024-05-17 16:57 ` [PATCH v3 6/5] testsuite: Build linux-headers for the hikey target Jan Kiszka
2024-05-21 10:29 ` [PATCH v3 0/5] More kbuild improvements, single-build source packages, cross profile fix Koch, Stefan
2024-05-21 10:35   ` Anton Mikanovich
2024-05-21 10:41     ` Jan Kiszka
2024-05-27  9:16       ` Jan Kiszka
2024-05-27 11:05         ` Uladzimir Bely
2024-05-28  5:30           ` Jan Kiszka
2024-05-28  5:38   ` Uladzimir Bely

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=54c70edb8d5334a5aa5983d6559b75e0d552515a.1715963742.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.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