9
0
Fork 0

defaultenv-2: init: don't call timeout again if the user intervened

With autoboot_timeout=0 the second 'timeout' might not get another
character even if the user keeps a key pressed. So just reuse the key from
the first call.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Michael Olbrich 2015-02-16 12:23:31 +01:00 committed by Sascha Hauer
parent f52cf03aad
commit acc69bdddc
1 changed files with 5 additions and 2 deletions

View File

@ -37,6 +37,7 @@ fi
# allow to stop the boot before execute the /env/init/*
# but without waiting
timeout -s -a -v key 0
autoboot="$?"
if [ "${key}" = "q" ]; then
${login_cmd}
@ -57,8 +58,10 @@ fi
[ -n ${login_cmd} ] && global.console.input_allow=1
timeout -a $global.autoboot_timeout -v key
autoboot="$?"
if [ "$autoboot" = 0 ]; then
timeout -a $global.autoboot_timeout -v key
autoboot="$?"
fi
[ -n ${login_cmd} ] && global.console.input_allow=0