meta-ota: add support for binary-delta images in a new layer
PATCH 1/1 meta-ota: add support for binary-delta images in a new layer
From: Bartosz Golaszewski <[email protected]>
Over-The-Air updates are a crucial part of IoT systems based on linux. There are several OTA update frameworks available and many offer some sort of support in yocto (e.g. meta-mender, meta-rauc). There are certain operations that are common to all of them such as: generating binary delta patches, system recovery, creating provisioning images etc.
This patch proposes to add a new layer in meta-openembedded dedicated to OTA. As the first functionality it adds a bbclass for generating binary delta images using two popular algorithms - vcdiff and rsync.
Such images can then be easily packaged in update artifacts for different OTA frameworks.
---
Hi,
I've noticed that when launching CE products and implementing OTA support I find myself implementing the same functionalities over again. I recently started abstracting them and would like to upstream them in meta-openembedded so that at least a part of that becomes standardized.
This patch proposes to add a new layer to meta-openembedded and I'll gladly maintain it. If accepted I intend on extending it with more functionalities such as creating provisioning (factory) images for updatable systems, recovery system images etc.
meta-ota/README | 27 +++++++++++ meta-ota/classes/binary-delta.bbclass | 64 +++++++++++++++++++++++++++ meta-ota/conf/layer.conf | 17 +++++++ 3 files changed, 108 insertions(+) create mode 100644 meta-ota/README create mode 100644 meta-ota/classes/binary-delta.bbclass create mode 100644 meta-ota/conf/layer.conf
meta-ota/README new file +27 -0
@@ -0,0 +1,27 @@ +meta-ota +======== + +This layer provides support for creating Over-The-Air update images. + +Dependencies +------------ + +This layer depends on: + +URI: git://github.com/openembedded/oe-core.git +subdirectory: meta +branch: master +revision: HEAD + +URI: git://github.com/openembedded/meta-oe.git +subdirectory: meta-oe +branch: master +revision: HEAD + +Maintenance +----------- + +Send patches / pull requests to [email protected] +with '[meta-ota]' in the subject. + +Layer maintainer: Bartosz Golaszewski <[email protected]>
meta-ota/classes/binary-delta.bbclass new file +64 -0
64 lines not on this page · raw message
meta-ota/conf/layer.conf new file +17 -0
@@ -0,0 +1,17 @@ +# Layer configuration for meta-ota layer +# Copyright (C) 2020 BayLibre SAS + +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +BBFILE_COLLECTIONS += "ota" +BBFILE_PATTERN_ota := "^${LAYERDIR}/" +BBFILE_PRIORITY_ota = "6" + +# This should only be incremented on significant changes that will +# cause compatibility issues with other layers +LAYERVERSION_ota = "1" + +LAYERDEPENDS_ota = "core openembedded-layer" + +LAYERSERIES_COMPAT_ota = "zeus"
Signature · 1 line
2.19.1
Hello,
On Fri, Feb 28, 2020 at 12:03 PM Bartosz Golaszewski <[email protected]> wrote:
...
Quoted 6 lines
Over-The-Air updates are a crucial part of IoT systems based on linux. There are several OTA update frameworks available and many offer some sort of support in yocto (e.g. meta-mender, meta-rauc). There are certain operations that are common to all of them such as: generating binary delta patches, system recovery, creating provisioning images etc.
Quoted 8 lines
This patch proposes to add a new layer in meta-openembedded dedicated to OTA. As the first functionality it adds a bbclass for generating binary delta images using two popular algorithms - vcdiff and rsync.
Such images can then be easily packaged in update artifacts for different OTA frameworks.
Signed-off-by Bartosz Golaszewski <[email protected]>
I see the value of this, as we are also doing OTA update framework development, however I wonder if it is worth a new layer for this. For now, I'd say to put it inside meta-oe directly.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
niedz., 1 mar 2020 o 14:43 Otavio Salvador
<[email protected]> napisał(a):
Quoted 15 lines
Hello,
On Fri, Feb 28, 2020 at 12:03 PM Bartosz Golaszewski <[email protected]> wrote:
...Quoted 10 lines
Over-The-Air updates are a crucial part of IoT systems based on linux. There are several OTA update frameworks available and many offer some sort of support in yocto (e.g. meta-mender, meta-rauc). There are certain operations that are common to all of them such as: generating binary delta patches, system recovery, creating provisioning images etc.
This patch proposes to add a new layer in meta-openembedded dedicated to OTA. As the first functionality it adds a bbclass for generating binary delta images using two popular algorithms - vcdiff and rsync.
Quoted 9 lines
Quoted 4 lines
Such images can then be easily packaged in update artifacts for different OTA frameworks.
Signed-off-by Bartosz Golaszewski <[email protected]>I see the value of this, as we are also doing OTA update framework development, however I wonder if it is worth a new layer for this. For now, I'd say to put it inside meta-oe directly.
This single class surely doesn't justify a new layer but I have a bunch of other stuff lined up for upstreaming if this is accepted. This is thematically separate from most of the recipes in meta-oe too.
Bartosz
Quoted 5 lines · Bartosz Golaszewski
niedz., 1 mar 2020 o 14:43 Otavio Salvador <[email protected]> napisał(a):
This single class surely doesn't justify a new layer but I have a bunch of other stuff lined up for upstreaming if this is accepted. This is thematically separate from most of the recipes in meta-oe too.
So please give us an idea of what are your plans, so we can understand it better.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
pon., 2 mar 2020 o 12:25 Otavio Salvador
<[email protected]> napisał(a):
Quoted 11 lines · Bartosz Golaszewski
Quoted 5 lines
niedz., 1 mar 2020 o 14:43 Otavio Salvador <[email protected]> napisał(a):
This single class surely doesn't justify a new layer but I have a bunch of other stuff lined up for upstreaming if this is accepted. This is thematically separate from most of the recipes in meta-oe too.So please give us an idea of what are your plans, so we can understand it better.
Sure. Next steps would be:
- Adding a class for generating provisioning partition images. Basically allowing to split parts of the rootfs into separate ext4 (or other) image similar to what meta-mender does in its mender-dataimg class for /data but generalized for configurable directories.
- Adding an image recipe for a factory reset system, where we would store the provisioning rootfs on a read-only partition together with an initramfs the role of which would be to reflash the A/B partitions to bring the device to a known state, this is something we do a lot in our consulting work.
- Adding standardized target-side scripts for applying binary-delta images. This uses the fact that many OTA frameworks support extensions to their client programs. For instance the same script could be used for applying the vcdiff and rsync patches both as a mender update module and a rauc handler (with a thin compatibility layer in their respective OE layers).
It still doesn't exhaust the subject but I think this really makes sense in a separate layer than being sprinkled all-over meta-oe.
Khem, Armin: any thoughts?
Bart
Hello Bartosz,
Quoted 7 lines · Bartosz Golaszewski
pon., 2 mar 2020 o 12:25 Otavio Salvador
<[email protected]> napisał(a):Quoted 4 lines · Bartosz Golaszewski
Quoted 2 lines
niedz., 1 mar 2020 o 14:43 Otavio Salvador
<[email protected]> napisał(a):Khem, Armin: any thoughts?
All this sounds great, I just don't see it fitting on meta-oe. I'd like to propose we create an orga for it, on github, and host it there.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
Quoted 34 lines · Bartosz Golaszewski
pon., 2 mar 2020 o 12:25 Otavio Salvador
<[email protected]> napisał(a):Quoted 11 lines · Bartosz Golaszewski
Quoted 5 lines
niedz., 1 mar 2020 o 14:43 Otavio Salvador <[email protected]> napisał(a):
This single class surely doesn't justify a new layer but I have a bunch of other stuff lined up for upstreaming if this is accepted. This is thematically separate from most of the recipes in meta-oe too.So please give us an idea of what are your plans, so we can understand it better.
Sure. Next steps would be:
- Adding a class for generating provisioning partition images. Basically allowing to split parts of the rootfs into separate ext4 (or other) image similar to what meta-mender does in its mender-dataimg class for /data but generalized for configurable directories.
- Adding an image recipe for a factory reset system, where we would store the provisioning rootfs on a read-only partition together with an initramfs the role of which would be to reflash the A/B partitions to bring the device to a known state, this is something we do a lot in our consulting work.
- Adding standardized target-side scripts for applying binary-delta images. This uses the fact that many OTA frameworks support extensions to their client programs. For instance the same script could be used for applying the vcdiff and rsync patches both as a mender update module and a rauc handler (with a thin compatibility layer in their respective OE layers).
Quoted 4 lines
It still doesn't exhaust the subject but I think this really makes sense in a separate layer than being sprinkled all-over meta-oe.
Khem, Armin: any thoughts?
there are many ota layers on OE, most of them are self-contained, so a question arises, how is this different, somethings here say it could be a base layer for all OTAs, which actually seems quite valuable, but it has to be such that the existing OTA layers start using pieces from this layer, Other part seems to be that its yet another OTA using binary delta update techniques, so in such a case, it should be thought of as another OTA and perhaps maintained independendently, if there are features which are common across all OTAs we can host them in core or meta-oe,
Quoted 3 lines
Bart
pon., 2 mar 2020 o 19:25 Khem Raj <[email protected]> napisał(a):
Quoted 8 lines
Quoted 3 lines
Khem, Armin: any thoughts?
there are many ota layers on OE, most of them are self-contained, so a question arises, how is this different, somethings here say it could be a base layer for all OTAs, which actually seems quite valuable, but it has to be such that the existing OTA layers start using pieces from this
No, it's actually the other way around. The existing OTA layers are focused on supporting specific tools and they usually provide full support for some reference platforms. However in every custom project I worked on we needed to extend those layers and those extensions became quite repetitive, hence the idea for a layer that gathers common elements but that is independent from project-specific layers.
If anything the goal is to use this *in conjunction* with specialized OTA layers.
Quoted 6 lines
layer, Other part seems to be that its yet another OTA using binary delta update techniques, so in such a case, it should be thought of as another OTA and perhaps maintained independendently, if there are features which are common across all OTAs we can host them in core or meta-oe,
No, this is not an OTA on its own and the generation of binary delta patches is just one of the features.
Let me give you more context on why I started to do this. We've had a downstream layer for a client's project compatible with thud with a complete verified boot chain of trust including dm-verity protected rootfs mounted by an initramfs stored in signed fitImage + OTA support. Generating this image required us to alter a couple inter-task dependencies (fitImage needs to wait for initramfs, but initramfs needs the dm-verity meta-data which needs the rootfs partition, and then we need to sign the fitImage etc. etc.).
Then some time during warrior development commit 67628ea66b7d ("uboot-sign.bbclass: fix signature and deployment") was merged in OE-core which caused us a lot of trouble with our dependencies when trying to update the layer. In order to not make the same mistake twice - we thought it's best to upstream our development too for others to use and to be able to object when someone breaks it for us (I'm mostly a kernel developer and this is how it works in linux, I'm not sure if it's the same for yocto).
BTW I'm also preparing a series of patches for meta-security with dm-verity images as part of this effort.
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.
Best regards,
Bartosz
wt., 3 mar 2020 o 14:56 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 6 lines
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.
Hi Khem,
gentle ping on this. What is the procedure of hosting a layer at OE?
Bartosz
hi Bartosz,
Quoted 8 lines · Bartosz Golaszewski
wt., 3 mar 2020 o 14:56 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 6 lines
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.
Quoted 4 lines
Hi Khem,
gentle ping on this. What is the procedure of hosting a layer at OE?
it depends what you mean here.
1. Hosting on git.yoctoproject.org is mostly for layers supported by YP membership, these layers are under the responsibility of the YP TSC [1]
2. Hosting on git.openembedded.org is under the responsibility of the OE TSC [2]
We recently started an initiative using gitlab, to host layers:
https://gitlab.com/openembedded/community, though it's not picking up much for now. But that would be another option, Paul B. or myself could give you access
You might want to host the layer on your own (github, gitlab or anywhere else). I understand why you think that hosting on yoctoproject.org would make it 'more' official, however hundreds of layers are 'self hosted' and it's usually not a big concern.
In any case you should register your layer in the OE layer index.
[1] https://wiki.yoctoproject.org/wiki/TSC
[2] https://www.openembedded.org/wiki/TSC
Quoted 7 lines
Bartosz
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Quoted 16 lines · Nicolas Dechesne
Quoted 7 lines · Bartosz Golaszewski
wt., 3 mar 2020 o 14:56 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 5 lines
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.gentle ping on this. What is the procedure of hosting a layer at OE?
it depends what you mean here.
1. Hosting on git.yoctoproject.org is mostly for layers supported by YP membership, these layers are under the responsibility of the YP TSC [1]
2. Hosting on git.openembedded.org is under the responsibility of the OE TSC [2]We recently started an initiative using gitlab, to host layers: https://gitlab.com/openembedded/community, though it's not picking up much for now. But that would be another option, Paul B. or myself could give you access
Quoted 7 lines
You might want to host the layer on your own (github, gitlab or anywhere else). I understand why you think that hosting on yoctoproject.org would make it 'more' official, however hundreds of layers are 'self hosted' and it's usually not a big concern.
In any case you should register your layer in the OE layer index.
[1] https://wiki.yoctoproject.org/wiki/TSC
[2] https://www.openembedded.org/wiki/TSC
I've been preferring github over gitlab but either works. I also think we ought to put it under one of those platforms and rely on those for future.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
śr., 11 mar 2020 o 14:28 Nicolas Dechesne
<[email protected]> napisał(a):
Quoted 17 lines
hi Bartosz,
Quoted 12 lines · Bartosz Golaszewski
wt., 3 mar 2020 o 14:56 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 6 lines
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.Hi Khem,
gentle ping on this. What is the procedure of hosting a layer at OE?
Hi Nicolas,
thanks for the response.
Quoted 6 lines
it depends what you mean here.
1. Hosting on git.yoctoproject.org is mostly for layers supported by YP membership, these layers are under the responsibility of the YP TSC [1]
2. Hosting on git.openembedded.org is under the responsibility of the OE TSC [2]
I'm not sure what that means exactly in terms of making a layer official. I can only guess that non-members can't make their layers part of the project for political reasons.
Quoted 2 lines
We recently started an initiative using gitlab, to host layers: https://gitlab.com/openembedded/community, though it's not picking up much for now. But that would be another option, Paul B. or myself could give you access
Yes, that is one way, but I just don't like githubs, gitlabs and other bitbuckets. I prefer regular mailing list flow + cgit whenever possible.
Quoted 2 lines
You might want to host the layer on your own (github, gitlab or anywhere else). I understand why you think that hosting on yoctoproject.org would make it 'more' official, however hundreds of layers are 'self hosted' and it's usually not a big concern.
They are also scattered all over and significant part of them are not being actively maintained. Hosting it at some official git would at least mean that if I ever stop working on it, someone else could take over without moving the git tree. It would also make it more visible and make it possible for the development to happen on the official mailing list.
Anyway: is the material I described in this thread something that could be committed to various existing parts of meta-openembedded without creating a new layer?
Quoted 2 lines
In any case you should register your layer in the OE layer index.
Sure.
Quoted 3 lines
[1] https://wiki.yoctoproject.org/wiki/TSC
[2] https://www.openembedded.org/wiki/TSC
Thanks,
Bartosz Golaszewski
Quoted 28 lines · Bartosz Golaszewski
śr., 11 mar 2020 o 14:28 Nicolas Dechesne
<[email protected]> napisał(a):Quoted 17 lines
hi Bartosz,
Quoted 12 lines · Bartosz Golaszewski
wt., 3 mar 2020 o 14:56 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 6 lines
If this is not something that should be part of meta-openembedded - is there any way to have it hosted at https://git.yoctoproject.org/cgit/
as an official yocto layer? I'm sorry if this is a dumb question, I don't know exactly what the policy is for that.Hi Khem,
gentle ping on this. What is the procedure of hosting a layer at OE?
Hi Nicolas,
thanks for the response.
Quoted 3 lines
it depends what you mean here.
Quoted 7 lines
Quoted 3 lines
1. Hosting on git.yoctoproject.org is mostly for layers supported by YP membership, these layers are under the responsibility of the YP TSC [1]
2. Hosting on git.openembedded.org is under the responsibility of the OE TSC [2]I'm not sure what that means exactly in terms of making a layer official. I can only guess that non-members can't make their layers part of the project for political reasons.
I would suggest to send the proposal to oe-tsc mailing list [email protected]
Quoted 2 lines
Quoted 2 lines
We recently started an initiative using gitlab, to host layers: https://gitlab.com/openembedded/community, though it's not picking up much for now. But that would be another option, Paul B. or myself could give you access
openembedded gitlab presence as an organization is new and being experimented with eventually
it might or might not become more prominent.
Quoted 31 lines
Quoted 1 line
Yes, that is one way, but I just don't like githubs, gitlabs and other bitbuckets. I prefer regular mailing list flow + cgit whenever possible.
Quoted 2 lines
You might want to host the layer on your own (github, gitlab or anywhere else). I understand why you think that hosting on yoctoproject.org would make it 'more' official, however hundreds of layers are 'self hosted' and it's usually not a big concern.
They are also scattered all over and significant part of them are not being actively maintained. Hosting it at some official git would at least mean that if I ever stop working on it, someone else could take over without moving the git tree. It would also make it more visible and make it possible for the development to happen on the official mailing list.
Anyway: is the material I described in this thread something that could be committed to various existing parts of meta-openembedded without creating a new layer?
Quoted 2 lines
In any case you should register your layer in the OE layer index.
Sure.
Quoted 3 lines
[1] https://wiki.yoctoproject.org/wiki/TSC
[2] https://www.openembedded.org/wiki/TSCThanks,
Bartosz Golaszewski
czw., 12 mar 2020 o 19:13 Khem Raj <[email protected]> napisał(a):
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
it depends what you mean here.
1. Hosting on git.yoctoproject.org is mostly for layers supported by YP membership, these layers are under the responsibility of the YP TSC [1]
2. Hosting on git.openembedded.org is under the responsibility of the OE TSC [2]
Quoted 7 lines
Quoted 3 lines
I'm not sure what that means exactly in terms of making a layer official. I can only guess that non-members can't make their layers part of the project for political reasons.
I would suggest to send the proposal to oe-tsc mailing list [email protected]
Thanks. I'll do this as soon as I have more things to show in this layer.
Bartosz