summaryrefslogtreecommitdiff
path: root/modutils
Commit message (Collapse)AuthorAgeFilesLines
* Apply post-1.23.0 patches, bump version to 1.23.11_23_1Denys Vlasenko2015-01-274-37/+49
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe,rmmod: reject module names with slashesDenys 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.37David 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 nameDenys 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 oneDenys 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.bbDenys 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 appletsDenys Vlasenko2014-04-193-13/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Whitespace fixesDenys Vlasenko2013-07-301-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanup. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesDenys Vlasenko2013-01-141-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe_small: make rmmod to NOT remove dependencies. Closes 5162Denys Vlasenko2012-09-251-2/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: match more standard module fields and fix version fieldTanguy 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 textDenys Vlasenko2012-02-191-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* depmod: supply help textLauri 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 disabledFelipe 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 4411Denys Vlasenko2011-10-301-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* stop declariong our own dirname prototypeDenys 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 largeTimo 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 textsDenys 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"Denys Vlasenko2011-02-261-1/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: fix "modprobe -l name-with-dash"Denys Vlasenko2011-02-151-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: trivial optimizationsDenys Vlasenko2011-02-151-4/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: show firmware and depends fieldsLauri 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)Denys Vlasenko2011-02-131-8/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesDenys Vlasenko2011-02-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe/insmod: fix parameter quotingDenys 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 1396221d5a741ef8e1e8abca88836b341a3cab84Denys 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_fooDenys Vlasenko2011-01-187-11/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* insmod: check for module read errorsDenys Vlasenko2011-01-171-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lsmod: fox unsafe usage of strlen() - 1Denys Vlasenko2011-01-111-1/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* modprobe-small: support compressed modules in insmodDenys Vlasenko2011-01-091-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: add -D option (synonym of --show-depends)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-dependsSerj 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 cleanupDenys Vlasenko2010-10-291-2/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* depmod: accept and ignore -u, -q, -C FILEPascal 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 filesDenys Vlasenko2010-10-165-1/+69
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* modutils/*: move applet bits into corresponding *.c filesDenys Vlasenko2010-10-156-11/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* tweak help textDenys Vlasenko2010-10-091-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe-simple; do not error out on "rmmod module" if module is unloaded okDenys Vlasenko2010-09-251-12/+14
| | | | | | ...even if it wasn't found in /lib/modules/VER/ Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: s/perror/bb_simple_perror_msg/gMarek Polacek2010-09-121-1/+1
| | | | | | | | | | | function old new delta readLines 448 446 -2 doCommands 2449 2438 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-13) Total: -13 bytes Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* modutils: explain why we no longer quote paramsDenys Vlasenko2010-08-251-0/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* insmod: Do not add a pair of "" around the arguments of the module.Carmelo AMOROSO2010-08-251-2/+1
| | | | | | | | | | If there are some spaces in the insmod command line, then this will be splitted in single words as separate elements of argv. It just needs to chain them together in the options string passed to the sys_init_module syscall. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-1611-11/+11
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modutils: Add support for NDS32 architecture.Macpaul Lin2010-08-111-0/+21
| | | | | | | Add support of NDS32 architecture to modutils. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mark Linux-specific configuration optionsJeremie Koenig2010-07-191-0/+1
| | | | | | | | PLATFORM_LINUX is used as a dependency for applets or features which require Linux-specific interfaces. Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* depmod: generate "new-style" modules.dep with relative paths.Denys Vlasenko2010-07-181-29/+47
| | | | | | | | | | function old new delta parse_module 384 379 -5 depmod_main 590 559 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-36) Total: -36 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Modprobe: Make -l open the right fileLauri Kasanen2010-07-101-5/+5
| | | | | | | | | | Before: modprobe -l modules.dep not found No size change, just moved the chdir. Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: support relative paths in modules.depLauri Kasanen2010-06-271-11/+24
| | | | | | | | | function old new delta modinfo 272 329 +57 modinfo_main 325 344 +19 Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modinfo: needs DEFAULT_MODULES_DIR and DEFAULT_DEPMOD_FILELauri Kasanen2010-06-271-2/+2
| | | | | Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: stop defining _GNU_SOURCE in source files, it's in CFLAGS anywayDenys Vlasenko2010-06-181-2/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>