Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/
Date: Fri, 01 Mar 2019 06:00:27
Message-Id: 1551419946.3b69162f8760e4f49631706723921c3c5dc6986e.robbat2@gentoo
1 commit: 3b69162f8760e4f49631706723921c3c5dc6986e
2 Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com>
3 AuthorDate: Sat Jan 5 01:29:01 2019 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 1 05:59:06 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3b69162f
7
8 Fix init/login-remote logic so that init keeps going once disks are decrypted
9
10 * Kill the cryptsetup process started by init, otherwise it will hang
11 forever.
12 * Make init check for an already-opened device before prompting the
13 user, otherwise we have to wait for the prompt_user calls to time out.
14
15 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
16
17 defaults/initrd.scripts | 10 +++++-----
18 defaults/login-remote.sh | 3 +++
19 2 files changed, 8 insertions(+), 5 deletions(-)
20
21 diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
22 index a88ed60..c57f016 100644
23 --- a/defaults/initrd.scripts
24 +++ b/defaults/initrd.scripts
25 @@ -1295,8 +1295,12 @@ openLUKS() {
26 while [ 1 ]
27 do
28 local gpg_cmd=""
29 + if [ -e ${flag_opened} ]
30 + then
31 + good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
32 + break
33 # if crypt_silent=1 and some error occurs, enter shell quietly
34 - if [ \( ${CRYPT_SILENT} -eq 1 \) -a \( \( \( ${DEV_ERROR} -eq 1 \) -o \( ${KEY_ERROR} -eq 1 \) \) -o \( ${KEYDEV_ERROR} -eq 1 \) \) ]
35 + elif [ \( ${CRYPT_SILENT} -eq 1 \) -a \( \( \( ${DEV_ERROR} -eq 1 \) -o \( ${KEY_ERROR} -eq 1 \) \) -o \( ${KEYDEV_ERROR} -eq 1 \) \) ]
36 then
37 run_shell
38 elif [ ${DEV_ERROR} -eq 1 ]
39 @@ -1311,10 +1315,6 @@ openLUKS() {
40 then
41 prompt_user "LUKS_KEYDEV" "${LUKS_NAME} key device"
42 KEYDEV_ERROR=0
43 - elif [ -e ${flag_opened} ]
44 - then
45 - good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
46 - break
47 else
48 LUKS_DEVICE=$(find_real_device "${LUKS_DEVICE}")
49
50
51 diff --git a/defaults/login-remote.sh b/defaults/login-remote.sh
52 index 4d7aac6..c667b5e 100644
53 --- a/defaults/login-remote.sh
54 +++ b/defaults/login-remote.sh
55 @@ -104,6 +104,9 @@ openLUKSremote() {
56 then
57 touch ${flag_opened}
58 good_msg "LUKS device ${LUKS_DEVICE} opened" ${CRYPT_SILENT}
59 + # Kill the cryptsetup process started by init
60 + # so that the boot process can continue
61 + killall cryptsetup
62 break
63 else
64 bad_msg "Failed to open LUKS device ${LUKS_DEVICE}" ${CRYPT_SILENT}