if [[ ! -f $_moddir/module-setup.sh ]]; then
# if we do not have a check script, we have no deps
[[ -x $_moddir/check ]] || return 0
- $_moddir/check -d
+ "$_moddir"/check -d
return $?
else
unset check depends cmdline install installkernel
depends() { true; }
- . $_moddir/module-setup.sh
+ . "$_moddir"/module-setup.sh
moddir=$_moddir depends
_ret=$?
unset check depends cmdline install installkernel
else
unset check depends cmdline install installkernel
cmdline() { true; }
- . $_moddir/module-setup.sh
- moddir=$_moddir cmdline
+ . "$_moddir"/module-setup.sh
+ moddir="$_moddir" cmdline
_ret=$?
unset check depends cmdline install installkernel
return $_ret
else
unset check depends cmdline install installkernel
install() { true; }
- . $_moddir/module-setup.sh
- moddir=$_moddir install
+ . "$_moddir"/module-setup.sh
+ moddir="$_moddir" install
_ret=$?
unset check depends cmdline install installkernel
return $_ret
else
unset check depends cmdline install installkernel
installkernel() { true; }
- . $_moddir/module-setup.sh
- moddir=$_moddir installkernel
+ . "$_moddir"/module-setup.sh
+ moddir="$_moddir" installkernel
_ret=$?
unset check depends cmdline install installkernel
return $_ret
local _moddep
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
+ # shellcheck disable=SC2154
[ "${#host_fs_types[@]}" -le 0 ] && return 1
# If we are already scheduled to be loaded, no need to check again.
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
+ # shellcheck disable=SC2154
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
return 1
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
- module_check_mount $_mod $_moddir; ret=$?
+ module_check_mount "$_mod" "$_moddir"; ret=$?
# explicit module, so also accept ret=255
[[ $ret = 0 || $ret = 255 ]] || return 1
# module not in our list
if [[ $dracutmodules = all ]]; then
# check, if we can and should install this module
- module_check_mount $_mod $_moddir || return 1
+ module_check_mount "$_mod" "$_moddir" || return 1
else
# skip this module
return 1
fi
fi
- for _moddep in $(module_depends $_mod $_moddir); do
+ for _moddep in $(module_depends "$_mod" "$_moddir"); do
# handle deps as if they were manually added
[[ " $dracutmodules " == *\ $_mod\ * ]] \
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
&& force_add_dracutmodules+=" $_moddep "
# if a module we depend on fail, fail also
- if ! check_module $_moddep; then
+ if ! check_module "$_moddep"; then
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
return 1
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
- module_check $_mod 1 $_moddir; ret=$?
+ module_check "$_mod" 1 "$_moddir"; ret=$?
else
- module_check $_mod 0 $_moddir; ret=$?
+ module_check "$_mod" 0 "$_moddir"; ret=$?
fi
# explicit module, so also accept ret=255
[[ $ret = 0 || $ret = 255 ]] || return 1
# module not in our list
if [[ $dracutmodules = all ]]; then
# check, if we can and should install this module
- module_check $_mod 0 $_moddir; ret=$?
+ module_check "$_mod" 0 "$_moddir"; ret=$?
if [[ $ret != 0 ]]; then
[[ $2 ]] && return 1
[[ $ret != 255 ]] && return 1