linux-distro: Fix multiple provider warnings

Message ID 63d67e64-017e-4874-8042-49c2abaa2f17@siemens.com
State Accepted, archived
Headers show
Series linux-distro: Fix multiple provider warnings | expand

Commit Message

Jan Kiszka May 28, 2024, 1:48 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

As now all recipe variants of this stub target provide the same, we get
warnings like these when using the distro kernel:

NOTE: Multiple providers are available for linux-image-arm64 (linux-distro, linux-distro-native)
Consider defining a PREFERRED_PROVIDER entry to match linux-image-arm64

We can resolve that by limiting the PROVIDES additions to the base
target again as all of them are stubs anyway, Debian will provide the
actual packages.

Fixes: b7e3c78766c3 ("module.inc: fix kbuild dependency")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/recipes-kernel/linux/linux-distro.bb | 3 +++
 1 file changed, 3 insertions(+)

Comments

Uladzimir Bely June 3, 2024, 6:38 a.m. UTC | #1
On Tue, 2024-05-28 at 15:48 +0200, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> As now all recipe variants of this stub target provide the same, we
> get
> warnings like these when using the distro kernel:
> 
> NOTE: Multiple providers are available for linux-image-arm64 (linux-
> distro, linux-distro-native)
> Consider defining a PREFERRED_PROVIDER entry to match linux-image-
> arm64
> 
> We can resolve that by limiting the PROVIDES additions to the base
> target again as all of them are stubs anyway, Debian will provide the
> actual packages.
> 
> Fixes: b7e3c78766c3 ("module.inc: fix kbuild dependency")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  meta/recipes-kernel/linux/linux-distro.bb | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/recipes-kernel/linux/linux-distro.bb
> b/meta/recipes-kernel/linux/linux-distro.bb
> index 16673b67..d4f6026d 100644
> --- a/meta/recipes-kernel/linux/linux-distro.bb
> +++ b/meta/recipes-kernel/linux/linux-distro.bb
> @@ -6,6 +6,9 @@
>  # SPDX-License-Identifier: MIT
>  
>  python() {
> +    if ("class-native" or "class-compat") in
> d.getVar("OVERRIDES").split(":"):
> +        return
> +
>      distro_kernels = d.getVar('DISTRO_KERNELS') or ""
>      for kernel in distro_kernels.split():
>          d.appendVar('PROVIDES', ' linux-image-' + kernel)
> -- 
> 2.43.0
> 

Applied to next, thanks.

Patch

diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
index 16673b67..d4f6026d 100644
--- a/meta/recipes-kernel/linux/linux-distro.bb
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -6,6 +6,9 @@ 
 # SPDX-License-Identifier: MIT
 
 python() {
+    if ("class-native" or "class-compat") in d.getVar("OVERRIDES").split(":"):
+        return
+
     distro_kernels = d.getVar('DISTRO_KERNELS') or ""
     for kernel in distro_kernels.split():
         d.appendVar('PROVIDES', ' linux-image-' + kernel)