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 40F88139086 for ; Sun, 8 Jan 2017 00:40:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B2E86E0C8B; Sun, 8 Jan 2017 00:40:31 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 8AB9AE0C8B for ; Sun, 8 Jan 2017 00:40:31 +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 3B958341229 for ; Sun, 8 Jan 2017 00:40:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9E255263B for ; Sun, 8 Jan 2017 00:40:28 +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: <1483834188.e249807ef16b86e3223e05d6657698c2a4d77993.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts defaults/linuxrc X-VCS-Directories: defaults/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: e249807ef16b86e3223e05d6657698c2a4d77993 X-VCS-Branch: master Date: Sun, 8 Jan 2017 00:40:28 +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: f7b98363-f454-4d17-8656-cdc9126edf2f X-Archives-Hash: 139c4c95c3a2f9863b4b49700a36f73b commit: e249807ef16b86e3223e05d6657698c2a4d77993 Author: Daniel Robbins funtoo org> AuthorDate: Thu Feb 26 06:08:55 2015 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun Jan 8 00:09:48 2017 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=e249807e Add firstmods boot option (from Funtoo genkernel). Add firstmods boot option, which allows for a comma-delimited list of modules to try loading first. If rootfstype is specified too, and the block device is visible after these modules are loaded, then the massive module loading is skipped. (cherry picked from commit 7059bfd8c6a4a6ef9c0f3307388d37ad817dd3af) Signed-off-by: Robin H. Johnson gentoo.org> defaults/initrd.scripts | 10 ++++++++-- defaults/linuxrc | 10 +++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 17166e4..d00e1c7 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -19,12 +19,14 @@ call_func_timeout() } modules_load() { + fn=$1 + shift for module in $* do - echo ${module} >> /etc/modules/extra_load + echo ${module} >> /etc/modules/$fn done - modules_scan extra_load + modules_scan $fn } modules_scan() { @@ -44,6 +46,10 @@ modules_scan() { printf "%b\n" "${BOLD} ::${NORMAL} Skipping ${x}..." elif [ "${MLOAD}" = "${MLIST}" ] then + if [ "${ROOTFSTYPE}" != 'auto' ] && [ -b "${REAL_ROOT}" ]; then + echo "Root block device found, continuing..." + break + fi if [ -n "${DEBUG}" ]; then printf "%b" "${BOLD} ::${NORMAL} " printf "%b" "Scanning for ${x}..." diff --git a/defaults/linuxrc b/defaults/linuxrc index d09b96f..db8c490 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -139,6 +139,10 @@ do rootdelay|rootwait) ROOTDELAY=5 ;; + firstmods=*) + FIRSTMODS=${x#*=} + FIRSTMODS=$(echo ${MDOLIST} | sed -e 's/,/ /g') + ;; # Module no-loads doload=*) MDOLIST=${x#*=} @@ -363,6 +367,10 @@ then elif [ -d "/lib/modules/${KV}" ] then good_msg 'Loading modules' + if [ -n "$FIRSTMODS" ]; then + # try these modules first -- detected modules for root device: + modules_load firstmods ${FIRSTMODS} + fi # Load appropriate kernel modules if [ "${NODETECT}" != '1' ] then @@ -372,7 +380,7 @@ then done fi # Always eval doload=... - modules_load ${MDOLIST} + modules_load extra_load ${MDOLIST} else good_msg 'Skipping module load; no modules in the ramdisk!' fi