diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-11-03 17:32:12 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-21 21:15:35 +0100 |
commit | e4202df0918e13130bb511a4ce372cbbe089068d (patch) | |
tree | fc0c5560305747f07c8c8afd47efd30392c4ce2d /modutils/modprobe.c | |
parent | 07abc7c6f7dd0875e0aa548bba952174a54c8797 (diff) | |
download | busybox-w32-e4202df0918e13130bb511a4ce372cbbe089068d.tar.gz busybox-w32-e4202df0918e13130bb511a4ce372cbbe089068d.tar.bz2 busybox-w32-e4202df0918e13130bb511a4ce372cbbe089068d.zip |
modprobe: Add support for modprobe.blacklist=module1,module2,...
function old new delta
parse_and_add_kcmdline_module_options - 186 +186
modprobe_main 713 798 +85
do_modprobe 648 451 -197
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 271/-197) Total: 74 bytes
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r-- | modutils/modprobe.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index eeeff7609..c334186b8 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -663,6 +663,25 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) | |||
663 | load_modules_dep(); | 663 | load_modules_dep(); |
664 | } | 664 | } |
665 | 665 | ||
666 | /* Handle modprobe.blacklist=module1,module2,... */ | ||
667 | if (ENABLE_FEATURE_MODPROBE_BLACKLIST) { | ||
668 | char *options; | ||
669 | char *substr; | ||
670 | |||
671 | options = parse_and_add_kcmdline_module_options(NULL, "modprobe"); | ||
672 | while ((substr = strsep(&options, " ")) != NULL) { | ||
673 | char *fn = is_prefixed_with(substr, "blacklist="); | ||
674 | if (!fn) | ||
675 | continue; | ||
676 | while ((substr = strsep(&fn, ",")) != NULL) { | ||
677 | /* blacklist <modulename> */ | ||
678 | get_or_add_modentry(substr)->flags |= MODULE_FLAG_BLACKLISTED; | ||
679 | DBG("blacklist: %s", substr); | ||
680 | } | ||
681 | } | ||
682 | /*free(options); - WRONG, strsep may have advanced it */ | ||
683 | } | ||
684 | |||
666 | rc = 0; | 685 | rc = 0; |
667 | while ((me = llist_pop(&G.probes)) != NULL) { | 686 | while ((me = llist_pop(&G.probes)) != NULL) { |
668 | if (me->realnames == NULL) { | 687 | if (me->realnames == NULL) { |