Fix(zfs_volume); Volume mount/unmount with encryption

- Fix consistent use of fully qualified dataset path
- Add idempotent unmounting with encryption keys
This commit is contained in:
Bert Proesmans authored and Michael Hoang committed 2026-05-29 08:41:07 +02:00
1 parent 03e19b4f67
commit 5c7406ecc5
1 file changed
+7 -5
+7 -5
View File
@@ -88,8 +88,8 @@
default = {
dev = ''
${lib.optionalString (config.options.keylocation or "none" != "none") ''
if [ "$(zfs get keystatus ${config.name} -H -o value)" == "unavailable" ]; then
zfs load-key ${config.name}
if [ "$(zfs get keystatus ${config._name} -H -o value)" == "unavailable" ]; then
zfs load-key ${config._name}
fi
''}
@@ -102,9 +102,11 @@
inherit config options;
default = {
dev = ''
${lib.optionalString (
config.options.keylocation or "none" != "none"
) "zfs unload-key ${config.name}"}
${lib.optionalString (config.options.keylocation or "none" != "none") ''
if [ "$(zfs get keystatus ${config._name} -H -o value)" == "available" ]; then
zfs unload-key ${config._name}
fi
''}
${config.content._unmount.dev or ""}
'';