filter modprobe error messages and log them. Very useful if modules.dep
is missing.
for_each_kmod_dep() {
local _func=$1 _kmod=$2 _cmd _modpath _options _found=0
shift 2
- modprobe "$@" --ignore-install --show-depends $_kmod 2>/dev/null | (
+ modprobe "$@" --ignore-install --show-depends $_kmod 2>"$initdir/modprobe.err" | (
while read _cmd _modpath _options; do
[[ $_cmd = insmod ]] || continue
$_func ${_modpath} || exit $?
[[ $_found -eq 0 ]] && exit 1
exit 0
)
+ egrep -v 'FATAL: Module .* not found.' "$initdir/modprobe.err" | derror
+ rm -f "$initdir/modprobe.err"
return $?
}