diff mbox series

[isar-cip-core] IMAGE_TYPEDEP:swu: Don't depend on wic

Message ID 20230516085018.26436-1-ubely@ilbers.de (mailing list archive)
State Changes Requested
Headers show
Series [isar-cip-core] IMAGE_TYPEDEP:swu: Don't depend on wic | expand

Commit Message

Uladzimir Bely May 16, 2023, 8:50 a.m. UTC
Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz swu"
causes uncompressed '.wic' image left non-removed after the build
finished. This is caused by indirect dependency on "wic" in swupdate
bbclass that can't be overriden by the user in local.conf.

This patch removes this depencency. If the user want to use some wic
partitions to be packed into .swu bundle, they could simply add
directly add "wic" or "wic.xz" to IMAGE_FSTYPE.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 classes/swupdate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kiszka June 4, 2023, 8:37 p.m. UTC | #1
On 16.05.23 10:50, Uladzimir Bely wrote:
> Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz swu"
> causes uncompressed '.wic' image left non-removed after the build
> finished. This is caused by indirect dependency on "wic" in swupdate
> bbclass that can't be overriden by the user in local.conf.
> 
> This patch removes this depencency. If the user want to use some wic
> partitions to be packed into .swu bundle, they could simply add
> directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  classes/swupdate.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
> index 9a4d509..6f034c1 100644
> --- a/classes/swupdate.bbclass
> +++ b/classes/swupdate.bbclass
> @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
>  
>  SWU_BUILDCHROOT_IMAGE_FILE ?= "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
>  
> -IMAGE_TYPEDEP:swu = "wic ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> +IMAGE_TYPEDEP:swu = "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>  IMAGER_INSTALL:swu += "cpio ${@'openssl' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>  
>  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"

Oops, this almost fell through the cracks.

I'm indeed not seeing anything in this class referencing wic, so this
removal seems logical to me. I'm just concerned if we have downstream
users relying on it and then seeing a hard to understand error. Any
thoughts?

Jan
Felix Moessbauer June 5, 2023, 7:13 a.m. UTC | #2
>On 16.05.23 10:50, Uladzimir Bely wrote:
>> Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz swu"
>> causes uncompressed '.wic' image left non-removed after the build 
>> finished. This is caused by indirect dependency on "wic" in swupdate 
>> bbclass that can't be overriden by the user in local.conf.
>> 
>> This patch removes this depencency. If the user want to use some wic 
>> partitions to be packed into .swu bundle, they could simply add 
>> directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
>> 
>> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
>> ---
>>  classes/swupdate.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index 
>> 9a4d509..6f034c1 100644
>> --- a/classes/swupdate.bbclass
>> +++ b/classes/swupdate.bbclass
>> @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
>>  
>>  SWU_BUILDCHROOT_IMAGE_FILE ?= "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
>>  
>> -IMAGE_TYPEDEP:swu = "wic ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>> +IMAGE_TYPEDEP:swu = "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>>  IMAGER_INSTALL:swu += "cpio ${@'openssl' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>>  
>>  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
>
>Oops, this almost fell through the cracks.
>
> I'm indeed not seeing anything in this class referencing wic, so this removal seems logical to me. I'm just concerned if we have downstream users relying on >it and then seeing a hard to understand error. Any thoughts?

