From: Mewt R <25155631+MewtR@users.noreply.github.com> Date: Mon, 20 Apr 2026 00:37:27 +0000 (-0400) Subject: refactor(dracut): remove unnecessary 'realpath' call if -k/--kmoddir specified X-Git-Tag: 111~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=901c335c5ac559d4e529faabbafa7f96d4e5f80e;p=thirdparty%2Fdracut-ng.git refactor(dracut): remove unnecessary 'realpath' call if -k/--kmoddir specified No need to use 'realpath' to resolve a default directory to look for modules if one has already been specified. 'realpath' will complain if the directory doesn't exist which can lead a user to think that something went wrong. --- diff --git a/dracut.sh b/dracut.sh index 18edc5214..43703dfdb 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1468,11 +1468,11 @@ fi export LC_MESSAGES=C kernel -srcmods="$(realpath -e "${dracutsysrootdir-}/lib/modules/$kernel")" - -[[ ${drivers_dir-} ]] && { +if [[ ${drivers_dir-} ]]; then srcmods="$drivers_dir" -} +else + srcmods="$(realpath -e "${dracutsysrootdir-}/lib/modules/$kernel")" +fi export srcmods # export standard hookdirs