aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKang-Che Sung <explorer09@gmail.com>2017-02-05 19:02:34 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-02-05 19:02:34 +0100
commit4ae658f077c9b8859e8f1aabee4b95c2c96dae1c (patch)
treeac0c91e705c2544f1041381895fac231b27ff442
parent8cc1ab3c11538773389060005ba9c053fae0f848 (diff)
downloadbusybox-w32-4ae658f077c9b8859e8f1aabee4b95c2c96dae1c.tar.gz
busybox-w32-4ae658f077c9b8859e8f1aabee4b95c2c96dae1c.tar.bz2
busybox-w32-4ae658f077c9b8859e8f1aabee4b95c2c96dae1c.zip
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 <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--modutils/Config.src10
-rw-r--r--modutils/modprobe-small.c6
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
159config DEFAULT_MODULES_DIR 159config DEFAULT_MODULES_DIR
160 string "Default directory containing modules" 160 string "Default directory containing modules"
161 default "/lib/modules" 161 default "/lib/modules"
162 depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO 162 depends on DEPMOD || MODPROBE || MODINFO
163 help 163 help
164 Directory that contains kernel modules. 164 Directory that contains kernel modules.
165 Defaults to "/lib/modules" 165 Defaults to "/lib/modules"
@@ -167,9 +167,13 @@ config DEFAULT_MODULES_DIR
167config DEFAULT_DEPMOD_FILE 167config DEFAULT_DEPMOD_FILE
168 string "Default name of modules.dep" 168 string "Default name of modules.dep"
169 default "modules.dep" 169 default "modules.dep"
170 depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO 170 depends on DEPMOD || MODPROBE || MODINFO
171 help 171 help
172 Filename that contains kernel modules dependencies. 172 Filename that contains kernel modules dependencies.
173 Defaults to "modules.dep" 173 Defaults to "modules.dep".
174 If you configured the "simplified modutils" (MODPROBE_SMALL), a
175 ".bb" suffix will be added after this name. Do not specify ".bb"
176 here unless you intend your depmod or modprobe to work on
177 "modules.dep.bb.bb" or such.
174 178
175endmenu 179endmenu
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)
934 /* Prevent ugly corner cases with no modules at all */ 934 /* Prevent ugly corner cases with no modules at all */
935 modinfo = xzalloc(sizeof(modinfo[0])); 935 modinfo = xzalloc(sizeof(modinfo[0]));
936 936
937 if (!is_insmod) { 937 if (is_depmod || is_modprobe) {
938 /* Goto modules directory */ 938 /* Goto modules directory */
939 xchdir(CONFIG_DEFAULT_MODULES_DIR); 939 xchdir(CONFIG_DEFAULT_MODULES_DIR);
940 uname(&uts); /* never fails */
940 } 941 }
941 uname(&uts); /* never fails */
942 942
943 /* depmod? */ 943 /* depmod? */
944 if (is_depmod) { 944 if (is_depmod) {
@@ -980,7 +980,7 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
980 getopt32(argv, "qrfsvwb"); 980 getopt32(argv, "qrfsvwb");
981 argv += optind; 981 argv += optind;
982 982
983 if (!is_insmod) { 983 if (is_modprobe) {
984 /* Goto $VERSION directory */ 984 /* Goto $VERSION directory */
985 xchdir(uts.release); 985 xchdir(uts.release);
986 } 986 }