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 D2CF1138334 for ; Wed, 27 Nov 2019 16:40:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5D14CE0901; Wed, 27 Nov 2019 16:40:23 +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 2FA6DE0901 for ; Wed, 27 Nov 2019 16:40:23 +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 19EC134D4DA for ; Wed, 27 Nov 2019 16:40:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5D8E48C7 for ; Wed, 27 Nov 2019 16:40:17 +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: <1574871536.008d2cf12926c2fe91139c4fed802c053676d74c.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 008d2cf12926c2fe91139c4fed802c053676d74c X-VCS-Branch: master Date: Wed, 27 Nov 2019 16:40:17 +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: bc47b315-eef1-465e-98c2-a71d40f92897 X-Archives-Hash: 10fb69af3a10cd6c80971cea212a6549 commit: 008d2cf12926c2fe91139c4fed802c053676d74c Author: Thomas Deutschmann gentoo org> AuthorDate: Wed Nov 27 12:08:07 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Wed Nov 27 16:18:56 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=008d2cf1 initrd.scripts: modules_load(): Log what we do Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.scripts | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 597fb09..59e39fc 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -29,30 +29,49 @@ modules_load() { modules_scan() { local MODS local loaded + local x local smart_loading=yes local _root_dev local root_dev_found="Root block device found, skipping loading of module group \"${1}\" ..." + MODS=$(cat /etc/modules/${1} 2>/dev/null) + if [ -z "${MODS}" ] + then + log_msg "/etc/modules/${1} is empty; Nothing to load for '${1}' ..." + return + fi + + if [ -z "${MODULES_SCAN_WARNING_SHOWN}" ] + then + local note_msg="NOTE: Due to how genkernel auto-detects your" + note_msg="${note_msg} hardware you will now see a lot of failed modprobe" \ + note_msg="${note_msg} attempts which you can ignore:" + + log_msg "${note_msg}" + + MODULES_SCAN_WARNING_SHOWN=yes + fi + if [ "${GK_HW_LOAD_ALL_MODULES}" = '1' ] then - smart_loading= + smart_loading=no elif [ "${1}" = "virtio" ] || [ "${1}" = "hyperv" ] then # Virtio/HyperV modules group is special -- it's about # hypervisor support in general, not root block device - smart_loading= + smart_loading=no elif [ "${1}" = "net" ] then # We already load network modules only when we need # network so don't stop loading network modules when # $REAL_ROOT is already present or we will probably # end up without network we wanted ... - smart_loading= + smart_loading=no elif [ "${1}" = "fs" ] then # We don't know if kernel supports root filesystem so # better load all filesystems ... - smart_loading= + smart_loading=no elif [ "${USE_MDADM}" = '1' ] \ || [ "${USE_LVM_NORMAL}" = '1' ] \ || [ "${USE_CRYPTSETUP}" = '1' ] \ @@ -63,24 +82,13 @@ modules_scan() { # All of this will require the call of another program before # root becomes available so checking for root after each module # was loaded will only waste time. - smart_loading= + smart_loading=no fi - MODS=$(cat /etc/modules/${1} 2>/dev/null) - [ -n "${MODS}" ] && [ -z "${QUIET}" ] && \ + log_msg "Loading modules of module group '${1}' (smart loading: ${smart_loading}) ..." + [ -z "${QUIET}" ] && \ printf "%b" "${BOLD} ::${NORMAL} Loading from ${1}: " - if [ -z "${MODULES_SCAN_WARNING_SHOWN}" ] - then - local note_msg="NOTE: Due to how genkernel auto-detects your" - note_msg="${note_msg} hardware you will now see a lot of failed modprobe" \ - note_msg="${note_msg} attempts which you can ignore:" - - log_msg "${note_msg}" - - MODULES_SCAN_WARNING_SHOWN=yes - fi - for x in ${MODS} do MLOAD=$(echo ${MLIST} | sed -e "s/.*${x}.*/${x}/") @@ -90,7 +98,7 @@ modules_scan() { printf "%b\n" "${BOLD} ::${NORMAL} Skipping ${x} ..." elif [ "${MLOAD}" = "${MLIST}" ] then - if [ -n "${smart_loading}" ] + if [ "${smart_loading}" = "yes" ] then _root_dev=$(findfs "${REAL_ROOT}" 2>/dev/null) @@ -124,7 +132,7 @@ modules_scan() { printf "%b\n" "${BOLD} ::${NORMAL} Skipping ${x} ..." fi done - [ -n "${MODS}" ] && [ -z "${QUIET}" ] && echo + [ -z "${QUIET}" ] && echo } uppercase() {