From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] defaultenv-2: add login support
Date: Wed, 4 Sep 2013 12:10:12 +0200 [thread overview]
Message-ID: <1378289412-28761-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1378289412-28761-1-git-send-email-plagnioj@jcrosoft.com>
request password to login is a timeout is specified and /env/etc/passwd
present
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
defaultenv-2/base/bin/init | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init
index ca02ba6..e696dce 100644
--- a/defaultenv-2/base/bin/init
+++ b/defaultenv-2/base/bin/init
@@ -16,11 +16,15 @@ global editcmd=sedit
[ -e /env/config-board ] && /env/config-board
/env/config
+# request password to login is a timeout is specified and /env/etc/passwd present
+[ -n ${global.login.timeout} ] && login_cmd=login
+
# allow to stop the boot before execute the /env/init/*
# but without waiting
timeout -s -a -v key 0
if [ "${key}" = "q" ]; then
+ ${login_cmd}
exit
fi
@@ -38,6 +42,7 @@ timeout -a $global.autoboot_timeout -v key
autoboot="$?"
if [ "${key}" = "q" ]; then
+ ${login_cmd}
exit
fi
@@ -48,7 +53,11 @@ fi
if [ -e /env/menu ]; then
if [ "${key}" != "m" ]; then
echo -e "\ntype exit to get to the menu"
+ ${login_cmd}
sh
fi
+ ${login_cmd}
/env/menu/mainmenu
fi
+
+${login_cmd}
--
1.8.4.rc1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-09-04 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-04 10:01 [PATCH 0/2] " Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 10:10 ` [PATCH 1/2] login: add globalvar timeout support Jean-Christophe PLAGNIOL-VILLARD
2013-09-04 10:10 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-09-06 7:06 ` [PATCH 2/2] defaultenv-2: add login support 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=1378289412-28761-2-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--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