Commit Graph

137 Commits

Author SHA1 Message Date
Denys Vlasenko
982e87f2fb Whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-30 11:52:58 +02:00
Felipe Contreras
428bd2d433 modprobe: accept -b even if blacklist functionality is disabled
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-31 14:55:15 +01:00
Timo Teras
e12e0acb92 modprobe: use hash table. speeds up significantly if modprobe.dep is large
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>
2011-06-20 09:38:13 +02:00
Denys Vlasenko
66426760be *: remove "Options:" string from help texts
function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05 03:58:28 +02:00
Denys Vlasenko
5dad4aeede modprobe: fix "modprobe -l name-with-dash"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-15 02:17:31 +01:00
Denys Vlasenko
b7c9fb27cb whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-03 00:05:48 +01:00
Denys Vlasenko
c5830bdf65 modprobe/insmod: fix parameter quoting
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>
2011-02-02 00:01:07 +01:00
Denys Vlasenko
b9f2d9f7d9 mass removal of underscores from _BB_DIR_foo and _BB_SUID_foo
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-18 13:58:01 +01:00
Serj Kalichev
8578196b76 modprobe: add -D option (synonym of --show-depends)
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>
2010-12-28 04:18:18 +01:00
Serj Kalichev
e4e911e712 modprobe: add support for --show-depends
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>
2010-12-26 01:56:19 +01:00
Denys Vlasenko
c15613c975 modutils/*: move applet bits into corresponding *.c files
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-15 11:29:02 +02:00
Denys Vlasenko
0ef64bdb40 *: make GNU licensing statement forms more regular
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>
2010-08-16 20:14:46 +02:00
Lauri Kasanen
a48a29f921 Modprobe: Make -l open the right file
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>
2010-07-10 01:27:03 +02:00
Pascal Bellard
b82b34e06d modprobe: add support for -l and -s. Remove some unsupported options
Fixed some goofs in help text

function                                             old     new   delta
modprobe_main                                        494     653    +159
packed_usage                                       27129   27145     +16
insmod_main                                           98      95      -3

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-07 01:18:53 +02:00
Denys Vlasenko
651a2697f7 *: merge some common strings
text   data    bss    dec    hexfilename
 838650   8009      0 846659  ceb43busybox_old
 838519   8009      0 846528  ceac0busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-23 16:25:17 +01:00
Denys Vlasenko
197202d435 modprobe: remove 2k limit on /proc/cmdline
function                                             old     new   delta
do_modprobe                                          365     520    +155
parse_and_add_kcmdline_module_options                149       -    -149

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-03 04:20:33 +01:00
Denys Vlasenko
3e26d4fa23 modprobe: pick up module options from /proc/cmdline too
Based on patch by Ozan Çağlayan (ozan AT pardus.org.tr)

function                                             old     new   delta
parse_and_add_kcmdline_module_options                  -     149    +149
do_modprobe                                          357     365      +8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-27 23:15:22 +01:00
Denys Vlasenko
98a4c7cf3d *: suppress ~60% of "aliased warnings" on gcc-4.4.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-04 15:00:15 +01:00
Denys Vlasenko
da879ec2e9 modprobe: protect against possible SEGV
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-26 08:17:45 +01:00
Denys Vlasenko
725b5a387a modprobe: it's not an error if module is already loaded. Closes bug 833
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-10 04:52:45 +01:00
Denys Vlasenko
ab19ede655 tidy up O_NONBLOCK usage. use libbb functions in stty.
Added O_RDONLY where improves readability. Note: O_RDONLY == 0,
so it is there even if not specified.

function                                             old     new   delta
stty_main                                           1289    1235     -54

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-11 21:05:42 +01:00
Denys Vlasenko
5da42fce51 modprobe: treat tabs in modules.dep as delimiters too. closes bug 567
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-14 02:10:54 +02:00
Denys Vlasenko
7eaf58d958 modprobe: do not use ->probed_name blidly
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-17 20:33:50 +02:00
Denys Vlasenko
ee47f6e44f modprobe: correct exitcode handling and error messages with respect to -q
function                                             old     new   delta
do_modprobe                                          319     339     +20
bb_delete_module                                      10      26     +16
moderror                                              62      71      +9
bb_init_module                                       112     119      +7
modprobe_main                                        488     494      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 58/0)               Total: 58 bytes

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-17 18:46:06 +02:00
Denys Vlasenko
f3cbfc0e2c modprobe: fix more bugs in modprobe -r
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 03:54:29 +02:00
Denys Vlasenko
140def848c modprobe: fix modprobe -r. closes bug 315
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-26 12:48:34 +02:00
Mike Frysinger
1e12ae9059 modprobe: add comment about expected modules.dep format
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-06 05:24:41 -04:00
Mike Frysinger
00ffaeab80 modprobe: add more useful debug points
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-05 20:13:45 -04:00
Denis Vlasenko
5e34ff29bc *: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
2009-04-21 11:09:40 +00:00
Denis Vlasenko
a6b6f05379 further work on modprobe
function                                             old     new   delta
gather_options_str                                     -      75     +75
config_file_action                                   388     413     +25
load_modules_dep                                     175     192     +17
add_probe                                             67      72      +5
modprobe_main                                        494     488      -6
gather_options                                        89       -     -89
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 3/1 up/down: 122/-95)            Total: 27 bytes
2009-03-06 22:48:11 +00:00
Denis Vlasenko
0e2f362a61 modprobe: rework/speedup by Timo Teras (timo.teras AT iki.fi)
function                                             old     new   delta
load_modules_dep                                       -     175    +175
helper_get_module                                      -     106    +106
gather_options                                         -      89     +89
add_probe                                              -      67     +67
config_file_action                                   345     388     +43
get_or_add_modentry                                    -      10     +10
loaded                                                 4       -      -4
read_config                                          239     234      -5
llist_find                                            34       -     -34
add_option                                            60       -     -60
modprobe_main                                        567     494     -73
do_modprobe                                          601     273    -328
------------------------------------------------------------------------------
(add/remove: 5/3 grow/shrink: 1/3 up/down: 490/-504)          Total: -14 bytes
   text    data     bss     dec     hex filename
 816778     476    7888  825142   c9736 busybox_old
 816768     476    7880  825124   c9724 busybox_unstripped
2009-03-05 16:32:27 +00:00
Denis Vlasenko
9604e1b8fc modprobe: emit "can't open 'modules.dep': (errno)" instead of "module not found"
*: s/can't open %s/can't open '%s'/, it's better to use same string.

function                                             old     new   delta
do_modprobe                                          588     601     +13
config_file_action                                   339     345      +6
modprobe_main                                        565     570      +5
unable_to_open                                        14      16      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 26/0)               Total: 26 bytes
   text    data     bss     dec     hex filename
 816800     476    7892  825168   c9750 busybox_old
 816812     476    7892  825180   c975c busybox_unstripped
2009-03-03 18:47:56 +00:00
Denis Vlasenko
54d10059c9 *: tweak error messages
sysctl: shrink; support recursing if name is a directory:
 "sysctl net.ipv4.conf". Patch by xmaks AT email.cz

   text    data     bss     dec     hex filename
 793659     504    7492  801655   c3b77 busybox_old
 793576     504    7492  801572   c3b24 busybox_unstripped
2008-12-24 03:11:43 +00:00
Denis Vlasenko
bb26db49b1 modprobe: fix a segfault when modprobe is called with no arguments at all
function                                             old     new   delta
modprobe_main                                        559     535     -24
2008-10-31 02:04:28 +00:00
Denis Vlasenko
ba1315d0fb modutils/*: rewrite by Timo Teras <timo.teras AT iki.fi>
- a lot faster (linear algorithmic complexity, smaller memory foot print)
- a lot smaller (the old code was overly complicated)
- loading of aliases is now module-init-tools compliant
- blacklisting is done correctly (-b option added)
- module argument quoting done right
- depmod now correctly generates modules.symbols and modules.alias

add/remove: 16/21 grow/shrink: 4/6 up/down: 6930/-9316 Total: -2386 bytes
   text    data     bss     dec     hex filename
 806039     592    6680  813311   c68ff busybox_old
 803498     592    6676  810766   c5f0e busybox_unstripped
2008-09-13 14:59:38 +00:00
Denis Vlasenko
9ddc0045ec modprobe: semi-trivial code shrink
function                                             old     new   delta
build_dep                                            870     859     -11
already_loaded                                       134     112     -22
modprobe_main                                        449     368     -81
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-114)           Total: -114 bytes
2008-08-06 00:51:43 +00:00
Denis Vlasenko
855ff6f503 modprobe: use buffering line reads (fgets) instead of reads().
libbb: remove reads()

function                                             old     new   delta
include_conf_file_act                                961     980     +19
localcmd                                             282     284      +2
already_loaded                                       155     151      -4
in_cksum                                              58      53      -5
modprobe_main                                       1630    1624      -6
reads                                                129       -    -129
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 2/3 up/down: 21/-144)          Total: -123 bytes
2008-08-04 21:16:46 +00:00
Denis Vlasenko
dadfb4975b hush: add #defines to switch off break/continue if loops are not supported
*: remove a few inline keywords
no code changes
2008-07-29 10:16:05 +00:00
Denis Vlasenko
e1ee48e0fd modprobe: support for /etc/modprobe.d, by Timo Teras.
function                                             old     new   delta
include_conf_file_act                                  -     929    +929
include_conf_recursive                                 -      30     +30
include_conf_file2                                     -      30     +30
include_conf_file                                      -      14     +14
include_conf_dir_act                                   -      14     +14
build_dep                                           1011     875    -136
include_conf                                         922       -    -922
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 0/1 up/down: 1017/-1058)        Total: -41 bytes
2008-07-29 00:19:44 +00:00
Denis Vlasenko
deeed59de0 libbb: introduce and use xrealloc_vector
function                                             old     new   delta
xrealloc_vector_helper                                 -      51     +51
create_list                                           84      99     +15
getopt_main                                          690     695      +5
passwd_main                                         1049    1053      +4
get_cached                                            85      89      +4
msh_main                                            1377    1380      +3
add_match                                             42      41      -1
read_lines                                           720     718      -2
grave                                               1068    1066      -2
fill_match_lines                                     143     141      -2
add_to_dirlist                                        67      65      -2
add_input_file                                        49      47      -2
act                                                  252     250      -2
fsck_main                                           2252    2246      -6
man_main                                             765     757      -8
bb_internal_initgroups                               228     220      -8
cut_main                                            1052    1041     -11
add_edge_to_node                                      55      43     -12
dpkg_main                                           3851    3835     -16
ifupdown_main                                       2202    2178     -24
sort_main                                            838     812     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124)          Total: -42 bytes
2008-07-08 05:14:36 +00:00
Denis Vlasenko
8124a96c34 mdoprobe: fix SEGV bug (by Vlad Dronnikov) 2008-06-22 16:59:46 +00:00
Denis Vlasenko
f45c4f41b7 whitespace and comment fixes, no code changes 2008-06-16 04:09:25 +00:00
Bernhard Reutner-Fischer
e0fd13e901 - shrink modprobe a little bit (~-40 bytes). ACKed by Yann. 2008-05-31 18:50:17 +00:00
Bernhard Reutner-Fischer
db508e3b82 - fix overflow; improve documentation while at it 2008-05-28 15:57:31 +00:00
Bernhard Reutner-Fischer
b85fb693c1 - Add config option for DEFAULT_DEPMOD_FILE and DEFAULT_DEPMOD_FILE.
No obj-code changes.
2008-05-27 10:55:34 +00:00
Denis Vlasenko
ae84b11467 modprobe: fix for blacklisting
The patch makes the order of the alias/blacklist in modprobe.conf 
irrelevant (like module-utils' modprobe). In first patch the alias had 
to be defined before the blacklist which caused problems because the 
modprobe.conf file is read before /lib/modules/*/modules.alias.

The attatched patch will mark the blacklisted module itself rather than 
trying to find the alias that points to the blacklisted module and test 
this flag later in the alias resolving stage.
2008-05-22 17:37:38 +00:00
Denis Vlasenko
9ddc8d54d1 modprobe: optional "blacklist" command support (by Natanael Copa)
is_conf_command                                        -      56     +56
include_conf                                         898     917     +19
check_dep                                            348     356      +8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 83/0)               Total: 83 bytes
2008-05-18 14:39:43 +00:00
Denis Vlasenko
c03e872112 save a bit of code with *strchrnul = '\0' trick
function                                             old     new   delta
nextline                                              59      55      -4
include_conf                                         902     898      -4
read_config                                          414     406      -8
fsck_main                                           1880    1869     -11
2007-12-26 20:56:55 +00:00
Denis Vlasenko
e7fca5125a *: remove superfluous "?" in option parsing 2007-11-10 01:32:18 +00:00
Denis Vlasenko
cb12cb2407 modprobe: fix a bug where we were entering endless loop
syslogd: strip trailing '\n' too, not only NULs
2007-11-06 11:34:03 +00:00