From: Denys Vlasenko Date: Wed, 23 Nov 2016 06:54:52 +0000 (+0100) Subject: Convert all modutils/* applets to "new style" applet definitions X-Git-Tag: 1_26_0~55 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e32b64c4ec9272295df6852fb2a2888d7799d2f0;p=oweals%2Fbusybox.git Convert all modutils/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- diff --git a/modutils/Config.src b/modutils/Config.src index 0b11832bc..4227f356a 100644 --- a/modutils/Config.src +++ b/modutils/Config.src @@ -7,117 +7,6 @@ menu "Linux Module Utilities" INSERT -config MODPROBE_SMALL - bool "Simplified modutils" - default y - select PLATFORM_LINUX - help - Simplified modutils. - - With this option modprobe does not require modules.dep file - and does not use /etc/modules.conf file. - It scans module files in /lib/modules/`uname -r` and - determines dependencies and module alias names on the fly. - This may make module loading slower, most notably - when one needs to load module by alias (this requires - scanning through module _bodies_). - - At the first attempt to load a module by alias modprobe - will try to generate modules.dep.bb file in order to speed up - future loads by alias. Failure to do so (read-only /lib/modules, - etc) is not reported, and future modprobes will be slow too. - - NB: modules.dep.bb file format is not compatible - with modules.dep file as created/used by standard module tools. - - Additional module parameters can be stored in - /etc/modules/$module_name files. - - Apart from modprobe, other utilities are also provided: - - insmod is an alias to modprobe - - rmmod is an alias to modprobe -r - - depmod generates modules.dep.bb - -config FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - bool "Accept module options on modprobe command line" - default y - depends on MODPROBE_SMALL - select PLATFORM_LINUX - help - Allow insmod and modprobe take module options from command line. - -config FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - bool "Skip loading of already loaded modules" - default y - depends on MODPROBE_SMALL - help - Check if the module is already loaded. - -config INSMOD - bool "insmod" - default n - depends on !MODPROBE_SMALL - select PLATFORM_LINUX - help - insmod is used to load specified modules in the running kernel. - -config RMMOD - bool "rmmod" - default n - depends on !MODPROBE_SMALL - select PLATFORM_LINUX - help - rmmod is used to unload specified modules from the kernel. - -config LSMOD - bool "lsmod" - default n - depends on !MODPROBE_SMALL - select PLATFORM_LINUX - help - lsmod is used to display a list of loaded modules. - -config FEATURE_LSMOD_PRETTY_2_6_OUTPUT - bool "Pretty output" - default n - depends on LSMOD - select PLATFORM_LINUX - help - This option makes output format of lsmod adjusted to - the format of module-init-tools for Linux kernel 2.6. - Increases size somewhat. - -config MODPROBE - bool "modprobe" - default n - depends on !MODPROBE_SMALL - select PLATFORM_LINUX - help - Handle the loading of modules, and their dependencies on a high - level. - -config FEATURE_MODPROBE_BLACKLIST - bool "Blacklist support" - default n - depends on MODPROBE - select PLATFORM_LINUX - help - Say 'y' here to enable support for the 'blacklist' command in - modprobe.conf. This prevents the alias resolver to resolve - blacklisted modules. This is useful if you want to prevent your - hardware autodetection scripts to load modules like evdev, frame - buffer drivers etc. - -config DEPMOD - bool "depmod" - default n - depends on !MODPROBE_SMALL - select PLATFORM_LINUX - help - depmod generates modules.dep (and potentially modules.alias - and modules.symbols) that contain dependency information - for modprobe. - comment "Options common to multiple modutils" config FEATURE_2_4_MODULES diff --git a/modutils/Kbuild.src b/modutils/Kbuild.src index 1a7ac8751..6b4fb7470 100644 --- a/modutils/Kbuild.src +++ b/modutils/Kbuild.src @@ -7,10 +7,3 @@ lib-y:= INSERT -lib-$(CONFIG_MODPROBE_SMALL) += modprobe-small.o -lib-$(CONFIG_DEPMOD) += depmod.o modutils.o -lib-$(CONFIG_INSMOD) += insmod.o modutils.o -lib-$(CONFIG_LSMOD) += lsmod.o modutils.o -lib-$(CONFIG_MODPROBE) += modprobe.o modutils.o -lib-$(CONFIG_RMMOD) += rmmod.o modutils.o -lib-$(CONFIG_FEATURE_2_4_MODULES) += modutils-24.o diff --git a/modutils/depmod.c b/modutils/depmod.c index e5f0e3d2b..b9347027e 100644 --- a/modutils/depmod.c +++ b/modutils/depmod.c @@ -7,9 +7,20 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config DEPMOD +//config: bool "depmod" +//config: default n +//config: depends on !MODPROBE_SMALL +//config: select PLATFORM_LINUX +//config: help +//config: depmod generates modules.dep (and potentially modules.alias +//config: and modules.symbols) that contain dependency information +//config: for modprobe. //applet:IF_DEPMOD(APPLET(depmod, BB_DIR_SBIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_DEPMOD) += depmod.o modutils.o + #include "libbb.h" #include "modutils.h" #include /* uname() */ diff --git a/modutils/insmod.c b/modutils/insmod.c index 9c3c992a5..2ebf4beb9 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c @@ -6,9 +6,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config INSMOD +//config: bool "insmod" +//config: default n +//config: depends on !MODPROBE_SMALL +//config: select PLATFORM_LINUX +//config: help +//config: insmod is used to load specified modules in the running kernel. //applet:IF_INSMOD(APPLET(insmod, BB_DIR_SBIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_INSMOD) += insmod.o modutils.o + #include "libbb.h" #include "modutils.h" diff --git a/modutils/lsmod.c b/modutils/lsmod.c index 3b3c166b9..ee85fb0fb 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -7,9 +7,28 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LSMOD +//config: bool "lsmod" +//config: default n +//config: depends on !MODPROBE_SMALL +//config: select PLATFORM_LINUX +//config: help +//config: lsmod is used to display a list of loaded modules. +//config: +//config:config FEATURE_LSMOD_PRETTY_2_6_OUTPUT +//config: bool "Pretty output" +//config: default n +//config: depends on LSMOD +//config: select PLATFORM_LINUX +//config: help +//config: This option makes output format of lsmod adjusted to +//config: the format of module-init-tools for Linux kernel 2.6. +//config: Increases size somewhat. //applet:IF_LSMOD(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_LSMOD) += lsmod.o modutils.o + //usage:#if !ENABLE_MODPROBE_SMALL //usage:#define lsmod_trivial_usage //usage: "" 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 /* uname() */ diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 8130c40b7..d404ef92f 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -7,9 +7,31 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MODPROBE +//config: bool "modprobe" +//config: default n +//config: depends on !MODPROBE_SMALL +//config: select PLATFORM_LINUX +//config: help +//config: Handle the loading of modules, and their dependencies on a high +//config: level. +//config: +//config:config FEATURE_MODPROBE_BLACKLIST +//config: bool "Blacklist support" +//config: default n +//config: depends on MODPROBE +//config: select PLATFORM_LINUX +//config: help +//config: Say 'y' here to enable support for the 'blacklist' command in +//config: modprobe.conf. This prevents the alias resolver to resolve +//config: blacklisted modules. This is useful if you want to prevent your +//config: hardware autodetection scripts to load modules like evdev, frame +//config: buffer drivers etc. //applet:IF_MODPROBE(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_MODPROBE) += modprobe.o modutils.o + #include "libbb.h" #include "modutils.h" #include diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c index fe46fc3fd..9ce91351d 100644 --- a/modutils/modutils-24.c +++ b/modutils/modutils-24.c @@ -58,6 +58,8 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//kbuild:lib-$(CONFIG_FEATURE_2_4_MODULES) += modutils-24.o + #include "libbb.h" #include "modutils.h" #include diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 5c353ef95..e0358838a 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c @@ -7,9 +7,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config RMMOD +//config: bool "rmmod" +//config: default n +//config: depends on !MODPROBE_SMALL +//config: select PLATFORM_LINUX +//config: help +//config: rmmod is used to unload specified modules from the kernel. //applet:IF_RMMOD(APPLET(rmmod, BB_DIR_SBIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_RMMOD) += rmmod.o modutils.o + //usage:#if !ENABLE_MODPROBE_SMALL //usage:#define rmmod_trivial_usage //usage: "[-wfa] [MODULE]..."