git.iko.soy/typeable/nixpkgs
on master help sign in
stage-1: retry mounting ZFS root a few times

This is a workaround for NixOS/nixpkgs#25383

commite2341359953dcf1361c47e80d6ca3bdb83cfbdc6 authorRicardo M. Correia <rcorreia@wizy.org> dateMon 25 Sep 2017, 13:07 (9 years ago) parent3327b9a
1 file changed+4−2
nixos/modules/system/boot/stage-1-init.sh+4−2
nixos/modules/system/boot/stage-1-init.sh+4−2
@@ -370,12 +370,14 @@ mountFS() {
370370
371371 mkdir -p "/mnt-root$mountPoint"
372372
373− # For CIFS mounts, retry a few times before giving up.
373+ # For ZFS and CIFS mounts, retry a few times before giving up.
374+ # We do this for ZFS as a workaround for issue NixOS/nixpkgs#25383.
374375 local n=0
375376 while true; do
376377 mount "/mnt-root$mountPoint" && break
377− if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
378+ if [ \( "$fsType" != cifs -a "$fsType" != zfs \) -o "$n" -ge 10 ]; then fail; break; fi
378379 echo "retrying..."
380+ sleep 1
379381 n=$((n + 1))
380382 done
381383