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.
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