diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-02-16 12:23:31 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-02-17 09:08:33 +0100 |
commit | acc69bdddc50262b8f91034c248279d8dc734284 (patch) | |
tree | 0dcb3aeb7aba700697457d58a6eb7393f2ab09ec /defaultenv | |
parent | f52cf03aad13b49c6ff756610e7d3a777e8ee15e (diff) | |
download | barebox-acc69bdddc50262b8f91034c248279d8dc734284.tar.gz barebox-acc69bdddc50262b8f91034c248279d8dc734284.tar.xz |
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>
Diffstat (limited to 'defaultenv')
-rw-r--r-- | defaultenv/defaultenv-2-base/bin/init | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/defaultenv/defaultenv-2-base/bin/init b/defaultenv/defaultenv-2-base/bin/init index 34807bcf58..30651e55d2 100644 --- a/defaultenv/defaultenv-2-base/bin/init +++ b/defaultenv/defaultenv-2-base/bin/init @@ -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 |