Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/
Date: Wed, 27 Nov 2019 16:40:24
Message-Id: 1574870748.80b8bc853f44dbd8e4042b4ac3c64a1f5d8f63af.whissi@gentoo
1 commit: 80b8bc853f44dbd8e4042b4ac3c64a1f5d8f63af
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 27 10:43:41 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 27 16:05:48 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=80b8bc85
7
8 initrd.scripts: start_sshd(): Only set gk.prompt.timeout when dropbear was actually started
9
10 If we failed to start dropbear for some reason, user has no chance to
11 answer prompt without physical access so setting gk.prompt.timeout
12 would only cause an unnecessary delay.
13
14 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
15
16 defaults/initrd.scripts | 14 ++++++++------
17 1 file changed, 8 insertions(+), 6 deletions(-)
18
19 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
20 index 96ca339..dd5be3b 100644
21 --- a/defaults/initrd.scripts
22 +++ b/defaults/initrd.scripts
23 @@ -2250,12 +2250,6 @@ start_sshd() {
24 return
25 fi
26
27 - if [ "${GK_PROMPT_TIMEOUT}" = '0' ]
28 - then
29 - warn_msg "Changing gk.prompt.timeout=0 to 30 to allow remote user to answer prompts ..."
30 - GK_PROMPT_TIMEOUT=30
31 - fi
32 -
33 if [ ! -x "/usr/sbin/dropbear" ]
34 then
35 bad_msg "/usr/sbin/dropbear not found! Was initramfs built without --ssh parameter?"
36 @@ -2275,6 +2269,14 @@ start_sshd() {
37
38 good_msg "Starting dropbear sshd ..." ${QUIET}
39 run /usr/sbin/dropbear -p ${GK_SSHD_PORT} -R -P "${GK_SSHD_PIDFILE}" 2>/var/log/dropbear.log
40 + if [ $? -eq 0 ]
41 + then
42 + if [ "${GK_PROMPT_TIMEOUT}" = '0' ]
43 + then
44 + warn_msg "Changing gk.prompt.timeout=0 to 30 to allow remote user to answer prompts ..."
45 + GK_PROMPT_TIMEOUT=30
46 + fi
47 + fi
48 }
49
50 wait_sshd() {