diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2015-03-01 22:47:49 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-03-01 23:14:45 +0000 |
commit | 8402332453cb1fbce24a67a04eba92b0ade0514a (patch) | |
tree | 2cd38ba5e39abf240b5775eb5a1c590f00f87c88 /scripts/local | |
parent | d4e560101ccafb6d62656689c04c87316132fa27 (diff) |
local: Use max(30, rootdelay) as timeout for block device to appear
The rootdelay kernel parameter is specified as a fixed delay before
attempting to mount the root filesystem, not a timeout. In the
initramfs it is processed by udev's init-top script. This is being
used to workaround bug #678696, but as most users will set the
shortest value that seems to work, it is fragile. Using the same
value as a timeout makes our fix for #678696 fragile too.
We shouldn't really use $ROOTDELAY here at all, but as some users may
have a good reason for wanting a longer timeout and may depend on the
current behaviour, make our current default timeout of 30 seconds a
minimum.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'scripts/local')
-rw-r--r-- | scripts/local | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/local b/scripts/local index 54eb674..f6424f0 100644 --- a/scripts/local +++ b/scripts/local @@ -64,8 +64,11 @@ local_device_setup() if [ ! -e "$1" ] || ! $(get_fstype "$1" >/dev/null); then log_begin_msg "Waiting for $2 file system" - # Default delay is 30s (approximately) - slumber=${ROOTDELAY:-30} + # Timeout is max(30, rootdelay) seconds (approximately) + slumber=30 + if [ ${ROOTDELAY:-0} -gt $slumber ]; then + slumber=$ROOTDELAY + fi while true; do sleep 1 |