* cmd/snap-bootstrap: allow mocking mount errors in unit tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* cmd/snap-bootstrap: support booting into factory-reset mode
Add support for setting up the system in factory-reset mode. We only care about
ubuntu-save, as ubuntu-data and ubuntu-boot will be wiped. As such, it is
expected that only the fallback sealed key object has been sealed for this mode.
However, we also allow to prompt the user for the recovery (aka reinstall) key.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* cmd/snap-bootstrap: review tweaks, use FindPartition rather than FindPartitionUUID
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* cmd/snap-bootstrap: refactor factory-reset to reuse a subset of recovery state machine
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* osutil/disks: more verbose error when mocking is missing in tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* cmd/snap-bootstrap: use different name for degraded state in factory-reset mode
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
* cmd/snap-bootstrap: use factory-reset-bootstrap.json, tweaks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>