Re: [PATCH kmod v4 4/4] libkmod, depmod, modprobe: Make directory for kernel modules configurable

From: Jan Engelhardt
Date: Mon Jul 17 2023 - 15:28:36 EST



On Monday 2023-07-17 12:39, Michal Suchanek wrote:

>modprobe.d is now searched under ${prefix}/lib, add ${module_directory} to
>specify the directory where to search for kernel modules.
>
>With this distributions that do not want to ship files in /lib can also
>move kernel modules to /usr while others can keep them in /lib.

This patch breaks kernel builds/installation.

* assume $distro has given me a kmod that has your submission included,
and such kmod was ./configure'd --with-module-directory=/usr/lib/modules

With such a kmod, the module installation of current and past kernels
is not possible, in other words, ** bisecting kernels ** is broken:


$ make modules_install INSTALL_MOD_PATH=$PWD/rt V=1
[...]
# INSTALL /tmp/linux/rt/lib/modules/6.4.3/kernel/virt/lib/irqbypass.ko
mkdir -p /tmp/linux/rt/lib/modules/6.4.3/kernel/virt/lib/; cp virt/lib/irqbypass.ko /tmp/linux/rt/lib/modules/6.4.3/kernel/virt/lib/irqbypass.ko
[...]
# DEPMOD /tmp/linux/rt/lib/modules/6.4.3
sh ./scripts/depmod.sh depmod 6.4.3
depmod: ERROR: could not open directory /tmp/linux/rt/usr/lib/modules/99.98.6.4.3: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
make: *** [Makefile:1956: modules_install] Error 1