Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: export zpools unconditionally
In the _pre_shutdown function, we used to invoke `zpool export -a` if we found the presence of a zpool in the storage model. That being said, zpools can be implicitly declared by users using {"type": "format", "fstype": "zfsroot"} in the curtin actions. This is valid curtin configuration and unfortunately causes Subiquity to think that there is no zpool. When that happened, Subiquity did not invoke `zpool export -a` and therefore the target system couldn't boot without a call to `zpool import -f`. We now do the call to `zpool export -a` unconditionally. Running this command when there is no zpool is a noop so it should not be a problem. In theory there is a risk that we could export a zpool that was not meant for exporting. However, that would involve somebody importing (or force importing) a zpool in the live installer environment and not wanting it exported at the end. This sounds like an very unlikely use case. Furthermore, this could already be a problem today since we invoke `zpool export` with the `-a` option (which all pools imported on the system). LP: #2073772 Signed-off-by: Olivier Gayot <[email protected]>
- Loading branch information