commit: 9539ed41bb78bd6c3630b7747593090afbf14e6c Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Mon Jul 15 22:19:57 2019 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Mon Jul 15 22:19:57 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9539ed41
linuxrc: Add rootdelay timeout indicator Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> defaults/initrd.scripts | 8 ++++++++ defaults/linuxrc | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index c4a037b..a47b1ed 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -882,6 +882,14 @@ good_msg() { [ "$2" != '1' ] && printf "%b\n" "${GOOD}>>${NORMAL}${BOLD} ${msg_string} ${NORMAL}" } +good_msg_n() { + [ -n "${QUIET}" ] && [ -z "${DEBUG}" ] && return 0 + + msg_string=${1} + msg_string="${msg_string:-...}" + [ "$2" != '1' ] && printf "%b" "${GOOD}>>${NORMAL}${BOLD} ${msg_string}" +} + bad_msg() { msg_string=${1} msg_string="${msg_string:-...}" diff --git a/defaults/linuxrc b/defaults/linuxrc index d84cc65..f1cbec1 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -593,11 +593,12 @@ then fi # Determine root device -good_msg 'Determining root device ...' ROOTDELAY_100MSEC=1 [ -n "${ROOTDELAY}" ] && ROOTDELAY_100MSEC=$((${ROOTDELAY} * 10)) while true do + good_msg_n 'Determining root device ...' + while [ "${got_good_root}" != '1' ] do # Start of sleep loop waiting on root @@ -624,6 +625,7 @@ do then got_good_root=1 REAL_ROOT="${ROOT_DEV}" + echo good_msg "Detected real_root=${ROOT_DEV}" break fi @@ -643,6 +645,7 @@ do got_good_root=1 REAL_ROOT=${ROOT_DEV} ROOTFSTYPE=zfs + echo good_msg "Detected real_root=${ROOT_DEV}" break else @@ -661,6 +664,7 @@ do got_good_root=1 REAL_ROOT=${i} ROOTFSTYPE=zfs + echo good_msg "Detected real_root=${ROOT_DEV}" break fi @@ -682,6 +686,12 @@ do then let ROOTDELAY_100MSEC=${ROOTDELAY_100MSEC}-1 sleep 0.1s + + let ROOTDELAY_100MSEC_MODULO=${ROOTDELAY_100MSEC}%10 + if [ ${ROOTDELAY_100MSEC_MODULO} = 0 ] + then + printf "." + fi fi done # End of sleep loop waiting on root