You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The directory where to look for kernel modules can be set via the -k/--kmoddir
command line option or the drivers_dir configuration option. Its current check
should be split into two different ones to avoid misleading error messages (see
referenced issue):
- First check that its basename matches the kernel version set for the initramfs
(via --kver or automatically set by "uname -r").
- Second check that the parent directory of the last provided directory contains
"/lib/modules/". This check was also fixed to avoid accepting other directories
like "xxxlib/modules".
Fixes issue #1608
printf"%s\n""dracut: Please move your modules into the correct directory structure and pass the new location,"
1216
-
printf"%s\n""dracut: or set DRACUT_KMODDIR_OVERRIDE=1 to ignore this check."
1217
-
exit 1
1218
-
}
1219
-
;;
1220
-
esac
1208
+
if [[ -z$DRACUT_KMODDIR_OVERRIDE&&-n$drivers_dir ]];then
1209
+
drivers_basename="${drivers_dir##*/}"
1210
+
if [[ -n$drivers_basename&&$drivers_basename!="$kernel" ]];then
1211
+
printf"%s\n""dracut: The provided directory where to look for kernel modules ($drivers_basename)">&2
1212
+
printf"%s\n""dracut: does not match the kernel version set for the initramfs ($kernel).">&2
1213
+
printf"%s\n""dracut: Set DRACUT_KMODDIR_OVERRIDE=1 to ignore this check.">&2
1214
+
exit 1
1215
+
fi
1216
+
drivers_dirname="${drivers_dir%/*}/"
1217
+
if [[ !$drivers_dirname=~ .*/lib/modules/$ ]];then
1218
+
printf"%s\n""dracut: drivers_dir path ${drivers_dir_l:+"set via -k/--kmoddir "}must contain \"/lib/modules/\" as a parent of your kernel module directory,">&2
1219
+
printf"%s\n""dracut: or modules may not be placed in the correct location inside the initramfs.">&2
1220
+
printf"%s\n""dracut: was given: ${drivers_dir}">&2
0 commit comments