Hi Paul,
On 26.06.24 18:20, Paul HENRYS d'AUBIGNY wrote:
> Hello all,
>
> I was wondering how relevant could it be to be able to write
> sw-description files with the device-tree syntax (DTS). The cpio archive
> for SWUpdate would then embed a DTB describing the images and upgrade
> information which could be parsed by SWUpdate.
> Currently, the sw-description can be written with libconfig and json
> formats.
Well, it will be a third parser for SWUpdate. The question is if it is
needed.
> The idea behind this would be to be able to embed a sw-description as a
> device tree in U-Boot binman device tree, so that binman could be used
> to generate a SWUpdate image and its dependencies (e.g. FIT) at once.
> Having a common format based on FDT would allow binman to eventually
> parse the sw-description information to add certain data such as the
> sha256 of images generated by binman.
>
Well, first I take the chance to explain why DTS was not taken. Even if
I worked a lot with U-Boot, I think that binding SWUpdate with U-Boot is
not a good idea. SWUpdate must support multiple bootloaders, and they
share nothing with U-Boot. And binman itself is not a self running
project, but part of U-Boot. This leads that projects using another
bootloader have dependency with U-Boot, that makes no sense.
Another point is that DTS is, at the end, the language for hardware
description in kernel. If kernel will need some important changes in
DTS, it will be done - without taking into account backward
compatibility. It is not an issue in kernel: a new kernel requiring new
version of DTS is delivered together with DTB.
But in case of SWUpdate, we need to guarantee bakcward compatibility.
Even last release of SWUpdate can install an older SWU (there are just a
couple of exceptions). This is something I saw recently, and a new
SWUpdate can still install a SWU thought for a 2016.10. There is no way
for SWUpdate to guarantee such kind of compatibility with DTS: kernel
will always have priority in such cases.
Another point is if it is possible to convert sw-description from / to
DTS. This is supported today: a libconfig sw-description can be
converted via a tool to JSON, and both sw-descriptions work flawlessly.
With DTS, even this tool should be implemented to have the feature.
It looks to me that support for DTS is just to reuse part of binman -
but well, I can also say that binman can be extended to supportJSON or
libconfig. I do not know which is the added value to use binman, the SWU
is already generated via meta-swupdate (for OE) or SWUgenerator, and of
course sha256 are already generated. So I do not see the advantage to
use binman - and binman should also pack rootfs and other artifacts.
This can work in OE onlz if binman will be extracted from U-Boot and
runs as own project, but it does not seem the case.
> Would adding FDT format for the sw-description make sense?
Please go ahead to explain the advantages, because it seems to me just
rewriting in a different language to have at the end the same features.
> Any concern
> about such a format for the sw-description file?
>
Best regards,
Stefano Babic