public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-custom: Generate cross linux-libc-dev package
@ 2023-08-30  4:50 Uladzimir Bely
  2023-09-13  5:29 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Uladzimir Bely @ 2023-08-30  4:50 UTC (permalink / raw)
  To: isar-users

In addition to `linux-libc-dev`, install cross-variant of this package
when "cross" debian profile is enabled.

This should allow to cross-compile packages depending on custom
kernel headers with different version than in debian packages.
Typical case - building bookworm system (with linuix-libc-dev-6.1.*)
against custom kernel with a lower version (e.g., 5.4).

With this patch, when such a package is built, debian-provided package
`linux-libc-dev-<ARCH>-cross` will have an alternative package provided
by custom linux recipe so that sbuild could replace (downgrade) it.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/recipes-kernel/linux/files/debian/control.tmpl   | 11 +++++++++++
 .../linux/files/debian/isar/common.tmpl               |  2 ++
 .../linux/files/debian/isar/install.tmpl              |  3 +++
 3 files changed, 16 insertions(+)

diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index dd0b6245..956db3e3 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -29,6 +29,17 @@ 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.
 
+Package: linux-libc-dev-${DISTRO_ARCH}-cross
+Build-Profiles: <!nolibcdev cross>
+Section: devel
+Provides: linux-kernel-headers-${DISTRO_ARCH}-cross
+Architecture: all
+Description: Linux Kernel Headers for development (for cross-compiling)
+ This package provides headers from the Linux kernel.  These headers
+ are used by the installed headers for GNU glibc and other system
+ libraries. They are NOT meant to be used to build third-party modules for
+ your kernel. Use linux-headers-* packages for that.
+
 Package: linux-image-${KERNEL_NAME_PROVIDED}-dbg
 Section: debug
 Architecture: any
diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
index 52ebebb0..9babf9a4 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
@@ -9,6 +9,7 @@ ARCH=${KERNEL_ARCH}
 KERNEL_PKG_IMAGE=linux-image-${KERNEL_NAME_PROVIDED}
 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
 
 # Constants
 KCONF=.config
@@ -19,6 +20,7 @@ deb_img_dir=${deb_top_dir}/${KERNEL_PKG_IMAGE}
 deb_dbg_dir=${deb_img_dir}-dbg
 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}
 
 # 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 8a604e45..e91d33bb 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -152,6 +152,9 @@ libc_headers() {
     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}
 }
 
 kernel_tools() {
-- 
2.20.1


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

* Re: [PATCH] linux-custom: Generate cross linux-libc-dev package
  2023-08-30  4:50 [PATCH] linux-custom: Generate cross linux-libc-dev package Uladzimir Bely
@ 2023-09-13  5:29 ` Uladzimir Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2023-09-13  5:29 UTC (permalink / raw)
  To: isar-users

On Wed, 2023-08-30 at 06:50 +0200, Uladzimir Bely wrote:
> In addition to `linux-libc-dev`, install cross-variant of this
> package
> when "cross" debian profile is enabled.
> 
> This should allow to cross-compile packages depending on custom
> kernel headers with different version than in debian packages.
> Typical case - building bookworm system (with linuix-libc-dev-6.1.*)
> against custom kernel with a lower version (e.g., 5.4).
> 
> With this patch, when such a package is built, debian-provided
> package
> `linux-libc-dev-<ARCH>-cross` will have an alternative package
> provided
> by custom linux recipe so that sbuild could replace (downgrade) it.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>

Applied to next.

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

end of thread, other threads:[~2023-09-13  5:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30  4:50 [PATCH] linux-custom: Generate cross linux-libc-dev package Uladzimir Bely
2023-09-13  5:29 ` Uladzimir Bely

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