diff --git a/init b/init
index 8fbf833..970c3f1 100755
--- a/init
+++ b/init
@@ -243,10 +243,6 @@ maybe_break modules
load_modules
[ "$quiet" != "y" ] && log_end_msg
-if [ "$ROOTDELAY" ]; then
- sleep $ROOTDELAY
-fi
-
maybe_break premount
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
run_scripts /scripts/init-premount
diff --git a/scripts/local b/scripts/local
index 441428b..7998568 100644
--- a/scripts/local
+++ b/scripts/local
@@ -49,9 +49,24 @@ local_device_setup()
# If wait-for-root understands this prefix, then use it to wait for
# the device rather than settling the whole of udev.
+
+ # Timeout is max(30, rootdelay) seconds (approximately)
+ local slumber=30
+ case $DPKG_ARCH in
+ powerpc|ppc64|ppc64el)
+ slumber=180
+ ;;
+ *)
+ slumber=30
+ ;;
+ esac
+ if [ ${ROOTDELAY:-0} -gt $slumber ]; then
+ slumber=$ROOTDELAY
+ fi
+
case "$dev_id" in
UUID=*|LABEL=*|/dev/*)
- FSTYPE=$( wait-for-root "$dev_id" 10 )
+ FSTYPE=$( wait-for-root "$dev_id" $slumber )
;;
*)
wait_for_udev 10
@@ -78,23 +93,13 @@ local_device_setup()
# to allow for asynchronous device discovery (e.g. USB). We
# also need to keep invoking the local-block scripts in case
# there are devices stacked on top of those.
+ #
+ # in ubuntu, we should never actually enter this loop as wait-for-root
+ # above should waited until the device appeared.
if ! real_dev=$(resolve_device "${dev_id}") ||
! get_fstype "${real_dev}" >/dev/null; then
log_begin_msg "Waiting for ${name} file system"
- # Timeout is max(30, rootdelay) seconds (approximately)
- case $DPKG_ARCH in
- powerpc|ppc64|ppc64el)
- slumber=180
- ;;
- *)
- slumber=30
- ;;
- esac
- if [ ${ROOTDELAY:-0} -gt $slumber ]; then
- slumber=$ROOTDELAY
- fi
-
while true; do
sleep 1
local_block "${dev_id}"