From: Harald Hoyer Date: Wed, 3 Oct 2012 20:33:50 +0000 (-0400) Subject: dracut-functions.sh: do not check all modules for filesystems X-Git-Tag: 024~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecfa02bdc819db861128b3c1d5dd1ce1a4f8d27c;p=thirdparty%2Fdracut.git dracut-functions.sh: do not check all modules for filesystems --- diff --git a/dracut-functions.sh b/dracut-functions.sh index 47f3e87d1..aa709193b 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1133,6 +1133,9 @@ check_mount() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) local _ret local _moddep + + [ "${#host_fs_types[*]}" -le 0 ] && return 1 + # If we are already scheduled to be loaded, no need to check again. strstr " $mods_to_load " " $_mod " && return 0 strstr " $mods_checked_as_dep " " $_mod " && return 1 @@ -1147,13 +1150,23 @@ check_mount() { return 1 fi - if [ "${#host_fs_types[*]}" -gt 0 ]; then - module_check_mount $_mod || return 1 + if strstr " $dracutmodules $add_dracutmodules $force_add_dracutmodules" " $_mod "; then + module_check_mount $_mod; ret=$? + + # explicit module, so also accept ret=255 + [[ $ret = 0 || $ret = 255 ]] || return 1 else - # skip this module - return 1 + # module not in our list + if [[ $dracutmodules = all ]]; then + # check, if we can and should install this module + module_check_mount $_mod || return 1 + else + # skip this module + return 1 + fi fi + for _moddep in $(module_depends $_mod); do # handle deps as if they were manually added strstr " $add_dracutmodules " " $_moddep " || \