mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
lib/types/bcachefs_filesystem: tolerate already-unlocked filesystem
This commit is contained in:
1 parent
21d9daf255
commit
403186440c
1 file changed
+15
-9
@@ -191,9 +191,11 @@
|
||||
(
|
||||
TEMPDIR="$(mktemp -d)";
|
||||
MNTPOINT="$(mktemp -d)";
|
||||
${lib.optionalString (
|
||||
config.passwordFile != null
|
||||
) ''bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}";''}
|
||||
${lib.optionalString (config.passwordFile != null) ''
|
||||
if ! bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}"; then
|
||||
test -d "/sys/fs/bcachefs/${config.uuid}";
|
||||
fi;
|
||||
''}
|
||||
mount \
|
||||
-t bcachefs \
|
||||
-o "${lib.concatStringsSep "," (lib.unique ([ "X-mount.mkdir" ] ++ config.mountOptions))}" \
|
||||
@@ -228,9 +230,11 @@
|
||||
# @todo Figure out why the "X-mount.mkdir" option here doesn't seem to work,
|
||||
# necessitating running `mkdir` here.
|
||||
mkdir -p "${rootMountPoint}${subvolume.mountpoint}";
|
||||
${lib.optionalString (
|
||||
config.passwordFile != null
|
||||
) ''bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}";''}
|
||||
${lib.optionalString (config.passwordFile != null) ''
|
||||
if ! bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}"; then
|
||||
test -d "/sys/fs/bcachefs/${config.uuid}";
|
||||
fi;
|
||||
''}
|
||||
mount \
|
||||
-t bcachefs \
|
||||
-o "${
|
||||
@@ -260,9 +264,11 @@
|
||||
# @todo Figure out why the "X-mount.mkdir" option here doesn't seem to work,
|
||||
# necessitating running `mkdir` here.
|
||||
mkdir -p "${rootMountPoint}${config.mountpoint}";
|
||||
${lib.optionalString (
|
||||
config.passwordFile != null
|
||||
) ''bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}";''}
|
||||
${lib.optionalString (config.passwordFile != null) ''
|
||||
if ! bcachefs unlock -k session "/dev/disk/by-uuid/${config.uuid}" < "${config.passwordFile}"; then
|
||||
test -d "/sys/fs/bcachefs/${config.uuid}";
|
||||
fi;
|
||||
''}
|
||||
mount \
|
||||
-t bcachefs \
|
||||
-o "${lib.concatStringsSep "," (lib.unique ([ "X-mount.mkdir" ] ++ config.mountOptions))}" \
|
||||
|
||||
Reference in new issue
Block a user