Linux's modprobe Adds The Ability To Load A Module From Anywhere On The File-System

Written by Michael Larabel in Linux Kernel on 29 September 2023 at 02:19 PM EDT. 35 Comments
LINUX KERNEL
With today's release of kmod 31, Linux's modprobe utility for loading kernel modules can finally allow arbitrary paths to allow loading new kernel modules from anywhere on the file-system.

Surprisingly it took until 2023 for allowing Linux's modprobe to accept loading kernel modules from any arbitrary path. Rather than just specifying the module name and then looking up the module within the running kernel's modules directory, modprobe can now allow passing a path to the module. Relative paths are also supported when prefixed with "./" for the path to the desired module.

Adding the ability to specify custom paths to modules was motivated by kernel developers for easier testing of just-compiled modules without first having to use insmod or similar for inserting the module to the running kernel's modules directory. The commit adding the patch by Intel's Gustavo Sousa explains, "they can load the module from the path while getting all the benefits of modprobe (e.g. module dependency resolution)."

modprobe anywhere


In the kmod 31 announcement today adds that this feature is great to avoid having to load the dependencies manually or overriding the modules within /usr/lib/modules/. For Intel's part it's motivated by work on their i915 kernel driver.

Kmod 31 also now uses in-kernel decompression where available, build system improvements, and other fixes and enhancements.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week