stage-1: retry mounting ZFS root a few times
This is a workaround for NixOS/nixpkgs#25383
This commit is contained in:
parent
3327b9a385
commit
e234135995
1 changed files with 4 additions and 2 deletions
|
@ -370,12 +370,14 @@ mountFS() {
|
||||||
|
|
||||||
mkdir -p "/mnt-root$mountPoint"
|
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
|
local n=0
|
||||||
while true; do
|
while true; do
|
||||||
mount "/mnt-root$mountPoint" && break
|
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..."
|
echo "retrying..."
|
||||||
|
sleep 1
|
||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue