Unconditionally run zpool export -a
/ revert systemd-shutdown implementation
#2077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 tozpool 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 exports all zpools imported on the system).LP:#2073772