From: "'Cedric Hombourger' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Cedric Hombourger <cedric.hombourger@siemens.com>,
Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
Subject: [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie
Date: Sat, 4 Jan 2025 20:08:58 +0100 [thread overview]
Message-ID: <20250104190859.1879934-1-cedric.hombourger@siemens.com> (raw)
In-Reply-To: <20250103072928.45916-1-arulpandiyan.vadivel@siemens.com>
The linux-libc-dev package that comes with Debian trixie includes
arch-dependent headers for all supported architectures and has its
Architecture set to "all" rather than "any". Match this behavior
when both KERNEL_LIBC_DEV_DEPLOY and KERNEL_LIBC_DEV_ARCH_ALL are
in effect (the latter defaults to "1" for "trixie", while the former
still defaults to "0")
Reported-by: Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
.../linux/files/debian/control.tmpl | 2 +-
.../linux/files/debian/isar/install.tmpl | 37 +++++++++++++++----
meta/recipes-kernel/linux/linux-custom.inc | 6 +++
3 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index f4273ea9..ec0da1ab 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -26,7 +26,7 @@ Package: linux-libc-dev
Build-Profiles: <!nolibcdev kernel>
Section: devel
Provides: linux-kernel-headers
-Architecture: any
+Architecture: ${KERNEL_LIBC_DEV_ARCH}
Description: Linux support headers for userspace development
This package provides userspaces headers from the Linux kernel. These headers
are used by the installed headers for GNU glibc and other system libraries.
diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index 0a7bdd66..6d742f02 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -5,6 +5,16 @@
# Load common stuff
. ${S}/debian/isar/common
+get_kernel_arch() {
+ case "${1}" in
+ amd64|i386) echo "x86";;
+ arm64) echo "arm64";;
+ armhf) echo "arm";;
+ mipsel) echo "mips";;
+ riscv64) echo "riscv";;
+ esac
+}
+
do_install() {
# check if our kernel was configured
@@ -165,13 +175,26 @@ headers_check() {
libc_headers() {
mkdir -p ${deb_libc_hdr_dir}
- ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
- host_arch=$(dpkg-architecture -a${DISTRO_ARCH} -qDEB_HOST_MULTIARCH)
- mkdir ${deb_libc_hdr_dir}/usr/include/${host_arch}
- mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${host_arch}/
-
- mkdir -p ${deb_libc_hdr_cross_dir}
- ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${host_arch}
+ arches="${DISTRO_ARCH}"
+ if echo "${DEB_BUILD_PROFILES}" | grep -q "libcdev-arch-all"; then
+ arches="amd64 armhf arm64 i386 mipsel riscv64"
+ fi
+ for distro_arch in ${arches}; do
+ target_arch=$(dpkg-architecture --force -A${distro_arch} -qDEB_TARGET_MULTIARCH)
+ kernel_arch=$(get_kernel_arch ${distro_arch})
+ [ -n "${kernel_arch}" ] || {
+ echo "fatal: don't know the kernel arch for '${distro_arch}'!" >&2
+ return 1
+ }
+ ${MAKE} O=${O} headers_install ARCH=${kernel_arch} INSTALL_HDR_PATH=${deb_libc_hdr_dir}/usr
+ mkdir ${deb_libc_hdr_dir}/usr/include/${target_arch}
+ mv ${deb_libc_hdr_dir}/usr/include/asm ${deb_libc_hdr_dir}/usr/include/${target_arch}/
+
+ if [ "${distro_arch}" = "${DISTRO_ARCH}" ]; then
+ mkdir -p ${deb_libc_hdr_cross_dir}
+ ${MAKE} O=${O} headers_install INSTALL_HDR_PATH=${deb_libc_hdr_cross_dir}/usr/${target_arch}
+ fi
+ done
}
kernel_tools() {
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index e825d29b..77700a5d 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -39,6 +39,8 @@ LIBSSL_DEP:bullseye = "libssl1.1"
KERNEL_HEADERS_DEBIAN_DEPENDS ?= "libc6, \
${LIBSSL_DEP},"
+KERNEL_LIBC_DEV_ARCH_ALL = "0"
+KERNEL_LIBC_DEV_ARCH_ALL:trixie = "1"
KERNEL_LIBC_DEV_DEPLOY ?= "0"
# Settings that may be changed on a per distro, machine or layer basis
@@ -79,6 +81,7 @@ TEMPLATE_VARS += " \
KERNEL_BUILD_DIR \
KERNEL_FILE \
KERNEL_HEADERS_DEBIAN_DEPENDS \
+ KERNEL_LIBC_DEV_ARCH \
LINUX_VERSION_EXTENSION \
KERNEL_NAME_PROVIDED \
KERNEL_CONFIG_FRAGMENTS \
@@ -214,8 +217,11 @@ def get_additional_build_profiles(d):
profiles = d.getVar('BASE_DISTRO')
if not bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_DEPLOY')):
profiles += ' nolibcdev'
+ elif bb.utils.to_boolean(d.getVar('KERNEL_LIBC_DEV_ARCH_ALL')):
+ profiles += ' libcdev-arch-all'
return profiles
+KERNEL_LIBC_DEV_ARCH = "${@ bb.utils.contains('DEB_BUILD_PROFILES', 'libcdev-arch-all', 'all', 'any', d) }"
DEB_BUILD_PROFILES += "${@get_additional_build_profiles(d)}"
do_prepare_build:prepend() {
--
2.34.1
--
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/20250104190859.1879934-1-cedric.hombourger%40siemens.com.
next prev parent reply other threads:[~2025-01-04 19:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 7:29 [PATCH] linux-custom: generate linux-libc-dev package for all arch 'Arulpandiyan Vadivel' via isar-users
2025-01-03 8:23 ` 'cedric.hombourger@siemens.com' via isar-users
2025-01-04 19:08 ` 'Cedric Hombourger' via isar-users [this message]
2025-01-16 7:01 ` [PATCH v2] linux-custom: generate linux-libc-dev for "all" vs "any" like trixie 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=20250104190859.1879934-1-cedric.hombourger@siemens.com \
--to=isar-users@googlegroups.com \
--cc=arulpandiyan.vadivel@siemens.com \
--cc=cedric.hombourger@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