[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#285318: leave busybox shell to continue booting



Package: initrd-tools
Version: 0.1.75
Severity: wishlist


Below you can find a small patch to cleanup code and to
allow it to continue the boot procedure by leaving the
busybox shell. Without this the busybox shell is pretty
useless, isn't it?


Regards

Harri
--- init~	2004-09-18 13:17:34.000000000 +0200
+++ init	2004-12-12 15:23:14.570249964 +0100
@@ -345,6 +345,27 @@
 	. "$@"
 }
 
+ask4shell() {
+	local timout
+	local pid
+	local line
+
+	trap "timeout=yes" USR1
+
+	echo "Waiting for $DELAY seconds, press ENTER to obtain a shell."
+	{ sleep $DELAY; kill -USR1 $$ 2> /dev/null; }&
+	pid=$!
+	read line
+	trap "" USR1
+	kill $pid
+	wait
+
+	if [ ! "$timeout" ]; then
+		echo "Press ^D to proceed"
+		sh
+	fi
+}
+
 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/bin2
 
 . /linuxrc.conf
@@ -376,18 +397,7 @@
 call /loadmodules
 
 if [ $DELAY -gt 0 ]; then
-	echo "Waiting for $DELAY seconds, press ENTER to obtain a shell."
-
-	trap "timeout=yes" USR1
-	timeout=
-	{ sleep $DELAY; kill -USR1 $$ 2> /dev/null; }&
-	pid=$!
-	read line
-	trap "" USR1
-	kill $pid
-	wait
-
-	[ $timeout ] || exec sh
+	ask4shell
 fi
 
 call /script

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: