diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 07:54:52 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-23 07:54:52 +0100 |
commit | e32b64c4ec9272295df6852fb2a2888d7799d2f0 (patch) | |
tree | fa64292eb0697f7963060ad6d41f1d76b4978dff /modutils/modprobe-small.c | |
parent | 5467d268f09ddddd200ab14fd402831708be5dfd (diff) | |
download | busybox-w32-e32b64c4ec9272295df6852fb2a2888d7799d2f0.tar.gz busybox-w32-e32b64c4ec9272295df6852fb2a2888d7799d2f0.tar.bz2 busybox-w32-e32b64c4ec9272295df6852fb2a2888d7799d2f0.zip |
Convert all modutils/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modprobe-small.c')
-rw-r--r-- | modutils/modprobe-small.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index a47e52234..51ba42f7a 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
@@ -7,6 +7,51 @@ | |||
7 | * | 7 | * |
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 | //config:config MODPROBE_SMALL | ||
11 | //config: bool "Simplified modutils" | ||
12 | //config: default y | ||
13 | //config: select PLATFORM_LINUX | ||
14 | //config: help | ||
15 | //config: Simplified modutils. | ||
16 | //config: | ||
17 | //config: With this option modprobe does not require modules.dep file | ||
18 | //config: and does not use /etc/modules.conf file. | ||
19 | //config: It scans module files in /lib/modules/`uname -r` and | ||
20 | //config: determines dependencies and module alias names on the fly. | ||
21 | //config: This may make module loading slower, most notably | ||
22 | //config: when one needs to load module by alias (this requires | ||
23 | //config: scanning through module _bodies_). | ||
24 | //config: | ||
25 | //config: At the first attempt to load a module by alias modprobe | ||
26 | //config: will try to generate modules.dep.bb file in order to speed up | ||
27 | //config: future loads by alias. Failure to do so (read-only /lib/modules, | ||
28 | //config: etc) is not reported, and future modprobes will be slow too. | ||
29 | //config: | ||
30 | //config: NB: modules.dep.bb file format is not compatible | ||
31 | //config: with modules.dep file as created/used by standard module tools. | ||
32 | //config: | ||
33 | //config: Additional module parameters can be stored in | ||
34 | //config: /etc/modules/$module_name files. | ||
35 | //config: | ||
36 | //config: Apart from modprobe, other utilities are also provided: | ||
37 | //config: - insmod is an alias to modprobe | ||
38 | //config: - rmmod is an alias to modprobe -r | ||
39 | //config: - depmod generates modules.dep.bb | ||
40 | //config: | ||
41 | //config:config FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE | ||
42 | //config: bool "Accept module options on modprobe command line" | ||
43 | //config: default y | ||
44 | //config: depends on MODPROBE_SMALL | ||
45 | //config: select PLATFORM_LINUX | ||
46 | //config: help | ||
47 | //config: Allow insmod and modprobe take module options from command line. | ||
48 | //config: | ||
49 | //config:config FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED | ||
50 | //config: bool "Skip loading of already loaded modules" | ||
51 | //config: default y | ||
52 | //config: depends on MODPROBE_SMALL | ||
53 | //config: help | ||
54 | //config: Check if the module is already loaded. | ||
10 | 55 | ||
11 | //applet:IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)) | 56 | //applet:IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)) |
12 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod)) | 57 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod)) |
@@ -14,6 +59,8 @@ | |||
14 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, lsmod)) | 59 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, lsmod)) |
15 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod)) | 60 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod)) |
16 | 61 | ||
62 | //kbuild:lib-$(CONFIG_MODPROBE_SMALL) += modprobe-small.o | ||
63 | |||
17 | #include "libbb.h" | 64 | #include "libbb.h" |
18 | /* After libbb.h, since it needs sys/types.h on some systems */ | 65 | /* After libbb.h, since it needs sys/types.h on some systems */ |
19 | #include <sys/utsname.h> /* uname() */ | 66 | #include <sys/utsname.h> /* uname() */ |