From 8f42f33c456127183703c778d9d31bc46483ebf9 Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Mon, 9 Feb 2015 19:48:17 +0100 Subject: [PATCH] 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 --- nixos/modules/system/boot/stage-1-init.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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