aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-11-25 14:40:42 +0100
committerThomas Deutschmann <whissi@gentoo.org>2019-11-25 14:40:42 +0100
commit5dbad2e10c32043f90e6507438d93c9a9d480e07 (patch)
tree7f3204298f73042bc94dd515f2cfa8389ba8c48f
parentinitrd.scripts: modules_scan(): Always load Virtio/HyperV modules (diff)
downloadgenkernel-5dbad2e1.tar.gz
genkernel-5dbad2e1.tar.bz2
genkernel-5dbad2e1.zip
initrd.scripts: modules_scan(): Disable smart module loading when root needs an external program
When using dolvm or domdadm for example, root won't be available until lvm program scanned for volumes and made them available or mdadm program was called to assemble RAID. So checking for root block device after each module was loaded won't save us any time instead will just waste time. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--defaults/initrd.scripts22
1 files changed, 11 insertions, 11 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 561788d8..c19701c8 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -53,17 +53,17 @@ modules_scan() {
# We don't know if kernel supports root filesystem so
# better load all filesystems ...
smart_loading=
- elif [ -n "${CRYPT_ROOT}" ] || [ -n "${CRYPT_SWAP}" ]
- then
- if [ "${1}" = "crypto" ]
- then
- smart_loading=
- elif [ "${1}" = "usb" ]
- then
- # We don't know if user is using an USB keyboard to
- # enter passphrase so better load USB ...
- smart_loading=
- fi
+ elif [ "${USE_MDADM}" = '1' ] \
+ || [ "${USE_LVM_NORMAL}" = '1' ] \
+ || [ "${USE_CRYPTSETUP}" = '1' ] \
+ || [ "${USE_BTRFS}" = '1' ] \
+ || [ "${USE_ZFS}" = '1' ] \
+ || [ "${USE_DMRAID_NORMAL}" = '1' ]
+ then
+ # 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=
fi
MODS=$(cat /etc/modules/${1} 2>/dev/null)