Downstream layers need to adapt to the new interface anyways (if they don't use the plain version provided by CIP).
The .wic is not needed and should be removed.

Acked!

Felix

> Jan
Jan Kiszka June 6, 2023, 7:09 a.m. UTC | #3
On 05.06.23 09:13, MOESSBAUER, Felix wrote:
>> On 16.05.23 10:50, Uladzimir Bely wrote:
>>> Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz swu"
>>> causes uncompressed '.wic' image left non-removed after the build 
>>> finished. This is caused by indirect dependency on "wic" in swupdate 
>>> bbclass that can't be overriden by the user in local.conf.
>>>
>>> This patch removes this depencency. If the user want to use some wic 
>>> partitions to be packed into .swu bundle, they could simply add 
>>> directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
>>>
>>> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
>>> ---
>>>  classes/swupdate.bbclass | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index 
>>> 9a4d509..6f034c1 100644
>>> --- a/classes/swupdate.bbclass
>>> +++ b/classes/swupdate.bbclass
>>> @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
>>>  
>>>  SWU_BUILDCHROOT_IMAGE_FILE ?= "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
>>>  
>>> -IMAGE_TYPEDEP:swu = "wic ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>>> +IMAGE_TYPEDEP:swu = "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>>>  IMAGER_INSTALL:swu += "cpio ${@'openssl' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>>>  
>>>  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
>>
>> Oops, this almost fell through the cracks.
>>
>> I'm indeed not seeing anything in this class referencing wic, so this removal seems logical to me. I'm just concerned if we have downstream users relying on >it and then seeing a hard to understand error. Any thoughts?
> 
> Downstream layers need to adapt to the new interface anyways (if they don't use the plain version provided by CIP).
> The .wic is not needed and should be removed.
> 
> Acked!
> 

Thanks, applied now.

Jan
Jan Kiszka June 6, 2023, 7:57 a.m. UTC | #4
On 06.06.23 09:09, Jan Kiszka wrote:
> On 05.06.23 09:13, MOESSBAUER, Felix wrote:
>>> On 16.05.23 10:50, Uladzimir Bely wrote:
>>>> Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz swu"
>>>> causes uncompressed '.wic' image left non-removed after the build 
>>>> finished. This is caused by indirect dependency on "wic" in swupdate 
>>>> bbclass that can't be overriden by the user in local.conf.
>>>>
>>>> This patch removes this depencency. If the user want to use some wic 
>>>> partitions to be packed into .swu bundle, they could simply add 
>>>> directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
>>>>
>>>> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
>>>> ---
>>>>  classes/swupdate.bbclass | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass index 
>>>> 9a4d509..6f034c1 100644
>>>> --- a/classes/swupdate.bbclass
>>>> +++ b/classes/swupdate.bbclass
>>>> @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
>>>>  
>>>>  SWU_BUILDCHROOT_IMAGE_FILE ?= "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
>>>>  
>>>> -IMAGE_TYPEDEP:swu = "wic ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>>>> +IMAGE_TYPEDEP:swu = "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
>>>>  IMAGER_INSTALL:swu += "cpio ${@'openssl' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
>>>>  
>>>>  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
>>>
>>> Oops, this almost fell through the cracks.
>>>
>>> I'm indeed not seeing anything in this class referencing wic, so this removal seems logical to me. I'm just concerned if we have downstream users relying on >it and then seeing a hard to understand error. Any thoughts?
>>
>> Downstream layers need to adapt to the new interface anyways (if they don't use the plain version provided by CIP).
>> The .wic is not needed and should be removed.
>>
>> Acked!
>>
> 
> Thanks, applied now.
> 

...and dropped again. Seems this requires rebasing or some other tuning,
see e.g.
https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/4418633832

Jan
Uladzimir Bely June 7, 2023, 6:49 a.m. UTC | #5
On Tue, 2023-06-06 at 09:57 +0200, Jan Kiszka wrote:
> On 06.06.23 09:09, Jan Kiszka wrote:
> > On 05.06.23 09:13, MOESSBAUER, Felix wrote:
> > > > On 16.05.23 10:50, Uladzimir Bely wrote:
> > > > > Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz
> > > > > swu"
> > > > > causes uncompressed '.wic' image left non-removed after the
> > > > > build 
> > > > > finished. This is caused by indirect dependency on "wic" in
> > > > > swupdate 
> > > > > bbclass that can't be overriden by the user in local.conf.
> > > > > 
> > > > > This patch removes this depencency. If the user want to use
> > > > > some wic 
> > > > > partitions to be packed into .swu bundle, they could simply
> > > > > add 
> > > > > directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
> > > > > 
> > > > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > > > ---
> > > > >  classes/swupdate.bbclass | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/classes/swupdate.bbclass
> > > > > b/classes/swupdate.bbclass index 
> > > > > 9a4d509..6f034c1 100644
> > > > > --- a/classes/swupdate.bbclass
> > > > > +++ b/classes/swupdate.bbclass
> > > > > @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
> > > > >  
> > > > >  SWU_BUILDCHROOT_IMAGE_FILE ?=
> > > > > "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))
> > > > > }"
> > > > >  
> > > > > -IMAGE_TYPEDEP:swu = "wic
> > > > > ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > > +IMAGE_TYPEDEP:swu =
> > > > > "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > >  IMAGER_INSTALL:swu += "cpio ${@'openssl' if
> > > > > bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
> > > > >  
> > > > >  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
> > > > 
> > > > Oops, this almost fell through the cracks.
> > > > 
> > > > I'm indeed not seeing anything in this class referencing wic,
> > > > so this removal seems logical to me. I'm just concerned if we
> > > > have downstream users relying on >it and then seeing a hard to
> > > > understand error. Any thoughts?
> > > 
> > > Downstream layers need to adapt to the new interface anyways (if
> > > they don't use the plain version provided by CIP).
> > > The .wic is not needed and should be removed.
> > > 
> > > Acked!
> > > 
> > 
> > Thanks, applied now.
> > 
> 
> ...and dropped again. Seems this requires rebasing or some other
> tuning,
> see e.g.
> https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/4418633832
> 
> Jan
> 

Probably, for 'isar-cip-core' project itself, "wic" (or at least some
"wic.xz") is needed and should be added to .yml. I tested the patch
with a downstream that uses 'isar-cip-core'...
Uladzimir Bely June 7, 2023, 9:03 a.m. UTC | #6
On Tue, 2023-06-06 at 09:57 +0200, Jan Kiszka wrote:
> On 06.06.23 09:09, Jan Kiszka wrote:
> > On 05.06.23 09:13, MOESSBAUER, Felix wrote:
> > > > On 16.05.23 10:50, Uladzimir Bely wrote:
> > > > > Settings IMAGE_FSTYPE to something like "ext4 swu" or "wic.xz
> > > > > swu"
> > > > > causes uncompressed '.wic' image left non-removed after the
> > > > > build 
> > > > > finished. This is caused by indirect dependency on "wic" in
> > > > > swupdate 
> > > > > bbclass that can't be overriden by the user in local.conf.
> > > > > 
> > > > > This patch removes this depencency. If the user want to use
> > > > > some wic 
> > > > > partitions to be packed into .swu bundle, they could simply
> > > > > add 
> > > > > directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
> > > > > 
> > > > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > > > ---
> > > > >  classes/swupdate.bbclass | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/classes/swupdate.bbclass
> > > > > b/classes/swupdate.bbclass index 
> > > > > 9a4d509..6f034c1 100644
> > > > > --- a/classes/swupdate.bbclass
> > > > > +++ b/classes/swupdate.bbclass
> > > > > @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
> > > > >  
> > > > >  SWU_BUILDCHROOT_IMAGE_FILE ?=
> > > > > "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))
> > > > > }"
> > > > >  
> > > > > -IMAGE_TYPEDEP:swu = "wic
> > > > > ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > > +IMAGE_TYPEDEP:swu =
> > > > > "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > >  IMAGER_INSTALL:swu += "cpio ${@'openssl' if
> > > > > bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
> > > > >  
> > > > >  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
> > > > 
> > > > Oops, this almost fell through the cracks.
> > > > 
> > > > I'm indeed not seeing anything in this class referencing wic,
> > > > so this removal seems logical to me. I'm just concerned if we
> > > > have downstream users relying on >it and then seeing a hard to
> > > > understand error. Any thoughts?
> > > 
> > > Downstream layers need to adapt to the new interface anyways (if
> > > they don't use the plain version provided by CIP).
> > > The .wic is not needed and should be removed.
> > > 
> > > Acked!
> > > 
> > 
> > Thanks, applied now.
> > 
> 
> ...and dropped again. Seems this requires rebasing or some other
> tuning,
> see e.g.
> https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/4418633832
> 
> Jan
> 

Reproduced the issue locally, for one of failing targets, `kas-
cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml`

It seems the problem is not directly related to removing "wic" but to
missing dependencies. Task `do_image_swu` finally failed with the
following message:

```
sha256sum: /home/builder/cip-core-image-qemu-amd64/work/swu/linux.efi:
No such file or directory
```
Default value of  SWU_ADDITIONAL_FILES is "linux.efi
${SWU_ROOTFS_PARTITION_NAME}" but the recipe that provides "linux.efi"
is built later due to some missing dependency.

Without any changes in the code, build was OK on second (or third)
attempt.
Uladzimir Bely June 7, 2023, 12:21 p.m. UTC | #7
On Wed, 2023-06-07 at 12:03 +0300, Uladzimir Bely wrote:
> On Tue, 2023-06-06 at 09:57 +0200, Jan Kiszka wrote:
> > On 06.06.23 09:09, Jan Kiszka wrote:
> > > On 05.06.23 09:13, MOESSBAUER, Felix wrote:
> > > > > On 16.05.23 10:50, Uladzimir Bely wrote:
> > > > > > Settings IMAGE_FSTYPE to something like "ext4 swu" or
> > > > > > "wic.xz
> > > > > > swu"
> > > > > > causes uncompressed '.wic' image left non-removed after the
> > > > > > build 
> > > > > > finished. This is caused by indirect dependency on "wic" in
> > > > > > swupdate 
> > > > > > bbclass that can't be overriden by the user in local.conf.
> > > > > > 
> > > > > > This patch removes this depencency. If the user want to use
> > > > > > some wic 
> > > > > > partitions to be packed into .swu bundle, they could simply
> > > > > > add 
> > > > > > directly add "wic" or "wic.xz" to IMAGE_FSTYPE.
> > > > > > 
> > > > > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > > > > ---
> > > > > >  classes/swupdate.bbclass | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/classes/swupdate.bbclass
> > > > > > b/classes/swupdate.bbclass index 
> > > > > > 9a4d509..6f034c1 100644
> > > > > > --- a/classes/swupdate.bbclass
> > > > > > +++ b/classes/swupdate.bbclass
> > > > > > @@ -31,7 +31,7 @@ SWU_SIGNATURE_TYPE ?= "rsa"
> > > > > >  
> > > > > >  SWU_BUILDCHROOT_IMAGE_FILE ?=
> > > > > > "
> > > > > > ${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))
> > > > > > }"
> > > > > >  
> > > > > > -IMAGE_TYPEDEP:swu = "wic
> > > > > > ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > > > +IMAGE_TYPEDEP:swu =
> > > > > > "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
> > > > > >  IMAGER_INSTALL:swu += "cpio ${@'openssl' if
> > > > > > bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
> > > > > >  
> > > > > >  IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
> > > > > 
> > > > > Oops, this almost fell through the cracks.
> > > > > 
> > > > > I'm indeed not seeing anything in this class referencing wic,
> > > > > so this removal seems logical to me. I'm just concerned if we
> > > > > have downstream users relying on >it and then seeing a hard
> > > > > to
> > > > > understand error. Any thoughts?
> > > > 
> > > > Downstream layers need to adapt to the new interface anyways
> > > > (if
> > > > they don't use the plain version provided by CIP).
> > > > The .wic is not needed and should be removed.
> > > > 
> > > > Acked!
> > > > 
> > > 
> > > Thanks, applied now.
> > > 
> > 
> > ...and dropped again. Seems this requires rebasing or some other
> > tuning,
> > see e.g.
> > https://gitlab.com/cip-project/cip-core/isar-cip-core/-/jobs/4418633832
> > 
> > Jan
> > 
> 
> Reproduced the issue locally, for one of failing targets, `kas-
> cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml`
> 
> It seems the problem is not directly related to removing "wic" but to
> missing dependencies. Task `do_image_swu` finally failed with the
> following message:
> 
> ```
> sha256sum: /home/builder/cip-core-image-qemu-
> amd64/work/swu/linux.efi:
> No such file or directory
> ```
> Default value of  SWU_ADDITIONAL_FILES is "linux.efi
> ${SWU_ROOTFS_PARTITION_NAME}" but the recipe that provides
> "linux.efi"
> is built later due to some missing dependency.
> 
> Without any changes in the code, build was OK on second (or third)
> attempt.
> 

Prepared and sent patch v2 where restored swu dependency on wic image
for targets with efibootguard (swupdate bundle depends on "linux.efi"
file in deploy dir that is created by do_image_wic).
diff mbox series

Patch

diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index 9a4d509..6f034c1 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -31,7 +31,7 @@  SWU_SIGNATURE_TYPE ?= "rsa"
 
 SWU_BUILDCHROOT_IMAGE_FILE ?= "${PP_DEPLOY}/${@os.path.basename(d.getVar('SWU_IMAGE_FILE'))}"
 
-IMAGE_TYPEDEP:swu = "wic ${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
+IMAGE_TYPEDEP:swu = "${SWU_ROOTFS_TYPE}${@get_swu_compression_type(d)}"
 IMAGER_INSTALL:swu += "cpio ${@'openssl' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
 
 IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"