mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-30 01:17:28 +03:00
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
This commit is contained in:
parent
2c7f3c0fb7
commit
88f50101ac
@ -71,7 +71,7 @@ let
|
|||||||
done
|
done
|
||||||
poolReady() {
|
poolReady() {
|
||||||
pool="$1"
|
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
|
if [[ "$state" = "ONLINE" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user