* gadget,daemon: use Volume instead of LaidOutVolume when retrieving
traits (we only need the information from the gadget).
* gadget,overlord: use Volume instead of LaidOutVolume when saving
storage traits (we only actually need the gadget info).
* gadget: add function to get disk from installer gadget volume
* gadget: apply installer gadget changes to volumes
instead of applying to the laid out volumes, as in the end what the
installer is providing us is a way to fill gadget information.
* gadget: create temporary wrapper for LaidOutVolumesFromGadget
* o/devicestate: build layouts after matching disk to volumes
returned by the installer, so we make sure that the information we
have received is accurate.
* gadget/install: do not use laid out when encrypting a partition
* gadget: change so Run uses laid out types
only after the partitions have been created.
* gadget: do not use laid out structures directly in FactoryReset
* gadget: move ancillary function to gadgettest, as it is used there only
* gadget: remove some duplicated lines left by mistake
* gadget: pass around yaml index to installer
It is used by muinstaller as it calls create partition functions that
return maps that use this index as key.
* revert prev
* tests/muinstaller: update to latest snapd
* gadget: fix and test OnDiskVolumeFromGadgetVol
* gadget,overlord: set device from installer
* gadget/install: really check error returned by LayoutVolumeStructure
* gadget/install: fix nosecboot builds
* gadget,overlord: minor changes in comments
* gadget: add test for StructFromYamlIndex, add doc strings
* gadget: add some additional tests
* gadget: move up variable definition
* gadget,overlord: move OnDiskVolumeFromGadgetVol to a better place
* gadget: return OnDiskAndGadgetStructurePair pairs from buildPartitionList
* gadget: add method to copy volumes
* gadget,overlord: return a copy from ApplyInstallerVolumesToGadget
instead of modifying the passed around volumes.
* gadget,overlord: address review comments
* daemon,gadget: some renames and error/comments string changes
* gadget: move TestOnDiskVolumeFromGadgetVol to the right place
* gadget: add case for testing volume copy
* gadget/install: prevent reading twice gadget.yaml in Run
* gadget/install: remove now unneeded dummy function
* tests/muinstaller: update to latest snapd changes
* gadget/install: fix nosecboot tests
* gadget: unexport yamlIdxToStructureIdx
* gadget,overlord: some var name and comment changes
* gadget: add more unit tests for MatchDisksToGadgetVolumes
* gadget,overlord: address some review comments
* many: remove all `device-setup` fde-setup code
When we initially worked on the inline-cryto-engine (ICE) code we
had a design based on the fde-setup hook that would return a
`device-setup` feature as a hint that ICE should be used. It
turned out this design was impractical and we moved to a much
better approach that got merged in
https://github.com/snapcore/snapd/pull/12589
and relies on support for ICE in the kernel and cryptsetup.
With that new approach all the code that was supporting the
`device-setup` approach can be removed now.
* daemon: consider again the fde-setup hook case
* client: consider the ICE encryption type
* osu/disks,kernel: remove device-unlock support as well
---------
Co-authored-by: Samuele Pedroni <pedronis@lucediurna.net>
This commit updates the if/case statements that check for
secboot.EncryptionTypeLUKS to also deal with EncryptionTypeLUKSWithICE
and add some TODO:ICE: about cleanup we can do later.
Include OnDiskStructure in LaidOutStructure so we really have all the
needed information to create partitions and content in
LaidOutStructure. Also, remove the now unneeded
onDiskAndLaidoutStructure.
* gadget: change FindDeviceForStructure input to a VolumeStructure
as we did not need the full LaidOutStructure. This also simplifies the
tests.
* gadget/install: use OnDiskStructure in ensureNodesExist
As we did not need the full laid out structure.
* gadget: include OnDiskStructure in LaidOutStructure
Include OnDiskStructure in LaidOutStructure so we really have all the
needed information to create partitions and content in
LaidOutStructure. Also, remove the now unneeded
onDiskAndLaidoutStructure.
* gadget: remove StartOffset from LaidOutStructure
It is not needed as we have the same field in OnDiskStructure, which
is contained in LaidOutStructure.
* gadget: replace access to LaidOutStructure.VolumeStructure by methods
where possible.
* gadget: set encryption info in gadget.LaidoutVolume
Pass around encryption information so we can set the encryption info
in LaidOutStructure nearer to where it is created, which simplifies
the code and fixes cases not considered before.
* tests/muinstaller: use temporarily commit from branch for the build
To be removed as soon as https://github.com/snapcore/snapd/pull/12515
is merged.
This makes the debug endpoint work on UC18 and UC16 devices which have this
implicit system-data role.
Also add a small check to make sure the options are non-nil in
AllDiskVolumeDeviceTraits when we provide them to
DiskTraitsFromDeviceAndValidate.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
the cleanliness gained by having two structures with almost
the same fields is probably not enough to justify both of them,
especially because daemon is where we are supposed to build
responses, we might as well deal with the details
Meta was a quick hack, also it hasn't really grown since so we can
try to remove it now
AsyncResponse never takes anything over the result but the change id