From 4ae658f077c9b8859e8f1aabee4b95c2c96dae1c Mon Sep 17 00:00:00 2001 From: Kang-Che Sung Date: Sun, 5 Feb 2017 19:02:34 +0100 Subject: [PATCH] modutils: fix config options dependency (2) - The modprobe-small implementation of rmmod no longer chdir's to "/lib/modules/`uname -r`" as it was not necessary for rmmod's operation. (And it no longer need to die if such modules directory doesn't exist.) - Configs DEFAULT_MODULES_DIR and DEFAULT_DEPMOD_FILE no longer depend on MODPROBE_SMALL as the latter may not enable depmod or modprobe that requires these configs. - Clarify DEFAULT_DEPMOD_FILE's description regarding the ".bb" name suffix. Signed-off-by: Kang-Che Sung Signed-off-by: Denys Vlasenko --- modutils/Config.src | 10 +++++++--- modutils/modprobe-small.c | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modutils/Config.src b/modutils/Config.src index a15cce518..d0bae2ea3 100644 --- a/modutils/Config.src +++ b/modutils/Config.src @@ -159,7 +159,7 @@ config FEATURE_MODUTILS_SYMBOLS config DEFAULT_MODULES_DIR string "Default directory containing modules" default "/lib/modules" - depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO + depends on DEPMOD || MODPROBE || MODINFO help Directory that contains kernel modules. Defaults to "/lib/modules" @@ -167,9 +167,13 @@ config DEFAULT_MODULES_DIR config DEFAULT_DEPMOD_FILE string "Default name of modules.dep" default "modules.dep" - depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO + depends on DEPMOD || MODPROBE || MODINFO help Filename that contains kernel modules dependencies. - Defaults to "modules.dep" + Defaults to "modules.dep". + If you configured the "simplified modutils" (MODPROBE_SMALL), a + ".bb" suffix will be added after this name. Do not specify ".bb" + here unless you intend your depmod or modprobe to work on + "modules.dep.bb.bb" or such. endmenu diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 04242634b..726a3108c 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c @@ -934,11 +934,11 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) /* Prevent ugly corner cases with no modules at all */ modinfo = xzalloc(sizeof(modinfo[0])); - if (!is_insmod) { + if (is_depmod || is_modprobe) { /* Goto modules directory */ xchdir(CONFIG_DEFAULT_MODULES_DIR); + uname(&uts); /* never fails */ } - uname(&uts); /* never fails */ /* depmod? */ if (is_depmod) { @@ -980,7 +980,7 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) getopt32(argv, "qrfsvwb"); argv += optind; - if (!is_insmod) { + if (is_modprobe) { /* Goto $VERSION directory */ xchdir(uts.release); }