osutil: introduce verity device resolver
this commit leverages an existing snapd API that allows registration of different resolvers for device mapper devices which currently only supports luks. It introduces a new resolver for device mapper devices for dm-verity. This resolver uses the ID_FS_UUID udev property to map a verity device to its data partition.
This is potentially a more universal approach to solving the same issue https://github.com/snapcore/snapd/pull/14180 attempted to solve with a workaround.
Jira: https://warthogs.atlassian.net/browse/FR-8353
Everyone contributing to this PR have now signed the CLA. Thanks!
I have started https://github.com/canonical/snapd/pull/14358 as an alternative. Ping @sespiros
@zyga Thanks for the comments! I would like to add some context. Since I added this we had several discussions with @valentindavid about it which first concluded with Valentin opening:
- https://github.com/canonical/snapd/pull/14358
We then discussed some more and concluded that maybe the original reason (checking the disk origin) that makes use of these APIs don't apply anymore so Valentin also opened:
- https://github.com/canonical/snapd/pull/14392
- https://github.com/canonical/snapd/pull/14393
I am not sure what is the preferred way forward, should we try and merge the verity resolver for the time being and then consider removing them at a later point?