about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorWout Mertens <Wout.Mertens@gmail.com>2015-02-09 19:48:17 +0100
committerWout Mertens <Wout.Mertens@gmail.com>2015-02-09 21:53:51 +0100
commit8f42f33c456127183703c778d9d31bc46483ebf9 (patch)
treefb782450797c061284b200db555442b5830978a5 /nixos/modules
parenta81cfcc47527d222e6ae7fd5a5e22b70760f0227 (diff)
downloadnixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar.gz
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar.bz2
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar.lz
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar.xz
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.tar.zst
nixlib-8f42f33c456127183703c778d9d31bc46483ebf9.zip
stage-1-init: better warnings
- Suppress spurious LVM FD3 warning:
  See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432986
- Warn when device doesn't come online
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 0b7d4de6d205..8f185217c3f8 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -7,6 +7,8 @@ export LD_LIBRARY_PATH=@extraUtils@/lib
 export PATH=@extraUtils@/bin
 ln -s @extraUtils@/bin /bin
 
+# Stop LVM complaining about fd3
+export LVM_SUPPRESS_FD_WARNINGS=true
 
 fail() {
     if [ -n "$panicOnFail" ]; then exit 1; fi
@@ -347,7 +349,8 @@ while read -u 3 mountPoint; do
     # that we don't properly recognise.
     if test -z "$pseudoDevice" -a ! -e $device; then
         echo -n "waiting for device $device to appear..."
-        for try in $(seq 1 20); do
+        try=20
+        while [ $try -gt 0 ]; do
             sleep 1
             # also re-try lvm activation now that new block devices might have appeared
             lvm vgchange -ay
@@ -355,8 +358,12 @@ while read -u 3 mountPoint; do
             udevadm trigger --action=add
             if test -e $device; then break; fi
             echo -n "."
+            try=$((try - 1))
         done
         echo
+        if [ $try -eq 0 ]; then
+          echo "Timed out waiting for device $device, trying to mount anyway."
+        fi
     fi
 
     # Wait once more for the udev queue to empty, just in case it's