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 EFF4B138335 for ; Mon, 15 Jul 2019 22:39:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CEC9AE082B; Mon, 15 Jul 2019 22:39:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 AEDF8E082B for ; Mon, 15 Jul 2019 22:39:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 53D95347C53 for ; Mon, 15 Jul 2019 22:39:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 67DF56F8 for ; Mon, 15 Jul 2019 22:39:32 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1563221484.ccf10d5bff7cf622888b45fed3eb79213f5743bd.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/linuxrc X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: ccf10d5bff7cf622888b45fed3eb79213f5743bd X-VCS-Branch: master Date: Mon, 15 Jul 2019 22:39:32 +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: cc604e3a-6b9c-4b24-b3d0-7ed6c5097d2d X-Archives-Hash: f545bc0d4fa544b7b9c7f32fa6e9330a commit: ccf10d5bff7cf622888b45fed3eb79213f5743bd Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jul 15 20:11:24 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 15 20:11:24 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ccf10d5b linuxrc: Fix waiting on root The idea of that loop is to respect ROOTDELAY and allow for slow devices to come up. But if we will prompt already on first failure, this doesn't work. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/linuxrc | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 63e2360..5a95ece 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -623,13 +623,9 @@ do if [ ${retval} -eq 0 ] && [ -n "${ROOT_DEV}" ] then got_good_root=1 - good_msg "Detected real_root=${ROOT_DEV}" REAL_ROOT="${ROOT_DEV}" + good_msg "Detected real_root=${ROOT_DEV}" break - else - prompt_user "REAL_ROOT" "root block device" - got_good_root=0 - continue fi ;; ZFS*) @@ -647,10 +643,10 @@ do got_good_root=1 REAL_ROOT=${ROOT_DEV} ROOTFSTYPE=zfs + good_msg "Detected real_root=${ROOT_DEV}" + break else bad_msg "${ROOT_DEV} is not a filesystem" - prompt_user "REAL_ROOT" "root block device" - got_good_root=0 continue fi else @@ -660,28 +656,17 @@ do for i in ${BOOTFS} do zfs get type ${i} > /dev/null 2>&1 - retval=$? - - if [ ${retval} -eq 0 ] + if [ $? -eq 0 ] then got_good_root=1 REAL_ROOT=${i} ROOTFSTYPE=zfs + good_msg "Detected real_root=${ROOT_DEV}" break fi done - else - got_good_root=0 fi fi - - if [ ${got_good_root} -ne 1 ] - then - prompt_user "REAL_ROOT" "root block device" - got_good_root=0 - fi - - continue ;; esac @@ -692,7 +677,7 @@ do fi done # End of sleep loop waiting on root - if [ "${REAL_ROOT}" = '' ] + if [ -z "${REAL_ROOT}" ] then # No REAL_ROOT determined/specified. Prompt user for root block device. prompt_user "REAL_ROOT" "root block device"