]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: do not redirect modprobe error output to /dev/null
authorHarald Hoyer <harald@redhat.com>
Fri, 20 May 2011 18:12:54 +0000 (20:12 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 May 2011 15:40:44 +0000 (17:40 +0200)
filter modprobe error messages and log them. Very useful if modules.dep
is missing.

dracut-functions

index ac7fd763c10ef3c3d318659291b024d7db643285..4d5a78a901d0b1783e9f0e847d8f0d68617103a5 100755 (executable)
@@ -728,7 +728,7 @@ install_kmod_with_fw() {
 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 $?
@@ -737,6 +737,8 @@ for_each_kmod_dep() {
         [[ $_found -eq 0 ]] && exit 1
         exit 0
     )
+    egrep -v 'FATAL: Module .* not found.' "$initdir/modprobe.err" | derror
+    rm -f "$initdir/modprobe.err"
     return $?
 }