Hi Stefan,
I just put it into a repo and then I fetch it from recipe.
>
>
>>> Why is a swu related to an image?
>>
>> In fact, it is not...the relation is introduced now by this patchset. If
>> we introduce a .swu in IMAGE_FSTYPES, *it* is an image. This is also why
>> I am saying that adding support for FSTYPES just simplifies the very
>> simple use case, that is update=rootfs. In most my use casesm it is not.
>
> But isn't it a valid use case?
Of course it is. But simplifying this use case should not discard
flexibility and cause other use cases, even if they are rare, impossible
to be implemented.
> In my case many images consists of a
> rootfs, boot loader, firmware and recovery images. The updates differ
> only in the rootfs image.
Ok - what I do in this case is to have a sw-description with dynamic
rootfs and yes, one recipe for each rootfs image to set this variable.
Let's see what is going on.
>
>
>> A SWU is a package with multiple artifacts and with instructions how the
>> new software should be installed on the device. Not always it is derived
>> from an image recipe, I have also normal packages (that could be
>> installed as part of rootfs by bitbake) that generate a SWU, too,
>> because it is required to deliver in this way.
>
> Why do you have to combine both in one? The same would be possible with
> a recipe which installs or deploys the file and a generalized
> baremetal-image.
No.
This is for SWUpdate, that is this package *must* be a SWU because
SWUpdate have to accept it and process it.
One use case is a license file with keys, and sw-description contains
instructions how to process it to allow to install further SWUs. This
license file can be part of a rootfs or not, and it is required in any
case for migration. But I have several other use case where what is
delivered does not belong to the classic schema (rootfs and just
software to be installed).
>
>
>> Or even no OE package at
>> all, the SWU contains configuration / calibration / data with
>> instructions (in sw-description) so that SWUpdate knows what it has to
>> do. Completely unrelated.
>
> Does it matter if it is handled by an empty package or an empty image?
>
>
>> But if the topic of the series is "swu image fstype", this binds a swu
>> with an image recipe.
>
> Only if the topic imply to remove the old way.
Right, but this is what I discovered with Anatolji's patches, because
they break some use cases of mine.
>
>
>>> What is the difference between a sd
>>> image and an update in terms of it content? Both contain a rootfs and
>>> some additional images like bootloader or firmware.
>>
>> Well, differences are in the usage. With SD, the device is passive: you
>> go in front of the device, you turn the device off, you insert the SD.
>> Device boots or not, but there is no instructions / code to update. In
>> OTA and in SWUpdate, the content (the SWU), apart of the artifacts that
>> we can consider like the SD, has also instructions and code to perform a
>> smooth update. This can help to fix hardware problems (change the
>> behavior before update), provide a migration with repartitioning,
>> whatever. And the behavior can be detected at runtime, so that
>> buildsystem cannot provide everything.
>
> In both cases the build systems take some artifacts and extend it with
> additional information. In case of the wks it doesn't matter which image
> the user build. Why does it matters for an swu?
>
>
>>> Why is an update related to an image?
>>
>> IMHO it is not, but adding swu fstype binds it.
>
> Why?
Because in OE a fstype is strict bound to an image (I need a recipe
image to use it), while a SWU is *not* bound to an image, it just
collects a list of artifacts. If we want to add a fstype, that is a
class to for .swu to be used with IMAGE_FSTYPES, we bind with an image.
But as you also say, the SWU is unrelated to an image or a rootfs.
>
> Does it really matter which image (rootfs) is packed inside the swu?
It does not matter : in fact, it is currently unaware. The recipe just
gets a list of artifacts, they can be a rootfs or not, it does not
matter at all. But this is the current state, what this series is
willing to change and then bind to a rootfs.
>
> The image class only specify how an image should be packed.
Right, but we need an image for it, and there are simply *no images* in
some use cases.
>
>
>>> Does the content of the rootfs
>>> really matter?
>>
>> No
>
> But why we need a recipe per image.
Exactly because it is unrelated, and we need to describe which
components are part of a SWU.
>
>
>>>>> It should work for the simple and the complex solutions.
>>>>
>>>> .inc file, yes, but SWU variables in a MACHINE config is quite
>>>> misleading, because this should mean it is machine specific, and it is
>>>> really more image specific.
>>>
>>> An .inc file is hard to override.
>>
>> Mmmhhh...I do not think so - a .inc is just a common part of a recipe,
>> and like all resipes, it is overridden by later set (after the require
>> statement) or by a .bbappend.
>
> The main difference is that an .inc file is immediately parsed. The
> WKS_FILE variable could be overridden by an recipe.
Right - but then we need a WKS file for each image. To maintain, it is
not quite different as having a recipe per image for each SWU.
I am quite losing which are the goals here or what we want to address. I
try to sumarize, maybe I misunderstand something:
- we need currently a recipe per image in case of different rootfs, and
adding a .swu fstype lets to avoid the recipe. However, sw-description
cannot be generated as I said previously, it can be factorized among
images.
- there are some cases not covered with current generation, related to
filesystem generation. I am not sure I have understood this. SWUpdate
delivers artifacts. If a filesystem must be created, the device can
generally do this itself, first eample at first boot after update. Or
this can be executed inside the update process as part of a preinstall
part. Why this should be done when SWU is generated, is something I am
missing: if the filesystem contains files, well, then it is an "image"
and can be built in OE, and then added to the list of artifacts. If the
filesystem is empty, if it is generated at build time it must be
delivered, too, increasing the SWU size (but an empty filesystem can be
well compressed), and it looks to me more suitable that the device does it.
- is there another goal ?
>
>
>>> A configuration file could be reused
>>> between images and it is possible to provide a default configuration for
>>> a machine or distro.
>>
>> ok, let's say it is just another place to set SWUPDATE_ variables (or to
>> set the behavior of the class).
>
> It depends on the implementation. Maybe it is independent of the class
> and a configuration for an swu build tool.
Ok
So is this the issue you want to address ? Anyway, the WIC is also quite
limited. It works fine for the rootfs, and I can use the rawcopy plugin
with --source rootfs. For some parts (see IMAGE_BOOTFILES), we can add
also some files to a generated filesystem (EFI is the clear example).
But I cannot combine partitions from different images, like a rootfs and
a partition just containing the application files, that is generated
with a different image recipe.
>
>
>>> Furthermore the update of a full filesystem instead of its content have
>>> advantages and this leads to images for every partition.
>>
>> Also I do not get, the "images" section in sw-description provides
>> exactly what you mean, and this feature was from the early beginning in
>> SWUpdate. SWUpdate does not know the contents.
>>
>>>
>>>>> Furthermore I need a update recipe per each image recipe.
>>>>
>>>> What I do is to have a .inc file shared by all update recipes, so that
>>>> the update recipes are very simple. But yes, an update recipe per
>>>> image is necessary, even if quite empty.
>>>
>>> But you could avoid this with a swu image class and a configuration
>>> file.
>>
>> So I need an image class, sw-description and a configuration file.
>> Currently we have the image class to create the SWU, sw-description and
>> a recipe for the SWU. Apart that configuration is put into a .conf
>> instead of a recipe (and yes, I factorize this with .inc currently), I
>> am missing the real difference and advantages..
>
> An image class could create an swu for arbitrary images. The machine
> could define the dependencies and content of the swu beside the rootfs.
> An image could override the dependencies and content. The image class
> could reuse exists variables to create filesystems.
Ok, I am quite sure now that the big issue on your use case is that
filesystems on empty partitions are not generated when SWU is built.
They are unrelated and no dependencies are created.
> Does it make sense to use the same
> sw-description for different build instructions if it excluded the
> source name of the artifacts.
This is what I often do with variable substitution (for rootfs), having
just one sw-description, but multiple recipes for the different use
cases. I am trying to understand if the proposed is just an alternative
implementation or there is really some added values.
Ok, this is clear.
> and to reuse
> the configurations of WIC.
You mean same configuration ? So are you thinking to a WIC plugin that
generates a SWU ?
> I would like to build a wks and swu image of
> an arbitrary image.
Regards,