From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A53AA13825B for ; Mon, 16 May 2016 06:55:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 067B0141E5; Mon, 16 May 2016 06:55:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C500D141E3 for ; Mon, 16 May 2016 06:55:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B893B340D02 for ; Mon, 16 May 2016 06:55:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 901C6970 for ; Mon, 16 May 2016 06:55:43 +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: <1463381344.67893b749b83fd716e55fa7c865f4c924454ee24.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.defaults defaults/linuxrc doc/genkernel.8.txt X-VCS-Directories: doc/ defaults/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 67893b749b83fd716e55fa7c865f4c924454ee24 X-VCS-Branch: master Date: Mon, 16 May 2016 06:55:43 +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-Archives-Salt: c266a1ef-fbf6-432d-a692-f31d7f3d3689 X-Archives-Hash: d347fbd47f0ea4c9fdd4cd9bb89b3b13 commit: 67893b749b83fd716e55fa7c865f4c924454ee24 Author: Robin H. Johnson gentoo org> AuthorDate: Mon May 16 06:40:43 2016 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon May 16 06:49:04 2016 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=67893b74 defaults/linuxrc: bug #232733: implement rootwait. Based on patch from John Klug gmail.com>. Signed-off-by: Robin H. Johnson gentoo.org> defaults/initrd.defaults | 1 + defaults/linuxrc | 15 +++++++++++++++ doc/genkernel.8.txt | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults index a5eb3ba..b63ebd0 100755 --- a/defaults/initrd.defaults +++ b/defaults/initrd.defaults @@ -60,6 +60,7 @@ REAL_ROOT='' CONSOLE='/dev/console' NEW_ROOT='/newroot' no_umounts='/newroot|/mnt/aufs-dev|/mnt/aufs-rw-branch|/mnt/livecd|/mnt/cdrom|/.unions/memory|/.unions/memory/xino' +ROOTDELAY=1 CDROOT='0' CDROOT_DEV='' CDROOT_TYPE='auto' diff --git a/defaults/linuxrc b/defaults/linuxrc index ac8f215..72e1543 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -133,6 +133,12 @@ do scandelay) SDELAY=3 ;; + rootdelay=*|rootwait=*) + ROOTDELAY=${x#*=} + ;; + rootdelay|rootwait) + ROOTDELAY=5 + ;; # Module no-loads doload=*) MDOLIST=${x#*=} @@ -485,10 +491,14 @@ fi # Determine root device good_msg 'Determining root device ...' +ROOTDELAY_100MSEC=1 +[ -n "${ROOTDELAY}" ] && ROOTDELAY_100MSEC=$(($ROOTDELAY * 10)) while true do while [ "${got_good_root}" != '1' ] do + # Start of sleep loop waiting on root + while [ ${ROOTDELAY_100MSEC} -ge 0 -a "${got_good_root}" != '1' ] ; do case "${REAL_ROOT}" in LABEL=*|UUID=*) @@ -574,6 +584,11 @@ do ;; esac + if [ "${got_good_root}" != '1' ] ; then + let ROOTDELAY_100MSEC=${ROOTDELAY_100MSEC}-1 + usleep 100 + fi + done # End of sleep loop waiting on root if [ "${REAL_ROOT}" = '' ] then # No REAL_ROOT determined/specified. Prompt user for root block device. diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index ab534cd..bab1034 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -464,6 +464,11 @@ which the ramdisk & initramfs scripts would recognize. Pauses for 10 seconds before running devfsd if no argument is specified; otherwise pauses for the number of specified seconds. +*rootdelay*[=<...>]:: +*rootwait*[=<...>]:: + Pauses for up to 3 seconds (or specified number of seconds) while + waiting for root device to appear during initramfs root scanning. + *ip*=<...>:: Normally used to tell the kernel that it should start a network interface. If present, the initrd will try to mount a livecd