mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH] defaultenv-2: init: don't call timeout again if the user intervened
Date: Mon, 16 Feb 2015 12:23:31 +0100	[thread overview]
Message-ID: <1424085811-32526-1-git-send-email-m.olbrich@pengutronix.de> (raw)

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

             reply	other threads:[~2015-02-16 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 11:23 Michael Olbrich [this message]
2015-02-17  8:08 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424085811-32526-1-git-send-email-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox