]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
90kernel-modules-extra: don't resolve symlinks before instmod
authorLukas Nykryn <lnykryn@redhat.com>
Fri, 2 Aug 2019 12:26:23 +0000 (14:26 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 2 Aug 2019 12:39:09 +0000 (14:39 +0200)
When you install a third-party driver, you will probably end in a
situation, where the module will be in a different directory and
in $depmod_module_dir you will only have symlink. If we resolve the
symlink before we pass the module path to instmod, the dracut-install
will only include the module with its original path, but not the
symlink. Hence the module can't be automatically loaded.

Dracut-install is clever enough to handle symlinks and will include both
the symlink and the module to the initrd.

modules.d/90kernel-modules-extra/module-setup.sh

index c0a2b7f957957efd19d422cb85503d10211a27a1..1706c82206e4ba7a9fde13505a876fc42fb2159f 100755 (executable)
@@ -187,7 +187,7 @@ installkernel()
        printf "^%s\.ko(\.gz|\.bz2|\.xz)?:\n" "${pathlist[@]}" \
                | (LANG=C grep -E -o -f - -- "$depmod_modules_dep" || exit 0) \
                | tr -d ':' \
-               | (cd "$depmod_module_dir" || exit; xargs -r realpath -e --) \
+               | (cd "$depmod_module_dir" || exit; xargs -r realpath -se --) \
                | instmods || return 1
 
        return 0