summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2016-05-15 23:40:43 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2016-05-15 23:49:04 -0700
commit67893b749b83fd716e55fa7c865f4c924454ee24 (patch)
treec2259fafb0af91b3dcb6fcffc4048f6f98413339
parentarch/x86/arch-config: bug #582318, explicitly set non-64bit so cross-compile ... (diff)
downloadgenkernel-67893b749b83fd716e55fa7c865f4c924454ee24.tar.gz
genkernel-67893b749b83fd716e55fa7c865f4c924454ee24.tar.bz2
genkernel-67893b749b83fd716e55fa7c865f4c924454ee24.zip
defaults/linuxrc: bug #232733: implement rootwait.
Based on patch from John Klug <ski.brimson@gmail.com>. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xdefaults/initrd.defaults1
-rw-r--r--defaults/linuxrc15
-rw-r--r--doc/genkernel.8.txt5
3 files changed, 21 insertions, 0 deletions
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