aboutsummaryrefslogtreecommitdiff
path: root/modutils/modprobe-small.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 07:54:52 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 07:54:52 +0100
commite32b64c4ec9272295df6852fb2a2888d7799d2f0 (patch)
treefa64292eb0697f7963060ad6d41f1d76b4978dff /modutils/modprobe-small.c
parent5467d268f09ddddd200ab14fd402831708be5dfd (diff)
downloadbusybox-e32b64c4ec9272295df6852fb2a2888d7799d2f0.tar.gz
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.c47
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 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//config:config MODPROBE_SMALL
+//config: bool "Simplified modutils"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: Simplified modutils.
+//config:
+//config: With this option modprobe does not require modules.dep file
+//config: and does not use /etc/modules.conf file.
+//config: It scans module files in /lib/modules/`uname -r` and
+//config: determines dependencies and module alias names on the fly.
+//config: This may make module loading slower, most notably
+//config: when one needs to load module by alias (this requires
+//config: scanning through module _bodies_).
+//config:
+//config: At the first attempt to load a module by alias modprobe
+//config: will try to generate modules.dep.bb file in order to speed up
+//config: future loads by alias. Failure to do so (read-only /lib/modules,
+//config: etc) is not reported, and future modprobes will be slow too.
+//config:
+//config: NB: modules.dep.bb file format is not compatible
+//config: with modules.dep file as created/used by standard module tools.
+//config:
+//config: Additional module parameters can be stored in
+//config: /etc/modules/$module_name files.
+//config:
+//config: Apart from modprobe, other utilities are also provided:
+//config: - insmod is an alias to modprobe
+//config: - rmmod is an alias to modprobe -r
+//config: - depmod generates modules.dep.bb
+//config:
+//config:config FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
+//config: bool "Accept module options on modprobe command line"
+//config: default y
+//config: depends on MODPROBE_SMALL
+//config: select PLATFORM_LINUX
+//config: help
+//config: Allow insmod and modprobe take module options from command line.
+//config:
+//config:config FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED
+//config: bool "Skip loading of already loaded modules"
+//config: default y
+//config: depends on MODPROBE_SMALL
+//config: help
+//config: Check if the module is already loaded.
//applet:IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))
//applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod))
@@ -14,6 +59,8 @@
//applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, lsmod))
//applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod))
+//kbuild:lib-$(CONFIG_MODPROBE_SMALL) += modprobe-small.o
+
#include "libbb.h"
/* After libbb.h, since it needs sys/types.h on some systems */
#include <sys/utsname.h> /* uname() */