diff mbox series

[1/3] kernel.bbclass: Handle possible multiconfig.

Message ID 20250206142603.3870360-3-daniel.mueller@karlstorz.com
State New
Headers show
Series Fix incorrect dependencies between multiconfigs | expand

Commit Message

Mueller, Daniel Feb. 6, 2025, 2:22 p.m. UTC
From: Sebastian Zenker <sebastian.zenker@gmx.de>

When specifying the dependencies of do_bundle_initramfs the current
multiconfig might not be the default. This fixes the dependencies between
the multiconfigs if the current differs to default.

Signed-off-by: Mueller, Daniel <daniel.mueller@karlstorz.com>
---
 meta/classes-recipe/kernel.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Richard Purdie Feb. 17, 2025, 10:02 p.m. UTC | #1
On Thu, 2025-02-06 at 15:22 +0100, Mueller, Daniel via lists.openembedded.org wrote:
> From: Sebastian Zenker <sebastian.zenker@gmx.de>
> 
> When specifying the dependencies of do_bundle_initramfs the current
> multiconfig might not be the default. This fixes the dependencies between
> the multiconfigs if the current differs to default.
> 
> Signed-off-by: Mueller, Daniel <daniel.mueller@karlstorz.com>
> ---
>  meta/classes-recipe/kernel.bbclass | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index 617727a989..9276ddb62a 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -146,7 +146,10 @@ set -e
>      # standalone for use by wic and other tools.
>      if image:
>          if d.getVar('INITRAMFS_MULTICONFIG'):
> -            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
> +            mc = d.getVar('BB_CURRENT_MC')
> +            if mc == 'default':
> +                mc = ''
> +            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc:' + mc + ':${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
>          else:
>              d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
>      if image and bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):

The "default" value in multiconfig was recently removed entirely so
this patch is not needed for master. This does raise questions of how
it was tested.

Cheers,

Richard
Mueller, Daniel Feb. 19, 2025, 9:47 a.m. UTC | #2
From: Sebastian Zenker <sebastian.zenker@gmx.de>
When specifying the dependencies of do_bundle_initramfs the current
multiconfig might not be the default. This fixes the dependencies between
the multiconfigs if the current differs to default.
Signed-off-by: Mueller, Daniel <daniel.mueller@karlstorz.com>
---
Your right, handling 'default' isn't required anymore, my apologies. I've
reworked the changes and tested them against the master branch.
Please also ignore the other 2 patches of the original patchset, those
have been been integrated into master already.
Regards, Daniel
meta/classes-recipe/kernel.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 617727a989..6fe7c60e17 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -146,7 +146,7 @@ set -e
# standalone for use by wic and other tools.
if image:
if d.getVar('INITRAMFS_MULTICONFIG'):
-            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
+            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc:${BB_CURRENT_MC}:${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
else:
d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
if image and bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 617727a989..9276ddb62a 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -146,7 +146,10 @@  set -e
     # standalone for use by wic and other tools.
     if image:
         if d.getVar('INITRAMFS_MULTICONFIG'):
-            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc::${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
+            mc = d.getVar('BB_CURRENT_MC')
+            if mc == 'default':
+                mc = ''
+            d.appendVarFlag('do_bundle_initramfs', 'mcdepends', ' mc:' + mc + ':${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
         else:
             d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
     if image and bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):