mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] defaultenv-2: init: don't call timeout again if the user intervened
@ 2015-02-16 11:23 Michael Olbrich
  2015-02-17  8:08 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Olbrich @ 2015-02-16 11:23 UTC (permalink / raw)
  To: barebox; +Cc: Michael Olbrich

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>
---
 defaultenv/defaultenv-2-base/bin/init | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/defaultenv/defaultenv-2-base/bin/init b/defaultenv/defaultenv-2-base/bin/init
index 34807bcf585d..30651e55d277 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
 
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] defaultenv-2: init: don't call timeout again if the user intervened
  2015-02-16 11:23 [PATCH] defaultenv-2: init: don't call timeout again if the user intervened Michael Olbrich
@ 2015-02-17  8:08 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-02-17  8:08 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: barebox

On Mon, Feb 16, 2015 at 12:23:31PM +0100, Michael Olbrich wrote:
> 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>
> ---
>  defaultenv/defaultenv-2-base/bin/init | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-17  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 11:23 [PATCH] defaultenv-2: init: don't call timeout again if the user intervened Michael Olbrich
2015-02-17  8:08 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox