[V2] linux-custom: support to add linux-libc-dev package with kernel name

Message ID 20250113080753.72286-1-arulpandiyan.vadivel@siemens.com
State New
Headers show
Series [V2] linux-custom: support to add linux-libc-dev package with kernel name | expand

Commit Message

Arulpandiyan Vadivel Jan. 13, 2025, 8:07 a.m. UTC
Debian and Ubuntu use unified kernel headers and a single linux-libc-dev
package is shipped. In contrast, Isar may build multiple kernel variants
with different versions and/or patches and their packages.
But linux-libc-dev are suffixed with -${KERNEL_NAME_PROVIDED}: this allows
each variant to exist in isar-apt (reprepro may not have more than one
version of a given package for a given suite).
Apply the same suffix to linux-libc-dev and a Provides: clause.

Signed-off-by: Arulpandiyan Vadivel <arulpandiyan.vadivel@siemens.com>
---
 doc/custom_kernel.md                                   |  2 +-
 meta/recipes-kernel/linux/files/debian/control.tmpl    | 10 +++++++---
 .../recipes-kernel/linux/files/debian/isar/common.tmpl |  4 ++--
 .../linux/files/debian/isar/install.tmpl               |  2 +-
 meta/recipes-kernel/linux/linux-custom.inc             |  2 ++
 5 files changed, 13 insertions(+), 7 deletions(-)

Comments

cedric.hombourger@siemens.com Jan. 13, 2025, 2:04 p.m. UTC | #1
On Mon, 2025-01-13 at 13:37 +0530, Arulpandiyan Vadivel wrote:
> Debian and Ubuntu use unified kernel headers and a single linux-libc-
> dev
> package is shipped. In contrast, Isar may build multiple kernel
> variants
> with different versions and/or patches and their packages.
> But linux-libc-dev are suffixed with -${KERNEL_NAME_PROVIDED}: this

There was not "." between "their packages" and "but" in my proposal
because "but" in that context really meant "except". This changes the
meaning.

Carefully review the git commit log and make sure it makes sense. You
do not have to go with the version I proposed (was just a proposal); we
need to make sure that the problem statement and solution are clear and
relevant to isar-users

> allows
> each variant to exist in isar-apt (reprepro may not have more than
> one
> version of a given package for a given suite).
> Apply the same suffix to linux-libc-dev and a Provides: clause.
> 
> Signed-off-by: Arulpandiyan Vadivel
> <arulpandiyan.vadivel@siemens.com>
> ---
>  doc/custom_kernel.md                                   |  2 +-
>  meta/recipes-kernel/linux/files/debian/control.tmpl    | 10 +++++++-
> --
>  .../recipes-kernel/linux/files/debian/isar/common.tmpl |  4 ++--
>  .../linux/files/debian/isar/install.tmpl               |  2 +-
>  meta/recipes-kernel/linux/linux-custom.inc             |  2 ++
>  5 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/custom_kernel.md b/doc/custom_kernel.md
> index ce5f1bf7..89c7c088 100644
> --- a/doc/custom_kernel.md
> +++ b/doc/custom_kernel.md
> @@ -51,7 +51,7 @@ The linux-custom recipe provides support for:
>  
>      Only the `host` specific package is built automatically at cross
> builds.
>  
> - 10. Produce a `linux-libc-dev` package to support user-land builds
> + 10. Produce a `linux-libc-dev-${KERNEL_NAME_PROVIDED}` package to
> support user-land builds
>  
>   11. Only build/ship the `linux-libc-dev` package if instructed to
>       (`KERNEL_LIBC_DEV_DEPLOY` equals to `"1"`)
> diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl
> b/meta/recipes-kernel/linux/files/debian/control.tmpl
> index 04ad0f4f..e440b492 100644
> --- a/meta/recipes-kernel/linux/files/debian/control.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
> @@ -22,19 +22,23 @@ Description: ${KERNEL_NAME_PROVIDED} Linux kernel
> headers for @KR@
>   .
>   This is useful for people who need to build external modules
>  
> -Package: linux-libc-dev
> +Package: linux-libc-dev-${KERNEL_NAME_PROVIDED}
>  Build-Profiles: <!nolibcdev kernel>
>  Section: devel
> -Provides: linux-kernel-headers
> +Conflicts: linux-libc-dev
> +Provides: linux-libc-dev
> +Replaces: linux-libc-dev
>  Architecture: any
>  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
> +Package: linux-libc-dev-${DISTRO_ARCH}-cross-${KERNEL_NAME_PROVIDED}
>  Build-Profiles: <!nolibcdev cross !kbuild>
>  Section: devel
> +Conflicts: linux-kernel-headers-${DISTRO_ARCH}-cross
>  Provides: linux-kernel-headers-${DISTRO_ARCH}-cross
> +Replaces: 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
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
> index def8480e..b200930c 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
> @@ -8,8 +8,8 @@ set -e
>  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
> +KERNEL_PKG_LIBC_HEADERS=linux-libc-dev-${KERNEL_NAME_PROVIDED}
> +KERNEL_PKG_LIBC_HEADERS_CROSS=linux-libc-dev-${DISTRO_ARCH}-cross-
> ${KERNEL_NAME_PROVIDED}
>  KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED}
>  KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-
> ${DISTRO_ARCH}-cross
>  
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> index 0a7bdd66..e1602b9d 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -225,7 +225,7 @@ install_headers() {
>      if dpkg --compare-versions "${krel}" "lt" "5.4.24"; then
>          headers_check
>      fi
> -    [ -z ${kern_pkgs["linux-libc-dev"]} ] || libc_headers
> +    [ -z ${kern_pkgs["linux-libc-dev-${KERNEL_NAME_PROVIDED}"]} ] ||
> libc_headers
>      kernel_headers
>  }
>  
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index bf6c879b..f67bba2b 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -146,7 +146,9 @@ RECIPE_PROVIDES = " \
>      linux-image-${KERNEL_NAME_PROVIDED} \
>      linux-headers-${KERNEL_NAME_PROVIDED} \
>      linux-libc-dev \
> +    linux-libc-dev-${KERNEL_NAME_PROVIDED} \
>      linux-libc-dev-${DISTRO_ARCH}-cross \
> +    linux-libc-dev-${DISTRO_ARCH}-cross-${KERNEL_NAME_PROVIDED} \
>      linux-image-${KERNEL_NAME_PROVIDED}-dbg \
>      linux-kbuild-${KERNEL_NAME_PROVIDED} \
>      ${BPN}-pseudo-native \

