summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2017-09-25 13:07:25 +0200
committerRicardo M. Correia <rcorreia@wizy.org>2020-06-04 14:55:10 +0200
commite2341359953dcf1361c47e80d6ca3bdb83cfbdc6 (patch)
tree686983e922575b34c04c7a25f58cdb724a004182 /nixos
parent3327b9a385f5ec2e219bf93b48896772b3f66afc (diff)
downloadnixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar.gz
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar.bz2
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar.lz
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar.xz
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.tar.zst
nixpkgs-e2341359953dcf1361c47e80d6ca3bdb83cfbdc6.zip
stage-1: retry mounting ZFS root a few times
This is a workaround for NixOS/nixpkgs#25383
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 607aec87f01..0f6648b4dca 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -370,12 +370,14 @@ mountFS() {
 
     mkdir -p "/mnt-root$mountPoint"
 
-    # For CIFS mounts, retry a few times before giving up.
+    # For ZFS and CIFS mounts, retry a few times before giving up.
+    # We do this for ZFS as a workaround for issue NixOS/nixpkgs#25383.
     local n=0
     while true; do
         mount "/mnt-root$mountPoint" && break
-        if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
+        if [ \( "$fsType" != cifs -a "$fsType" != zfs \) -o "$n" -ge 10 ]; then fail; break; fi
         echo "retrying..."
+        sleep 1
         n=$((n + 1))
     done