aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.de.marchi@gmail.com>2013-05-09 23:48:50 -0300
committerLucas De Marchi <lucas.de.marchi@gmail.com>2013-05-09 23:57:36 -0300
commitc5720ac2a09c8a115e16c6595a8795bd653e5e56 (patch)
tree0f44718cd66b7a888785a6fd7ba38ff655d9d908
parent1786cdc5a3d3473c06cdfa657326771def69924f (diff)
downloadlinux-kmod.tar.gz
init/Kconfig: Add option to set modprobe commandkmod
The hard-coded path of modprobe doesn't allow distros to put the binary in another place without add links from one place to another. For example, in recent versions of distros like Fedora, Arch and Suse, kmod is the default tool to load modules and they have to create a link from modprobe to kmod binary. kmod relies on argv[0] to know what to do but in future they want to add commands like "kmod load -- modulename", which is not possible if the path to the tool to load modules is hard-coded in kernel. Moreover, it's already possible to set the path through /proc/sys, but it would have to be done very early in the boot sequence and on every boot since modprobe may be called even before / is mounted. In this scenario booting without and initrd would be more difficult as well. Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
-rw-r--r--init/Kconfig7
-rw-r--r--kernel/kmod.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 5341d7232c3ac0..72eee1c89c2104 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1593,6 +1593,13 @@ menuconfig MODULES
if MODULES
+config DEFAULT_MODULE_LOAD_BIN
+ string "Default module load binary"
+ default "/sbin/modprobe -q --"
+ help
+ This option determines the default executable to be called when a
+ module is requested to be loaded via request_module().
+
config MODULE_FORCE_LOAD
bool "Forced module loading"
default n
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 70df90b1545447..18285429d7ab58 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -67,7 +67,7 @@ static DECLARE_RWSEM(umhelper_sem);
/*
modprobe_path is set via /proc/sys.
*/
-char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe -q --";
+char modprobe_path[KMOD_PATH_LEN] = CONFIG_DEFAULT_MODULE_LOAD_BIN;
static void free_modprobe_argv(struct subprocess_info *info)
{