public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/
Date: Mon, 16 May 2016 06:55:43 +0000 (UTC)	[thread overview]
Message-ID: <1463381344.67893b749b83fd716e55fa7c865f4c924454ee24.robbat2@gentoo> (raw)

commit:     67893b749b83fd716e55fa7c865f4c924454ee24
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 06:40:43 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> 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 <ski.brimson <AT> gmail.com>.

Signed-off-by: Robin H. Johnson <robbat2 <AT> 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


             reply	other threads:[~2016-05-16  6:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16  6:55 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-03-14 20:05 [gentoo-commits] proj/genkernel:master commit in: doc/, defaults/ Thomas Deutschmann
2021-03-14 20:05 Thomas Deutschmann
2020-01-29 22:28 Thomas Deutschmann
2020-01-14  1:36 Thomas Deutschmann
2019-07-18 20:15 Thomas Deutschmann
2018-06-12 21:26 Robin H. Johnson
2013-04-29  8:56 Fabio Erculiani
2013-04-25  6:22 Fabio Erculiani
2013-03-31 12:47 Peter Hjalmarsson
2012-11-20  0:59 Robin H. Johnson
2012-01-05 16:51 Sebastian Pipping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463381344.67893b749b83fd716e55fa7c865f4c924454ee24.robbat2@gentoo \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox