* [PATCH] linux-custom: Generate cross linux-libc-dev package
@ 2023-08-30 4:50 Uladzimir Bely
2023-09-13 5:29 ` Uladzimir Bely
2025-09-10 13:23 ` 'Jan Kiszka' via isar-users
0 siblings, 2 replies; 4+ 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] 4+ 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
2025-09-10 13:23 ` 'Jan Kiszka' via isar-users
1 sibling, 0 replies; 4+ 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] 4+ 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
@ 2025-09-10 13:23 ` 'Jan Kiszka' via isar-users
2025-09-10 15:32 ` 'Jan Kiszka' via isar-users
1 sibling, 1 reply; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-09-10 13:23 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 30.08.23 06:50, 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>
> ---
> 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.
> +
No idea why this was missed, but when you actually need the package like
I do now, it's quickly clear what all went wrong here. Fix is being
tested...
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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/3b098b4e-b8b8-474b-8898-901f9f83b283%40siemens.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] linux-custom: Generate cross linux-libc-dev package
2025-09-10 13:23 ` 'Jan Kiszka' via isar-users
@ 2025-09-10 15:32 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-09-10 15:32 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 10.09.25 15:23, 'Jan Kiszka' via isar-users wrote:
> On 30.08.23 06:50, 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>
>> ---
>> 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.
>> +
>
> No idea why this was missed, but when you actually need the package like
> I do now, it's quickly clear what all went wrong here. Fix is being
> tested...
False alarm here.
Turned out that this change is not to blame for breakages I see, rather
only "linux-custom: support to add linux-libc-dev package with kernel
name". That other patch forgot to add a "Provides:
linux-libc-dev-${DISTRO_ARCH}-cross" while renaming the generated package.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
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/03c7789e-90f7-4eea-b836-6dbf8eec92c5%40siemens.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-10 15:33 UTC | newest]
Thread overview: 4+ 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
2025-09-10 13:23 ` 'Jan Kiszka' via isar-users
2025-09-10 15:32 ` 'Jan Kiszka' via isar-users
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox