aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKang-Che Sung <explorer09@gmail.com>2017-02-01 19:43:54 +0800
committerDenys Vlasenko <vda.linux@googlemail.com>2017-02-05 19:11:01 +0100
commit415cc42b6aab3a3a90749354432e7d780840b1d8 (patch)
tree195da414b0b63d15e2c73e04c5b45beced08a794
parent4ae658f077c9b8859e8f1aabee4b95c2c96dae1c (diff)
downloadbusybox-w32-415cc42b6aab3a3a90749354432e7d780840b1d8.tar.gz
busybox-w32-415cc42b6aab3a3a90749354432e7d780840b1d8.tar.bz2
busybox-w32-415cc42b6aab3a3a90749354432e7d780840b1d8.zip
Reorder modutils config options & fix yet more dependency
- modprobe can indirectly benefit from FEATURE_2_4_MODULES and FEATURE_INSMOD_TRY_MAP options. - The position of config FEATURE_INSMOD_TRY_MMAP prevented some other config options from indenting under FEATURE_2_4_MODULES. Reorder to fix this. - FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is now moved to Config.src under "Common options" section. (I wished to edit this config so that it also work with "big" modutils, but it's not done at the moment. Sorry.) Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--modutils/Config.src43
-rw-r--r--modutils/modprobe-small.c10
2 files changed, 27 insertions, 26 deletions
diff --git a/modutils/Config.src b/modutils/Config.src
index d0bae2ea3..5f0b0cec4 100644
--- a/modutils/Config.src
+++ b/modutils/Config.src
@@ -45,31 +45,22 @@ config FEATURE_CMDLINE_MODULE_OPTIONS
45 Allow insmod and modprobe take module options from the applets' 45 Allow insmod and modprobe take module options from the applets'
46 command line. 46 command line.
47 47
48config FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED
49 bool "Skip loading of already loaded modules"
50 default y
51 depends on MODPROBE_SMALL && (DEPMOD || INSMOD || MODPROBE)
52 help
53 Check if the module is already loaded.
54
48config FEATURE_2_4_MODULES 55config FEATURE_2_4_MODULES
49 bool "Support version 2.2/2.4 Linux kernels" 56 bool "Support version 2.2/2.4 Linux kernels"
50 default n 57 default n
51 depends on (INSMOD || RMMOD || LSMOD) && !MODPROBE_SMALL 58 depends on (INSMOD || LSMOD || MODPROBE || RMMOD) && !MODPROBE_SMALL
52 help 59 help
53 Support module loading for 2.2.x and 2.4.x Linux kernels. 60 Support module loading for 2.2.x and 2.4.x Linux kernels.
54 This increases size considerably. Say N unless you plan 61 This increases size considerably. Say N unless you plan
55 to run ancient kernels. 62 to run ancient kernels.
56 63
57config FEATURE_INSMOD_TRY_MMAP
58 bool "Try to load module from a mmap'ed area"
59 default n
60 depends on INSMOD && !MODPROBE_SMALL
61 help
62 This option causes module loading code to try to mmap
63 module first. If it does not work (for example,
64 it does not work for compressed modules), module will be read
65 (and unpacked if needed) into a memory block allocated by malloc.
66
67 The only case when mmap works but malloc does not is when
68 you are trying to load a big module on a very memory-constrained
69 machine. Malloc will momentarily need 2x as much memory as mmap.
70
71 Choosing N saves about 250 bytes of code (on 32-bit x86).
72
73config FEATURE_INSMOD_VERSION_CHECKING 64config FEATURE_INSMOD_VERSION_CHECKING
74 bool "Enable module version checking" 65 bool "Enable module version checking"
75 default n 66 default n
@@ -113,7 +104,7 @@ config FEATURE_INSMOD_LOAD_MAP
113config FEATURE_INSMOD_LOAD_MAP_FULL 104config FEATURE_INSMOD_LOAD_MAP_FULL
114 bool "Symbols in load map" 105 bool "Symbols in load map"
115 default y 106 default y
116 depends on FEATURE_INSMOD_LOAD_MAP && !MODPROBE_SMALL 107 depends on FEATURE_INSMOD_LOAD_MAP
117 help 108 help
118 Without this option, -m will only output section 109 Without this option, -m will only output section
119 load map. With this option, -m will also output 110 load map. With this option, -m will also output
@@ -129,6 +120,22 @@ config FEATURE_CHECK_TAINTED_MODULE
129 support request. 120 support request.
130 This option is required to support GPLONLY modules. 121 This option is required to support GPLONLY modules.
131 122
123config FEATURE_INSMOD_TRY_MMAP
124 bool "Try to load module from a mmap'ed area"
125 default n
126 depends on (INSMOD || MODPROBE) && !MODPROBE_SMALL
127 help
128 This option causes module loading code to try to mmap
129 module first. If it does not work (for example,
130 it does not work for compressed modules), module will be read
131 (and unpacked if needed) into a memory block allocated by malloc.
132
133 The only case when mmap works but malloc does not is when
134 you are trying to load a big module on a very memory-constrained
135 machine. Malloc will momentarily need 2x as much memory as mmap.
136
137 Choosing N saves about 250 bytes of code (on 32-bit x86).
138
132config FEATURE_MODUTILS_ALIAS 139config FEATURE_MODUTILS_ALIAS
133 bool "Support module.aliases file" 140 bool "Support module.aliases file"
134 default y 141 default y
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 726a3108c..d6f481415 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -8,14 +8,8 @@
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10 10
11/* config MODPROBE_SMALL is defined in Config.src to ensure better "make config" order */ 11/* modprobe-small configs are defined in Config.src to ensure better
12 12 * "make config" order */
13//config:config FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED
14//config: bool "Skip loading of already loaded modules"
15//config: default y
16//config: depends on MODPROBE_SMALL && (DEPMOD || INSMOD || MODPROBE)
17//config: help
18//config: Check if the module is already loaded.
19 13
20//applet:IF_LSMOD( IF_MODPROBE_SMALL(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP))) 14//applet:IF_LSMOD( IF_MODPROBE_SMALL(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP)))
21//applet:IF_MODPROBE(IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))) 15//applet:IF_MODPROBE(IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)))