diff mbox series

[isar-cip-core] swupdate-config: suffix package with -${MACHINE}

Message ID 20250211074636.348469-1-cedric.hombourger@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core] swupdate-config: suffix package with -${MACHINE} | expand

Commit Message

Cedric Hombourger Feb. 11, 2025, 7:46 a.m. UTC
swupdate-config generates ${MACHINE}-dependent code since it uses
templates where ${MACHINE} is expanded for the configuration files
it ships. This causes problems in multiconfig builds. Dynamically
suffix the name of the recipe and package with -${MACHINE} to get
a separate build for each ${MACHINE} selected in the multiconfig.

Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 .../{swupdate-config_0.1.bb => swupdate-config_0.2.bb}       | 5 +++++
 1 file changed, 5 insertions(+)
 rename recipes-core/swupdate-config/{swupdate-config_0.1.bb => swupdate-config_0.2.bb} (89%)

Comments

Jan Kiszka Feb. 11, 2025, 6:56 p.m. UTC | #1
On 11.02.25 08:46, Cedric Hombourger wrote:
> swupdate-config generates ${MACHINE}-dependent code since it uses
> templates where ${MACHINE} is expanded for the configuration files
> it ships. This causes problems in multiconfig builds. Dynamically
> suffix the name of the recipe and package with -${MACHINE} to get
> a separate build for each ${MACHINE} selected in the multiconfig.
> 
> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> ---
>  .../{swupdate-config_0.1.bb => swupdate-config_0.2.bb}       | 5 +++++
>  1 file changed, 5 insertions(+)
>  rename recipes-core/swupdate-config/{swupdate-config_0.1.bb => swupdate-config_0.2.bb} (89%)
> 
> diff --git a/recipes-core/swupdate-config/swupdate-config_0.1.bb b/recipes-core/swupdate-config/swupdate-config_0.2.bb
> similarity index 89%
> rename from recipes-core/swupdate-config/swupdate-config_0.1.bb
> rename to recipes-core/swupdate-config/swupdate-config_0.2.bb
> index 3495285..63fa320 100644
> --- a/recipes-core/swupdate-config/swupdate-config_0.1.bb
> +++ b/recipes-core/swupdate-config/swupdate-config_0.2.bb
> @@ -11,6 +11,11 @@
>  
>  inherit dpkg-raw
>  
> +PROVIDES := "${PN}"
> +DEBIAN_PROVIDES := "${PN}"
> +
> +PN .= "-${MACHINE}"
> +
>  SRC_URI = "file://swupdate.cfg \
>             file://hwrevision.tmpl"
>  

Yeah, multiconfig is not that frequently used downstream. And if so,
then for composing complex images (installer with target image
included), not for building multiple target images at the same time.
Anyway, the change makes sense.

Applied, thanks.

Jan
Heinisch, Alexander Feb. 13, 2025, 11:40 a.m. UTC | #2
On Tue, 2025-02-11 at 19:56 +0100, Jan Kiszka via lists.cip-project.org
wrote:
> On 11.02.25 08:46, Cedric Hombourger wrote:
> > swupdate-config generates ${MACHINE}-dependent code since it uses
> > templates where ${MACHINE} is expanded for the configuration files
> > it ships. This causes problems in multiconfig builds. Dynamically
> > suffix the name of the recipe and package with -${MACHINE} to get
> > a separate build for each ${MACHINE} selected in the multiconfig.

Hi Cedric!

We are also heavily relying on MC to create multiple images for same
architecture using differing packages for machine specific components.

We followed a similar approach.
Compared to your patch we simply appended the PN .= "-${MACHINE}" like
you did and specified the exact package we want to be part of the image
IMAGE_INSTALL += "swupdate-config-${MACHINE}"

I have to admit, your solution seems more elegant than what we did, at
least as long as there is no conflict. How do you resolve
package conflicts in mc where swupdate-config is provided by multiple 
packages? `PREFERRED_PROVIDER_...`


How did you fix multiple target image builds with the existing
initramfs packages? We built specific packages for initramfs hooks like
`initramfs-verity-hook-${MACHINE}`

We did that following same approach as mentioned above: 
`PN = "initramfs-verity-hook-${MACHINE}"`

Did you find a more generic approach to fix that?

BR Alex

> > 
> > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> > ---
> >  .../{swupdate-config_0.1.bb => swupdate-config_0.2.bb}       | 5
> > +++++
> >  1 file changed, 5 insertions(+)
> >  rename recipes-core/swupdate-config/{swupdate-config_0.1.bb =>
> > swupdate-config_0.2.bb} (89%)
> > 
> > diff --git a/recipes-core/swupdate-config/swupdate-config_0.1.bb
> > b/recipes-core/swupdate-config/swupdate-config_0.2.bb
> > similarity index 89%
> > rename from recipes-core/swupdate-config/swupdate-config_0.1.bb
> > rename to recipes-core/swupdate-config/swupdate-config_0.2.bb
> > index 3495285..63fa320 100644
> > --- a/recipes-core/swupdate-config/swupdate-config_0.1.bb
> > +++ b/recipes-core/swupdate-config/swupdate-config_0.2.bb
> > @@ -11,6 +11,11 @@
> >  
> >  inherit dpkg-raw
> >  
> > +PROVIDES := "${PN}"
> > +DEBIAN_PROVIDES := "${PN}"
> > +
> > +PN .= "-${MACHINE}"
> > +
> >  SRC_URI = "file://swupdate.cfg \
> >             file://hwrevision.tmpl"
> >  
> 
> Yeah, multiconfig is not that frequently used downstream. And if so,
> then for composing complex images (installer with target image
> included), not for building multiple target images at the same time.
> Anyway, the change makes sense.
> 
> Applied, thanks.
> 
> Jan
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#17812):
> https://lists.cip-project.org/g/cip-dev/message/17812
> Mute This Topic: https://lists.cip-project.org/mt/111118772/8886423
> Group Owner: cip-dev+owner@lists.cip-project.org
> Unsubscribe:
> https://lists.cip-project.org/g/cip-dev/leave/13581556/8886423/542364468/xyzzy
>  [alexander.heinisch@siemens.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/recipes-core/swupdate-config/swupdate-config_0.1.bb b/recipes-core/swupdate-config/swupdate-config_0.2.bb
similarity index 89%
rename from recipes-core/swupdate-config/swupdate-config_0.1.bb
rename to recipes-core/swupdate-config/swupdate-config_0.2.bb
index 3495285..63fa320 100644
--- a/recipes-core/swupdate-config/swupdate-config_0.1.bb
+++ b/recipes-core/swupdate-config/swupdate-config_0.2.bb
@@ -11,6 +11,11 @@ 
 
 inherit dpkg-raw
 
+PROVIDES := "${PN}"
+DEBIAN_PROVIDES := "${PN}"
+
+PN .= "-${MACHINE}"
+
 SRC_URI = "file://swupdate.cfg \
            file://hwrevision.tmpl"