[isar-cip-core][PATCH v5 0/8] Rework image classes


Felix Moessbauer <felix.moessbauer@...>
 

Changes since v4:

- append default sw-description path (instead of prepending)
- remove IMAGE_CLASSES used in kas in correct patch
- remove IMAGE_CLASSES from documentation (is now handled automatically)

Changes since v3:

- add patch to make sw-description spec compliant
- replace hand-crafted swu compression logic with imagetypes
(+ support for zstd)
- prefix variables in swupdate class to avoid collisions
- avoid double-inherit in swupdate.inc
- explicitly add sw-description path to FILESEXTRAPATHS as
FILESOVERRIDES do not apply here (see comment for details)

Changes since v2:

- remove unnecessary dependency to template task (it is a dep anyways)

Changes since v1:

- separation of concerns: do not append to :wic typedep in :swu [1]

This series reworks the image classes so that they are fully based on
the existing imagetypes infrastructure. Issues with swupdate on non
default partition layouts are solved by directly using the underlying
image / rootfs variant instead of a fixed wic partition. To support
further customizations, an interface is provided to select the type of
the rootfs image (e.g. squashfs). The verity class then uses this interface
to configure the swu.

[1] As we now use the image (e.g. squashfs / verity) directly to create
the swu file, we also explicity need that image type (compressed).
For wic, we now explicitly have to state the imagetype again, as we copy
that into one of the partitions (but this is not an aspect of the swu type).
In addition, we cannot simply always add that type to IMAGE_TYPEDEP:wic, as
otherwise always a squashfs is built when the swupdate.bbclass is included.
One key aspect of the imagetypes is that they are non-intrusive. By that,
the classes can always be added and only become into effect when selecting
the corresponding type.

Best regards,
Felix Moessbauer
Siemens AG


Felix Moessbauer (8):
register image classes via layer.conf
refactor: use imagetypes for swu generation
swu: directly image from squashfs rootfs
swupdate: only check partition uuids on swupdate
make sw-description spec compliant
swu: replace custom image compression
prefix swu related variables with SWU
refactor verity image creation

classes/swupdate.bbclass | 73 +++++++++++--------
classes/verity.bbclass | 7 +-
conf/layer.conf | 2 +
doc/README.secureboot.md | 1 -
kas/opt/ebg-secure-boot-snakeoil.yml | 2 +-
kas/opt/swupdate.yml | 4 +-
.../images/{files => swu}/sw-description.tmpl | 7 +-
recipes-core/images/swupdate.inc | 21 ------
8 files changed, 52 insertions(+), 65 deletions(-)
rename recipes-core/images/{files => swu}/sw-description.tmpl (84%)

--
2.34.1


Jan Kiszka
 

On 16.02.23 04:35, Felix Moessbauer wrote:
Changes since v4:

- append default sw-description path (instead of prepending)
- remove IMAGE_CLASSES used in kas in correct patch
- remove IMAGE_CLASSES from documentation (is now handled automatically)

Changes since v3:

- add patch to make sw-description spec compliant
- replace hand-crafted swu compression logic with imagetypes
(+ support for zstd)
- prefix variables in swupdate class to avoid collisions
- avoid double-inherit in swupdate.inc
- explicitly add sw-description path to FILESEXTRAPATHS as
FILESOVERRIDES do not apply here (see comment for details)

Changes since v2:

- remove unnecessary dependency to template task (it is a dep anyways)

Changes since v1:

- separation of concerns: do not append to :wic typedep in :swu [1]

This series reworks the image classes so that they are fully based on
the existing imagetypes infrastructure. Issues with swupdate on non
default partition layouts are solved by directly using the underlying
image / rootfs variant instead of a fixed wic partition. To support
further customizations, an interface is provided to select the type of
the rootfs image (e.g. squashfs). The verity class then uses this interface
to configure the swu.

[1] As we now use the image (e.g. squashfs / verity) directly to create
the swu file, we also explicity need that image type (compressed).
For wic, we now explicitly have to state the imagetype again, as we copy
that into one of the partitions (but this is not an aspect of the swu type).
In addition, we cannot simply always add that type to IMAGE_TYPEDEP:wic, as
otherwise always a squashfs is built when the swupdate.bbclass is included.
One key aspect of the imagetypes is that they are non-intrusive. By that,
the classes can always be added and only become into effect when selecting
the corresponding type.

Best regards,
Felix Moessbauer
Siemens AG


Felix Moessbauer (8):
register image classes via layer.conf
refactor: use imagetypes for swu generation
swu: directly image from squashfs rootfs
swupdate: only check partition uuids on swupdate
make sw-description spec compliant
swu: replace custom image compression
prefix swu related variables with SWU
refactor verity image creation

classes/swupdate.bbclass | 73 +++++++++++--------
classes/verity.bbclass | 7 +-
conf/layer.conf | 2 +
doc/README.secureboot.md | 1 -
kas/opt/ebg-secure-boot-snakeoil.yml | 2 +-
kas/opt/swupdate.yml | 4 +-
.../images/{files => swu}/sw-description.tmpl | 7 +-
recipes-core/images/swupdate.inc | 21 ------
8 files changed, 52 insertions(+), 65 deletions(-)
rename recipes-core/images/{files => swu}/sw-description.tmpl (84%)
Thanks, applied with the already mentioned series-internal fix-ups.

Jan

--
Siemens AG, Technology
Competence Center Embedded Linux