dracut-functions: fix check=255 logic and dependencies
parent
9c111e59c9
commit
f007e84e8e
|
@ -482,7 +482,8 @@ inst_opt_decompress() {
|
||||||
check_module_deps() {
|
check_module_deps() {
|
||||||
local moddir dep ret
|
local moddir dep ret
|
||||||
# if we are already set to be loaded, we do not have to be checked again.
|
# if we are already set to be loaded, we do not have to be checked again.
|
||||||
strstr "$mods_to_load" " $1 " && return
|
strstr " $mods_to_load " " $1 " && return
|
||||||
|
strstr " $omit_dracutmodules " " $1 " && return 1
|
||||||
# turn a module name into a directory, if we can.
|
# turn a module name into a directory, if we can.
|
||||||
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||||
[[ -d $moddir && -x $moddir/install ]] || return 1
|
[[ -d $moddir && -x $moddir/install ]] || return 1
|
||||||
|
@ -503,13 +504,14 @@ check_module_deps() {
|
||||||
|
|
||||||
should_source_module() {
|
should_source_module() {
|
||||||
local dep
|
local dep
|
||||||
|
local ret
|
||||||
if [[ $kernel_only = yes ]]; then
|
if [[ $kernel_only = yes ]]; then
|
||||||
[[ -x $1/installkernel ]] && return 0
|
[[ -x $1/installkernel ]] && return 0
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
|
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
|
||||||
[[ -x $1/check ]] || return 0
|
[[ -x $1/check ]] || return 0
|
||||||
"$1/check" $hostonly || return 1
|
"$1/check" $hostonly || continue
|
||||||
for dep in $("$1/check" -d); do
|
for dep in $("$1/check" -d); do
|
||||||
check_module_deps "$dep" && continue
|
check_module_deps "$dep" && continue
|
||||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||||
|
@ -523,13 +525,11 @@ check_modules() {
|
||||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||||
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||||
# If we are already scheduled to be loaded, no need to check again.
|
# If we are already scheduled to be loaded, no need to check again.
|
||||||
strstr "$mods_to_load" " $mod " && continue
|
strstr " $mods_to_load " " $mod " && continue
|
||||||
# This should never happen, but...
|
# This should never happen, but...
|
||||||
[[ -d $moddir ]] || continue
|
[[ -d $moddir ]] || continue
|
||||||
|
|
||||||
strstr "$omit_dracutmodules" "$mod" && continue
|
if ! strstr " $dracutmodules $add_dracutmodules " " $mod "; then
|
||||||
|
|
||||||
if ! strstr "$dracutmodules $add_dracutmodules" "$mod"; then
|
|
||||||
# module not in our list
|
# module not in our list
|
||||||
if [[ $dracutmodules = all ]]; then
|
if [[ $dracutmodules = all ]]; then
|
||||||
# check, if we can install this module
|
# check, if we can install this module
|
||||||
|
@ -538,6 +538,14 @@ check_modules() {
|
||||||
# skip this module
|
# skip this module
|
||||||
continue
|
continue
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
mods_to_load+=" $mod "
|
mods_to_load+=" $mod "
|
||||||
|
@ -546,8 +554,8 @@ check_modules() {
|
||||||
modcheck=$add_dracutmodules
|
modcheck=$add_dracutmodules
|
||||||
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
|
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
|
||||||
for mod in $modcheck; do
|
for mod in $modcheck; do
|
||||||
strstr "$mods_to_load" "$mod" && continue
|
strstr " $mods_to_load " " $mod " && continue
|
||||||
strstr "$omit_dracutmodules" "$mod" && continue
|
strstr " $omit_dracutmodules " " $mod " && continue
|
||||||
dwarning "Dracut module \"$mod\" cannot be found."
|
dwarning "Dracut module \"$mod\" cannot be found."
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue