Dynamically create slot B #75
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@macpijan do you think this way of doing A/B updates is better or not? From my point of view:
Pros:
Cons:
Implements zarhus/zarhus-issues#47
.wic.gzand.swufiles now have around half their previous size.How it previously worked:
first boot, creation of rwoverlay
update
How it works with this PR:
first boot, creation of slot B (boot_b, rootfs_b) and rwoverlay
update, otab-shell has to do a little more now (configuration is very similar/near identical to first boot).
.swuupdate file containsboot_a/rootfs_apartition with changed label/UUID so it doesn't clash with original during update, or after if it fails.Tests: manual and not-yet merged OSFV tests:
Starting point: dynamically created slot B (
.wic.gzand.swuwas from this PR)Starting point:
.wic.gzbuilt from current develop (without changes from this PR),.swufile built from this PR. Tests results are the same as previously, so this update is backwards compatible.Also tested without encryption feature
Current issues with this implementation:
otab-shellscript that runs during update (add/binfrom inactive slot toPATH).swuhaving temporary label which is changed during update inotab-shellscript. If update fails, then temporary label stays and next update can't find device to update (which is searched by label).This issue could also happen with current implementation, if for some reason inactive slot partitions had different labels from expected, either due to mistake or if update broke inactive partition filesystem so much that Linux can't read device label.
Second issue should be fixed before merging.