aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/preinit
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2013-11-25 08:34:55 +0000
committerJohn Crispin <john@openwrt.org>2013-11-25 08:34:55 +0000
commit93e9a71538c18a979c4999b1d54dd64e59e967ac (patch)
treeb0e9a6a8337202f2ac3f2d0cb268b57547a1d0f1 /package/base-files/files/lib/preinit
parent91de2648e948fc9163e16b2babd9e7e808bde94c (diff)
downloadupstream-93e9a71538c18a979c4999b1d54dd64e59e967ac.tar.gz
upstream-93e9a71538c18a979c4999b1d54dd64e59e967ac.tar.bz2
upstream-93e9a71538c18a979c4999b1d54dd64e59e967ac.zip
base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38909
Diffstat (limited to 'package/base-files/files/lib/preinit')
-rw-r--r--package/base-files/files/lib/preinit/30_failsafe_wait25
1 files changed, 17 insertions, 8 deletions
diff --git a/package/base-files/files/lib/preinit/30_failsafe_wait b/package/base-files/files/lib/preinit/30_failsafe_wait
index 6bce8ae49f..522565940c 100644
--- a/package/base-files/files/lib/preinit/30_failsafe_wait
+++ b/package/base-files/files/lib/preinit/30_failsafe_wait
@@ -5,7 +5,7 @@
fs_wait_for_key () {
local timeout=$3
local timer
- local do_failsafe
+ local do_keypress
local keypress_true="$(mktemp)"
local keypress_wait="$(mktemp)"
local keypress_sec="$(mktemp)"
@@ -40,6 +40,7 @@ fs_wait_for_key () {
} &
echo "Press the [$1] key and hit [enter] $2"
+ echo "Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level"
# if we're on the console we wait for input
{
while [ -r $keypress_wait ]; do
@@ -48,14 +49,22 @@ fs_wait_for_key () {
[ -n "$timer" ] || timer=1
timer="${timer%%\ *}"
[ $timer -ge 1 ] || timer=1
- do_failsafe=""
+ do_keypress=""
{
- read -t "$timer" do_failsafe
- if [ "$do_failsafe" = "$1" ]; then
- echo "true" >$keypress_true
- lock -u $keypress_wait
- rm -f $keypress_wait
- fi
+ read -t "$timer" do_keypress
+ case "$do_keypress" in
+ $1)
+ echo "true" >$keypress_true
+ ;;
+ 1 | 2 | 3 | 4)
+ echo "$do_keypress" >/tmp/debug_level
+ ;;
+ *)
+ continue;
+ ;;
+ esac
+ lock -u $keypress_wait
+ rm -f $keypress_wait
}
done
}