Patch

diff --git a/doc/custom_kernel.md b/doc/custom_kernel.md
index ce5f1bf7..89c7c088 100644
--- a/doc/custom_kernel.md
+++ b/doc/custom_kernel.md
@@ -51,7 +51,7 @@  The linux-custom recipe provides support for:
 
     Only the `host` specific package is built automatically at cross builds.
 
- 10. Produce a `linux-libc-dev` package to support user-land builds
+ 10. Produce a `linux-libc-dev-${KERNEL_NAME_PROVIDED}` package to support user-land builds
 
  11. Only build/ship the `linux-libc-dev` package if instructed to
      (`KERNEL_LIBC_DEV_DEPLOY` equals to `"1"`)
diff --git a/meta/recipes-kernel/linux/files/debian/control.tmpl b/meta/recipes-kernel/linux/files/debian/control.tmpl
index 04ad0f4f..e440b492 100644
--- a/meta/recipes-kernel/linux/files/debian/control.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/control.tmpl
@@ -22,19 +22,23 @@  Description: ${KERNEL_NAME_PROVIDED} Linux kernel headers for @KR@
  .
  This is useful for people who need to build external modules
 
-Package: linux-libc-dev
+Package: linux-libc-dev-${KERNEL_NAME_PROVIDED}
 Build-Profiles: <!nolibcdev kernel>
 Section: devel
-Provides: linux-kernel-headers
+Conflicts: linux-libc-dev
+Provides: linux-libc-dev
+Replaces: linux-libc-dev
 Architecture: any
 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
+Package: linux-libc-dev-${DISTRO_ARCH}-cross-${KERNEL_NAME_PROVIDED}
 Build-Profiles: <!nolibcdev cross !kbuild>
 Section: devel
+Conflicts: linux-kernel-headers-${DISTRO_ARCH}-cross
 Provides: linux-kernel-headers-${DISTRO_ARCH}-cross
+Replaces: 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
diff --git a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
index def8480e..b200930c 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/common.tmpl
@@ -8,8 +8,8 @@  set -e
 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
+KERNEL_PKG_LIBC_HEADERS=linux-libc-dev-${KERNEL_NAME_PROVIDED}
+KERNEL_PKG_LIBC_HEADERS_CROSS=linux-libc-dev-${DISTRO_ARCH}-cross-${KERNEL_NAME_PROVIDED}
 KERNEL_PKG_KERN_KBUILD=linux-kbuild-${KERNEL_NAME_PROVIDED}
 KERNEL_PKG_KERN_KBUILD_CROSS=${KERNEL_PKG_KERN_KBUILD}-${DISTRO_ARCH}-cross
 
diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index 0a7bdd66..e1602b9d 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -225,7 +225,7 @@  install_headers() {
     if dpkg --compare-versions "${krel}" "lt" "5.4.24"; then
         headers_check
     fi
-    [ -z ${kern_pkgs["linux-libc-dev"]} ] || libc_headers
+    [ -z ${kern_pkgs["linux-libc-dev-${KERNEL_NAME_PROVIDED}"]} ] || libc_headers
     kernel_headers
 }
 
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index bf6c879b..f67bba2b 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -146,7 +146,9 @@  RECIPE_PROVIDES = " \
     linux-image-${KERNEL_NAME_PROVIDED} \
     linux-headers-${KERNEL_NAME_PROVIDED} \
     linux-libc-dev \
+    linux-libc-dev-${KERNEL_NAME_PROVIDED} \
     linux-libc-dev-${DISTRO_ARCH}-cross \
+    linux-libc-dev-${DISTRO_ARCH}-cross-${KERNEL_NAME_PROVIDED} \
     linux-image-${KERNEL_NAME_PROVIDED}-dbg \
     linux-kbuild-${KERNEL_NAME_PROVIDED} \
     ${BPN}-pseudo-native \