aboutsummaryrefslogtreecommitdiff
path: root/modutils
Commit message (Collapse)AuthorAgeFilesLines
* modprobe: handle module arguments containing spacesGravatar Peter Korsgaard2015-09-091-1/+33
| | | | | | | | | | Modprobe wasn't correctly parsing module arguments containing spaces from /proc/cmdline - E.G. module.property="some text". Extend the parsing to correctly handle quoted text. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use is_prefixed_with()Gravatar Denys Vlasenko2015-03-125-28/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta is_prefixed_with - 18 +18 complete_username 78 77 -1 man_main 737 735 -2 fsck_device 429 427 -2 unpack_ar_archive 80 76 -4 strip_unsafe_prefix 105 101 -4 singlemount 1054 1050 -4 rtc_adjtime_is_utc 90 86 -4 resolve_mount_spec 88 84 -4 parse_one_line 1029 1025 -4 parse_conf 1460 1456 -4 may_wakeup 83 79 -4 loadkmap_main 219 215 -4 get_irqs_from_stat 103 99 -4 get_header_cpio 913 909 -4 findfs_main 79 75 -4 fbsplash_main 1230 1226 -4 load_crontab 776 771 -5 expand_vars_to_list 1151 1146 -5 date_main 881 876 -5 skip_dev_pfx 30 24 -6 make_device 2199 2193 -6 complete_cmd_dir_file 773 767 -6 run_applet_and_exit 715 708 -7 uudecode_main 321 313 -8 pwdx_main 197 189 -8 execute 568 560 -8 i2cdetect_main 1186 1176 -10 procps_scan 1242 1230 -12 procps_read_smaps 1017 1005 -12 process_module 746 734 -12 patch_main 1903 1891 -12 nfsmount 3572 3560 -12 stack_machine 126 112 -14 process_timer_stats 449 435 -14 match_fstype 111 97 -14 do_ipaddr 1344 1330 -14 open_list_and_close 359 343 -16 get_header_tar 1795 1779 -16 prepend_new_eth_table 340 323 -17 fsck_main 1811 1794 -17 find_iface_state 56 38 -18 dnsd_main 1321 1303 -18 base_device 179 158 -21 find_keyword 104 82 -22 handle_incoming_and_exit 2785 2762 -23 parse_and_put_prompt 774 746 -28 modinfo 347 317 -30 find_action 204 171 -33 update_passwd 1470 1436 -34 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: fix fallout from basename removalGravatar Denys Vlasenko2015-02-211-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: fix thinko in previous commitGravatar Denys Vlasenko2015-02-131-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: if concurrent module load did not succeed, waitGravatar Denys Vlasenko2015-02-121-9/+41
| | | | | | | | | | | | | | | | usecase: two sd cards are being mounted in parallel at same time on dual core. example modules which are getting loaded is nls_cp437. While one module is being loaded , it makes state in /proc/modules as 'coming' and then starts doing its module init function (in our case - registering nls). meanwhile on other core, if modprobe returns that is has already been loaded, then it will continue and search for the nls list which is not yet finished from first module init. This fails resulting in not mounting sd card. function old new delta process_module 667 746 +79 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: fix and simplify rmmodGravatar Denys Vlasenko2015-02-071-32/+43
| | | | | | | | | | | | | | | "rmmod OUT_OF_TREE_MODULE" was not working, because module is not in depmod file. In general, rmmod doesn't need scanning, it simply unloads every argv[i]. function old new delta rmmod - 63 +63 modprobe_main 449 465 +16 process_module 705 667 -38 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 79/-38) Total: 41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* depmod: simple memory optimizationGravatar Denys Vlasenko2015-01-242-11/+14
| | | | | | | | function old new delta filename2modname 67 86 +19 parse_module 374 351 -23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: fix modprobe -r and parsing of /etc/modprobe.dGravatar Natanael Copa2015-01-191-1/+1
| | | | | | | | | | | | This fixes a regression introduced with commit 78854520 (modprobe: revert checking for /, stop doing basename() on modprobe args, 2015-01-01) that broke modprobe options stored in /etc/modprobe.conf and /etc/modprobe.d/*.conf. This also fixes modprobe -r Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: fix "modprobe devname:snd/timer" case (alias with a slash)Gravatar Denys Vlasenko2015-01-151-4/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: fix recent breakage: modules.dep reading code needs to strip dirnameGravatar Denys Vlasenko2015-01-151-4/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: code shrinkGravatar Denys Vlasenko2015-01-111-12/+9
| | | | | | | function old new delta pathname_matches_modname 80 42 -38 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: fix recent breakage: modprobe -r was using full pathGravatar Denys Vlasenko2015-01-111-9/+10
| | | | | | | "modprobe -r MODNAME", after it found the full module pathname, should strip dirpath before trying to remove the module. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* depmod: fix recent breakage in modules.dep generationGravatar Denys Vlasenko2015-01-071-7/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: revert checking for /, stop doing basename() on modprobe argsGravatar Denys Vlasenko2015-01-013-15/+12
| | | | | | | | | | function old new delta process_module 726 719 -7 filename2modname 81 67 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe,rmmod: reject module names with slashesGravatar Denys Vlasenko2014-11-201-0/+11
| | | | | | | function old new delta add_probe 86 113 +27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: fix module parsing with kernel >= 2.6.37Gravatar David Marchand2014-07-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | display() function returns the length of the value we are displaying + 1. As a consequence, if we have field=value\0field=value\0field=value in the binary, then the second occurence will be skipped as ptr will miss the first character of the following field. Example trying to list aliases from ixgbe.ko on a 3.2 kernel. - In the module we have: alias=pci:v00008086d00001560sv*sd*bc*sc*i*\0 alias=pci:v00008086d0000154Asv*sd*bc*sc*i*\0 alias=pci:v00008086d00001557sv*sd*bc*sc*i*\0 alias=pci:v00008086d0000154Fsv*sd*bc*sc*i*\0 alias=pci:v00008086d0000154Dsv*sd*bc*sc*i*\0 ... - Using modinfo -F alias ixgbe returns: alias: pci:v00008086d00001560sv*sd*bc*sc*i* alias: pci:v00008086d00001557sv*sd*bc*sc*i* alias: pci:v00008086d0000154Dsv*sd*bc*sc*i* ... This problem appeared with kernel commit "modules: no need to align .modinfo strings" b6472776816af1ed52848c93d26e3edb3b17adab in 2.6.37. Fix this by not trusting display() return value but increment ptr by strlen(ptr) (the same way as depmod.c does). Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: fix safe_strncpy truncating last char of module nameGravatar Denys Vlasenko2014-05-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: (un)load all modules which match the alias, not only first oneGravatar Denys Vlasenko2014-04-211-61/+101
| | | | | | | | | | | | | | | | | | | | | | | | | Closes 627 and 7034. Commonly seen case is (un)loading of an alias which matches ata_generic and a more specific ata module. For example: modprobe [-r] pci:v00008086d00007010sv00000000sd00000000bc01sc01i80 (ata_generic and pata_acpi) modprobe [-r] pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a (ata_generic and pata_via) function old new delta process_module 615 728 +113 parse_module 309 395 +86 find_alias 621 653 +32 pathname_matches_modname 78 79 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 232/0) Total: 232 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: remove redundant aliases from modules.dep.bbGravatar Denys Vlasenko2014-04-191-0/+26
| | | | | | | function old new delta parse_module 309 395 +86 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: fix help messages for aliased module-related appletsGravatar Denys Vlasenko2014-04-193-13/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Whitespace fixesGravatar Denys Vlasenko2013-07-301-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanup. no code changesGravatar Denys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesGravatar Denys Vlasenko2013-01-141-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe_small: make rmmod to NOT remove dependencies. Closes 5162Gravatar Denys Vlasenko2012-09-251-2/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: match more standard module fields and fix version fieldGravatar Tanguy Pruvot2012-06-121-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, -F version could match the srcversion= string. before : ~ # modinfo -F version tiwlan_drv version: 6.1.2012.05.29 version: 533BB7E5866E52F63B9ACCB version: 0x%x, oui=0x%x, 0x%x, 0x%x version: 0x%x ~ # modinfo tiwlan_drv filename: tiwlan_drv.ko author: Texas Instruments Inc - Retouched by CyanogenDefy license: GPL vermagic: 2.6.32.9 preempt mod_unload ARMv7 parm: g_sdio_debug_level:debug level depends: now : ~ # modinfo -F version tiwlan_drv version: 6.1.2012.05.29 ~ # modinfo tiwlan_drv filename: tiwlan_drv.ko license: GPL author: Texas Instruments Inc - Retouched by CyanogenDefy version: 6.1.2012.05.29 srcversion: 533BB7E5866E52F63B9ACCB depends: uts_release: 2.6.32.9-g306944c vermagic: 2.6.32.9 preempt mod_unload ARMv7 parm: g_sdio_debug_level:debug level This patch also add support for the old "-n" and some other helpers Change-Id: Icb4e9ca513cbce46b075a6f038799a7a19fb7e22 Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-small: add comment about aliased commands' help textGravatar Denys Vlasenko2012-02-191-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* depmod: supply help textGravatar Lauri Kasanen2012-02-191-9/+18
| | | | | Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: accept -b even if blacklist functionality is disabledGravatar Felipe Contreras2012-01-312-8/+9
| | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: make it select PLATFORM_LINUX. Closes 4411Gravatar Denys Vlasenko2011-10-301-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* stop declariong our own dirname prototypeGravatar Denys Vlasenko2011-09-101-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: use hash table. speeds up significantly if modprobe.dep is largeGravatar Timo Teras2011-06-201-14/+29
| | | | | | | | | | | | | | | | function old new delta helper_get_module 106 157 +51 config_file_action 413 431 +18 modprobe_main 690 706 +16 do_modprobe 580 588 +8 add_probe 81 83 +2 load_modules_dep 192 190 -2 get_or_add_modentry 10 - -10 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 5/1 up/down: 95/-12) Total: 83 bytes Signed-off-by: Timo Teras <timo.teras@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsGravatar Denys Vlasenko2011-06-055-10/+3
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX"Gravatar Denys Vlasenko2011-02-261-1/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: fix "modprobe -l name-with-dash"Gravatar Denys Vlasenko2011-02-151-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: trivial optimizationsGravatar Denys Vlasenko2011-02-151-4/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: show firmware and depends fieldsGravatar Lauri Kasanen2011-02-151-3/+5
| | | | | Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix bug 3223 (parameter loading problem for 2.4 kernels)Gravatar Denys Vlasenko2011-02-131-8/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesGravatar Denys Vlasenko2011-02-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe/insmod: fix parameter quotingGravatar Denys Vlasenko2011-02-024-10/+28
| | | | | | | | | | | function old new delta parse_cmdline_module_options 102 157 +55 modprobe_main 657 662 +5 insmod_main 68 70 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 62/0) Total: 62 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* revert commit 1396221d5a741ef8e1e8abca88836b341a3cab84Gravatar Denys Vlasenko2011-02-011-6/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass removal of underscores from _BB_DIR_foo and _BB_SUID_fooGravatar Denys Vlasenko2011-01-187-11/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* insmod: check for module read errorsGravatar Denys Vlasenko2011-01-171-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lsmod: fox unsafe usage of strlen() - 1Gravatar Denys Vlasenko2011-01-111-1/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* modprobe-small: support compressed modules in insmodGravatar Denys Vlasenko2011-01-091-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: add -D option (synonym of --show-depends)Gravatar Serj Kalichev2010-12-281-54/+67
| | | | | | | | | | | | | | | | | The modern module-init-tools 3.12 has "-D" option and it works. The --show-depends and -a options can be used together due to upstream modprobe behaviour. function old new delta do_modprobe 536 579 +43 packed_usage 28035 28042 +7 modprobe_main 653 657 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 54/0) Total: 54 bytes Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: add support for --show-dependsGravatar Serj Kalichev2010-12-261-35/+60
| | | | | | | | | | | | | function old new delta modprobe_longopts - 16 +16 packed_usage 28018 28028 +10 modprobe_main 648 653 +5 do_modprobe 580 536 -44 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 31/-44) Total: -13 bytes Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanupGravatar Denys Vlasenko2010-10-291-2/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* depmod: accept and ignore -u, -q, -C FILEGravatar Pascal Bellard2010-10-181-2/+7
| | | | | Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modutils/*: move help bits into corresponding .c filesGravatar Denys Vlasenko2010-10-165-1/+69
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* modutils/*: move applet bits into corresponding *.c filesGravatar Denys Vlasenko2010-10-156-11/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>