gadget: extract and export new DiskFromPartition() helper
For the UC20 code that creates partitions on firstboot we will
need something that can determine the disk from a partition. We
already have such code in the gadget that is not exported, so
this PR extracts and exports it.
Merge pull request #7815 from sergiocazzolato/tests-speedup-install-local-snaps
tests: reduce the complexity of the test-snapd-sh snap
To install test-snapd-sh in taking about 40 seconds in a board like pi3.
Whithe this change the istallation takes about 12 seconds.
Also the install local takes as defult path the local test directory, so it is possible to install snaps and is it not needed to pack and install with --dangerous manually.
Merge pull request #7824 from bboozzoo/bboozzoo/verify-snap-pack-access
snap/squashfs, osutil: verify files/dirs can be accessed by mksquashfs when building a snap
The mksquashfs tool does not error out when locations are not accessible by the
user who invoked it. Workaround that by adding an early pass that verifies the
contents of snap directory are accessible to the current user, and produce an
error otherwise.
For instance, attempting to pack the core18 snap as a user produces this error
message: