dracut-functions: fix check=255 logic and dependencies

master
Harald Hoyer 2010-08-02 09:40:18 +02:00
parent 9c111e59c9
commit f007e84e8e
1 changed files with 16 additions and 8 deletions

View File

@ -483,6 +483,7 @@ check_module_deps() {
local moddir dep ret
# if we are already set to be loaded, we do not have to be checked again.
strstr " $mods_to_load " " $1 " && return
strstr " $omit_dracutmodules " " $1 " && return 1
# turn a module name into a directory, if we can.
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
[[ -d $moddir && -x $moddir/install ]] || return 1
@ -503,13 +504,14 @@ check_module_deps() {

should_source_module() {
local dep
local ret
if [[ $kernel_only = yes ]]; then
[[ -x $1/installkernel ]] && return 0
return 1
fi
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
[[ -x $1/check ]] || return 0
"$1/check" $hostonly || return 1
"$1/check" $hostonly || continue
for dep in $("$1/check" -d); do
check_module_deps "$dep" && continue
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
@ -527,8 +529,6 @@ check_modules() {
# This should never happen, but...
[[ -d $moddir ]] || continue

strstr "$omit_dracutmodules" "$mod" && continue

if ! strstr " $dracutmodules $add_dracutmodules " " $mod "; then
# module not in our list
if [[ $dracutmodules = all ]]; then
@ -538,6 +538,14 @@ check_modules() {
# skip this module
continue
fi
else
if [ -x "$moddir/check" ] \
&& "$moddir/check" -d > /dev/null 2>&1; then
check_module_deps "$mod" || {
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
continue
}
fi
fi

mods_to_load+=" $mod "