From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D3D00138334 for ; Fri, 1 Mar 2019 06:00:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B798FE0871; Fri, 1 Mar 2019 06:00:25 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 68D47E0871 for ; Fri, 1 Mar 2019 06:00:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1E0FA335CEE for ; Fri, 1 Mar 2019 06:00:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1153B55B for ; Fri, 1 Mar 2019 06:00:20 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1551419946.3b69162f8760e4f49631706723921c3c5dc6986e.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts defaults/login-remote.sh X-VCS-Directories: defaults/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 3b69162f8760e4f49631706723921c3c5dc6986e X-VCS-Branch: master Date: Fri, 1 Mar 2019 06:00:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 50519051-00e4-4e7b-b66d-a259be37866e X-Archives-Hash: e8783fa8337f006284da8cdfad84b968 commit: 3b69162f8760e4f49631706723921c3c5dc6986e Author: Louis Sautier gmail com> AuthorDate: Sat Jan 5 01:29:01 2019 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Mar 1 05:59:06 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3b69162f Fix init/login-remote logic so that init keeps going once disks are decrypted * Kill the cryptsetup process started by init, otherwise it will hang forever. * Make init check for an already-opened device before prompting the user, otherwise we have to wait for the prompt_user calls to time out. Signed-off-by: Robin H. Johnson gentoo.org> defaults/initrd.scripts | 10 +++++----- defaults/login-remote.sh | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index a88ed60..c57f016 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1295,8 +1295,12 @@ openLUKS() { while [ 1 ] do local gpg_cmd="" + if [ -e ${flag_opened} ] + then + good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else." + break # if crypt_silent=1 and some error occurs, enter shell quietly - if [ \( ${CRYPT_SILENT} -eq 1 \) -a \( \( \( ${DEV_ERROR} -eq 1 \) -o \( ${KEY_ERROR} -eq 1 \) \) -o \( ${KEYDEV_ERROR} -eq 1 \) \) ] + elif [ \( ${CRYPT_SILENT} -eq 1 \) -a \( \( \( ${DEV_ERROR} -eq 1 \) -o \( ${KEY_ERROR} -eq 1 \) \) -o \( ${KEYDEV_ERROR} -eq 1 \) \) ] then run_shell elif [ ${DEV_ERROR} -eq 1 ] @@ -1311,10 +1315,6 @@ openLUKS() { then prompt_user "LUKS_KEYDEV" "${LUKS_NAME} key device" KEYDEV_ERROR=0 - elif [ -e ${flag_opened} ] - then - good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else." - break else LUKS_DEVICE=$(find_real_device "${LUKS_DEVICE}") diff --git a/defaults/login-remote.sh b/defaults/login-remote.sh index 4d7aac6..c667b5e 100644 --- a/defaults/login-remote.sh +++ b/defaults/login-remote.sh @@ -104,6 +104,9 @@ openLUKSremote() { then touch ${flag_opened} good_msg "LUKS device ${LUKS_DEVICE} opened" ${CRYPT_SILENT} + # Kill the cryptsetup process started by init + # so that the boot process can continue + killall cryptsetup break else bad_msg "Failed to open LUKS device ${LUKS_DEVICE}" ${CRYPT_SILENT}