aboutsummaryrefslogtreecommitdiff
path: root/modutils/modprobe-small.c
diff options
context:
space:
mode:
Diffstat (limited to 'modutils/modprobe-small.c')
-rw-r--r--modutils/modprobe-small.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 053a7df89..a94b0b9a6 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -11,12 +11,15 @@
11/* modprobe-small configs are defined in Config.src to ensure better 11/* modprobe-small configs are defined in Config.src to ensure better
12 * "make config" order */ 12 * "make config" order */
13 13
14//applet:IF_LSMOD( IF_MODPROBE_SMALL(APPLET(lsmod, BB_DIR_SBIN, BB_SUID_DROP))) 14//applet:IF_LSMOD( IF_MODPROBE_SMALL(APPLET_NOEXEC( lsmod, lsmod, BB_DIR_SBIN, BB_SUID_DROP, lsmod )))
15//applet:IF_MODPROBE(IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP))) 15//applet:IF_MODPROBE(IF_MODPROBE_SMALL(APPLET_NOEXEC( modprobe, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe)))
16// APPLET_ODDNAME:name main location suid_type help 16// APPLET_ODDNAME:name main location suid_type help
17//applet:IF_DEPMOD(IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod))) 17//applet:IF_DEPMOD( IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod )))
18//applet:IF_INSMOD(IF_MODPROBE_SMALL(APPLET_ODDNAME(insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, insmod))) 18//applet:IF_INSMOD( IF_MODPROBE_SMALL(APPLET_NOEXEC( insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, insmod )))
19//applet:IF_RMMOD( IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod))) 19//applet:IF_RMMOD( IF_MODPROBE_SMALL(APPLET_NOEXEC( rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod )))
20/* noexec speeds up boot with many modules loaded (need SH_STANDALONE=y) */
21/* I measured about ~5 times faster insmod */
22/* depmod is not noexec, it runs longer and benefits from memory trimming via exec */
20 23
21//kbuild:lib-$(CONFIG_MODPROBE_SMALL) += modprobe-small.o 24//kbuild:lib-$(CONFIG_MODPROBE_SMALL) += modprobe-small.o
22 25
@@ -985,10 +988,9 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
985 988
986#if ENABLE_MODPROBE || ENABLE_INSMOD || ENABLE_RMMOD 989#if ENABLE_MODPROBE || ENABLE_INSMOD || ENABLE_RMMOD
987 /* modprobe, insmod, rmmod require at least one argument */ 990 /* modprobe, insmod, rmmod require at least one argument */
988 opt_complementary = "-1";
989 /* only -q (quiet) and -r (rmmod), 991 /* only -q (quiet) and -r (rmmod),
990 * the rest are accepted and ignored (compat) */ 992 * the rest are accepted and ignored (compat) */
991 getopt32(argv, "qrfsvwb"); 993 getopt32(argv, "^" "qrfsvwb" "\0" "-1");
992 argv += optind; 994 argv += optind;
993 995
994 if (is_modprobe) { 996 if (is_modprobe) {