Ubuntu Pastebin

Paste from smoser at Tue, 23 Aug 2016 13:55:44 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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}"
Download as text