From 0b39f614e90905ae84ae8ce1a24145c4ece9978b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 22 Jun 2009 14:44:48 +0000 Subject: [PATCH] * Don't wait for CIFS "devices" (//share/path) to appear since they won't. This speeds up booting from CIFS a lot. svn path=/nixos/branches/modular-nixos/; revision=16023 --- modules/system/boot/stage-1-init.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/system/boot/stage-1-init.sh b/modules/system/boot/stage-1-init.sh index 7a5ebedd7a86..1ba65cc24cc5 100644 --- a/modules/system/boot/stage-1-init.sh +++ b/modules/system/boot/stage-1-init.sh @@ -223,15 +223,22 @@ for ((n = 0; n < ${#mountPoints[*]}; n++)); do # "device" should be taken relative to /mnt-root, not /. Assume # that every device that starts with / but doesn't start with /dev # is a bind mount. + pseudoDevice= case $device in /dev/*) ;; //*) # Don't touch SMB/CIFS paths. + pseudoDevice=1 ;; /*) device=/mnt-root$device ;; + *) + # Not an absolute path; assume that it's a pseudo-device + # like an NFS path (e.g. "server:/path"). + pseudoDevice=1 + ;; esac # USB storage devices tend to appear with some delay. It would be @@ -239,8 +246,8 @@ for ((n = 0; n < ${#mountPoints[*]}; n++)); do # alas... So just wait for a few seconds for the device to # appear. If it doesn't appear, try to mount it anyway (and # probably fail). This is a fallback for non-device "devices" - # that we don't properly recognise (like NFS mounts). - if ! test -e $device; then + # that we don't properly recognise. + if test -z "$pseudoDevice" -a ! -e $device; then echo -n "waiting for device $device to appear..." for ((try = 0; try < 10; try++)); do sleep 1