diff options
author | Daniel Carosone <dan@geek.com.au> | 2023-12-08 10:33:26 +1100 |
---|---|---|
committer | Daniel Carosone <dan@geek.com.au> | 2023-12-08 10:33:26 +1100 |
commit | 88f50101ac4b6e019123b107b3e028ab81df6527 (patch) | |
tree | b5b1e8108c7de4d2901ba76aad132120e088a674 /nixos/modules/tasks | |
parent | 2c7f3c0fb7c08a0814627611d9d7d45ab6d75335 (diff) | |
download | nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar.gz nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar.bz2 nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar.lz nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar.xz nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.tar.zst nixlib-88f50101ac4b6e019123b107b3e028ab81df6527.zip |
nixos/zfs: check pool state with -d, like import
This can avoid unnecessary wait-looping for pool to be 'ready' on some systems when the paths don't match
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r-- | nixos/modules/tasks/filesystems/zfs.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 784040f0ce9e..fe2f70a2a67c 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -71,7 +71,7 @@ let done poolReady() { pool="$1" - state="$("${zpoolCmd}" import 2>/dev/null | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")" + state="$("${zpoolCmd}" import -d "${cfgZfs.devNodes}" 2>/dev/null | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")" if [[ "$state" = "ONLINE" ]]; then return 0 else |