gadget: fully support multi-volume gadget asset updates in Update() on UC20+
* gadget: don't include non-supported volumes in map from VolumeStructureTo...
Not including the unsupported volumes in the map entirely simplifies some logic
in the full Update() change, so ensure that we only generate keys in the first
level of the map for supported volumes.
Signed-off-by: Ian Johnson <email address hidden>
* gadget: fully support multi-volume gadget asset updates in Update() on UC20+
Finally switch over the implementation of Update() to use all of the
preparatory functions and such that allow us to support multi-volume gadget
asset updates on UC20.
Remove unnecessary code in gadget/device_linux.go and update many tests.
Signed-off-by: Ian Johnson <email address hidden>
* gadget/update.go: simplify updateLocationForStructure
Thanks to Alberto for the suggestion
Signed-off-by: Ian Johnson <email address hidden>
* gadget/update.go: small tweaks (thanks to Samuele)
Signed-off-by: Ian Johnson <email address hidden>
* gadget/gadgettest: allow specifying kernel dir in LayoutMultiVolumeFromYaml
Signed-off-by: Ian Johnson <email address hidden>
* gadget/update_test.go: add test for kernel assets with multi-volumes
Also delete TODO since this is being handled correctly.
Signed-off-by: Ian Johnson <email address hidden>
* gadget: ensure that at least one kernel asset is consumed across all volumes
Previously we were enforcing that every volume needed to consume a kernel asset
but really the condition is that only one volume across any of the volumes in a
gadget consumes a kernel asset.
Signed-off-by: Ian Johnson <email address hidden>
* gadget/gadget.go: add TODO about updating IsCompatible
Signed-off-by: Ian Johnson <email address hidden>
* gadget/update_test.go: add case for a structure on another volume being changed
As requested by Samuele.
Signed-off-by: Ian Johnson <email address hidden>
Co-authored-by: Alberto Mardegan <email address hidden>
Co-authored-by: Michael Vogt <email address hidden>