Commit Graph

1474 Commits

Author SHA1 Message Date
Denis Vlasenko
9d04b6b630 mkdosfs (aka mkfs.vfat): new applet by Vladimir
text    data     bss     dec     hex filename
 821202     476    7616  829294   ca76e busybox_old
 823577     476    7616  831669   cb0b5 busybox_unstripped
2009-03-28 02:13:01 +00:00
Denis Vlasenko
c0ea82a457 libbb: revent previous version of "concurrent history updating"
and replace it with one which does not "snoop" history written
by others. (1) it is what bug 185 needs, and (2) it is less bloaty:

function                                             old     new   delta
load_history                                           -     252    +252
read_line_input                                     3155    3287    +132
next_token                                           914     918      +4
qrealloc                                              36      33      -3
getoptscmd                                           713     708      -5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 388/-8)            Total: 380 bytes
2009-03-23 06:33:37 +00:00
Denis Vlasenko
57abf9e947 libbb: make history saving/loading concurrent-safe
* all history writers always append (not overwrite) history files
* they reload history if they detect that file length has changed since last
write
* they trim history file only when it grows 4 times longer than MAXLINES
* they do this atomically by creating new file and renaming it to old

Unfortunately, this comes at a price:

function                                             old     new   delta
load_history                                           -     346    +346
read_line_input                                     3155    3358    +203
new_line_input_t                                      17      31     +14
...irrelevant small jitter...
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/5 up/down: 573/-13)           Total: 560 bytes
2009-03-22 19:00:05 +00:00
Denis Vlasenko
83518d18a3 Compatibility fixes:
grep: support -z
find: support --mindepth
  together +45 bytes
cpio: support -p (configurable, +230 bytes)
libbb: tweaks for cpio
2009-03-20 22:17:13 +00:00
Denis Vlasenko
9f57cf6604 ftpd: fix command fetching to not do it in 1-byte reads;
fix command de-escaping. Tested to download files with embeeded \xff and LF.
libbb: tweaks for the above

function                                             old     new   delta
ftpd_main                                           2231    2321     +90
xmalloc_fgets_internal                               190     222     +32
xmalloc_fgets_str_len                                  -      27     +27
xmalloc_fgets_str                                      7      23     +16
xmalloc_fgetline_str                                  10      26     +16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 181/0)             Total: 181 bytes
2009-03-18 17:32:44 +00:00
Denis Vlasenko
20c8216897 ftpd: add idle and absolute timeouts. This is a security issue,
otherwise ftpd may end up hanging indefinitely.

function                                             old     new   delta
timeout_handler                                        -     110    +110
ftpd_main                                           2019    2115     +96
packed_usage                                       25662   25685     +23
handle_upload_common                                 306     322     +16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 245/0)             Total: 245 bytes
2009-03-16 16:19:53 +00:00
Denis Vlasenko
8ec8d5e3db sha: fix thinko in sha512; add FAST_FUNC to sha1/sha256
function                                             old     new   delta
sha512_process_block128                             1334    1336      +2
sha1_hash                                            112     111      -1
sha256_process_block64                               446     440      -6
sha1_process_block64                                 494     484     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-17)             Total: -15 bytes
2009-03-15 02:56:00 +00:00
Denis Vlasenko
e9afc468fa sha: merge sha1/sha256 handling (they are similar enough for this),
shrink sha215 code

function                                             old     new   delta
sha1_end                                             129     142     +13
sha1_process_block64                                 486     494      +8
sha256_begin                                          37      44      +7
sha1_begin                                            49      56      +7
sha1_hash                                            108     112      +4
...
sha512_end                                           204     184     -20
sha512_process_block128                             1405    1334     -71
sha256_process_block64                               520     446     -74
sha256_end                                           147       -    -147
sha512_hash                                          297     130    -167
sha256_hash                                          260       -    -260
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 11/9 up/down: 59/-752)         Total: -693 bytes
2009-03-15 02:28:05 +00:00
Denis Vlasenko
7aaedcf21e mount: support "-O option"; stop trying to mount swap partitions
function                                             old     new   delta
mount_main                                           975    1152    +177
umount_main                                          640     636      -4
packed_usage                                       25666   25662      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 177/-8)            Total: 169 bytes
2009-03-14 22:57:20 +00:00
Denis Vlasenko
c8329c9568 sha: reduce sha256/512 context size. Make sha1/sha256 code more similar
function                                             old     new   delta
sha512_end                                           182     204     +22
sha256_end                                           137     147     +10
sha1_hash                                            113     108      -5
sha1_end                                             143     129     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 32/-19)             Total: 13 bytes
2009-03-12 19:06:18 +00:00
Denis Vlasenko
cd2cd312b7 shrink sha hashing a bit more (remove wbuflen field from ctx),
remove the requirement for aligned buffer

function                                             old     new   delta
sha512_hash                                          262     297     +35
sha1_end                                             136     143      +7
passwd_main                                         1019    1023      +4
sha256_end                                           135     137      +2
count_lines                                           72      74      +2
sha256_hash                                          259     260      +1
popstring                                            164     158      -6
sha512_begin                                          88      81      -7
sha256_begin                                          44      37      -7
parse_expr                                           832     824      -8
bbunpack                                             446     438      -8
sha256_process_block64                               529     520      -9
md5_end                                              166     151     -15
evaltreenr                                           817     802     -15
evaltree                                             817     802     -15
sha512_end                                           204     182     -22
sha512_process_block128                             1444    1405     -39
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/11 up/down: 51/-151)         Total: -100 bytes
2009-03-12 15:40:27 +00:00
Denis Vlasenko
98c87f7575 sha256/512: code shrink. Run-tested.
function                                             old     new   delta
sha512_process_block128                                -    1444   +1444
sha1_process_block64                                   -     542    +542
sha256_process_block64                                 -     529    +529
K512_lo                                                -     320    +320
K256                                                   -     320    +320
init512_lo                                             -      32     +32
init256                                                -      32     +32
sha1_hash                                             99     128     +29
sha256_end                                           160     135     -25
sha1_end                                             189     160     -29
sha512_end                                           237     204     -33
sha256_begin                                          77      44     -33
sha512_begin                                         154      88     -66
sha256_hash                                          338     259     -79
sha512_hash                                          358     262     -96
sha1_compile                                         542       -    -542
sha256_process_block                                 594       -    -594
static.K                                             896       -    -896
sha512_process_block                                1861       -   -1861
------------------------------------------------------------------------------
(add/remove: 7/4 grow/shrink: 1/7 up/down: 3248/-4254)      Total: -1006 bytes
   text    data     bss     dec     hex filename
 808013     468    7856  816337   c74d1 busybox_old
 807007     468    7856  815331   c70e3 busybox_unstripped
2009-03-11 21:15:51 +00:00
Denis Vlasenko
4221e90ae4 ftpd: stop unconditional logging to syslog. This was the only applet
which was doing it. Added option -S to enable it when desired.

function                                             old     new   delta
packed_usage                                       25647   25666     +19
ftpd_main                                           1826    1825      -1
2009-03-11 15:07:44 +00:00
Denis Vlasenko
9257671c76 fix typo in help text 2009-03-09 16:25:33 +00:00
Denis Vlasenko
c41cba5a57 ftpd: reuse ls applet for LIST/NLST/STAT generation
function                                             old     new   delta
popen_ls                                               -     211    +211
ftpd_main                                           1760    1826     +66
handle_dir_common                                    199     228     +29
get_remote_transfer_fd                                89     104     +15
replace_char                                          30      34      +4
handle_upload_common                                 263     265      +2
bind_for_passive_mode                                129     121      -8
cmdio_write                                           84      62     -22
escape_text                                          166     136     -30
init_data_sock_params                                 81       -     -81
ftpdataio_dispose_transfer_fd                         87       -     -87
write_dirstats                                       149       -    -149
write_filestats                                      603       -    -603
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 11/5 up/down: 384/-986)        Total: -602 bytes
   text    data     bss     dec     hex filename
 808804     476    7864  817144   c77f8 busybox_old
 808156     476    7864  816496   c7570 busybox_unstripped
2009-03-09 15:46:07 +00:00
Denis Vlasenko
73c571a5ff *: move get_sock_lsa and xwrite_str to libbb, use where appropriate
function                                             old     new   delta
get_sock_lsa                                           -      72     +72
buffer_fill_and_print                                179     196     +17
parse_expr                                           824     832      +8
read_base64                                          343     348      +5
nameval                                              202     206      +4
fbset_main                                          1694    1698      +4
expand                                              1849    1853      +4
udhcp_send_kernel_packet                             249     252      +3
udhcp_get_option                                     223     222      -1
chat_main                                           1246    1245      -1
pack_gzip                                           1661    1659      -2
doset                                                299     297      -2
bb__parsespent                                       119     117      -2
test_main                                            260     257      -3
qgravechar                                           109     106      -3
tcpudpsvd_main                                      1834    1830      -4
sysctl_display_all                                   589     580      -9
xopen_xwrite_close                                    44      33     -11
prs                                                   30      18     -12
find_main                                            418     406     -12
full_write2_str                                       25      12     -13
adduser_main                                         667     654     -13
evaltreenr                                           817     802     -15
evaltree                                             817     802     -15
tftpd_main                                           526     493     -33
ftpd_main                                           2050    1990     -60
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/18 up/down: 117/-211)         Total: -94 bytes
2009-03-09 00:12:37 +00:00
Denis Vlasenko
5e4fda0aff ftpd: code chrink, fixed some minor bugs
ls: update comment
*: openlog fixes (added LOG_PID, set LOG_DAEMON as appropriate)

function                                             old     new   delta
xwrite_str                                             -      26     +26
cmdio_write_ok                                         -      15     +15
handle_cwd                                            40      45      +5
packed_usage                                       25668   25670      +2
cmdio_write_raw                                        7       9      +2
handle_upload_common                                 322     320      -2
udhcpd_main                                         1375    1372      -3
udhcpc_main                                         2362    2359      -3
port_cleanup                                          27      23      -4
handle_dir_common                                    221     209     -12
str_netfd_write                                       26       -     -26
cmdio_get_cmd_and_arg                                122       -    -122
ftpd_main                                           2208    2050    -158
------------------------------------------------------------------------------
   text    data     bss     dec     hex filename
 809933     476    7864  818273   c7c61 busybox_old
 809199     476    7864  817539   c7983 busybox_unstripped
2009-03-08 23:46:48 +00:00
Denis Vlasenko
16b4a2de97 ftpd: new applet by Adam Tkac
$ size ftpd.o
   text    data     bss     dec     hex filename
   5703       0       0    5703    1647 ftpd.o
2009-03-08 09:30:56 +00:00
Denis Vlasenko
fb1a23d73b halt/reboot/poweroff: improve error reporting
function                                             old     new   delta
halt_main                                            207     185     -22
2009-03-07 01:54:24 +00:00
Denis Vlasenko
021de3f029 sendmail: document and fix usage of fd #4, fix check for helper failure.
function                                             old     new   delta
packed_usage                                       25663   25694     +31
signal_handler                                       191     215     +24
kill_helper                                           22      31      +9
launch_helper                                        194     184     -10
get_cred_or_die                                      142     129     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 64/-23)             Total: 41 bytes
2009-03-04 17:56:00 +00:00
Denis Vlasenko
7e0c243ad5 sendmail: improve help text 2009-03-02 16:12:00 +00:00
Bernhard Reutner-Fischer
12aca796ba - improve wording 2009-02-24 10:03:22 +00:00
Bernhard Reutner-Fischer
0d22d1755c - add flash_eraseall
This is the result after converting mtd-utils' flash_eraseall to BB.
The functionality given by this patch almost the same except that this
one does not support long options.
I needed this tool a system which does not have a lot of flash for RFS
and merging this into BB as the only way out.

[bigeasy@]$ ./scripts/bloat-o-meter bb_wo_fl bb_w_fl
function                                             old     new   delta
flash_eraseall_main                                    -    1072   +1072
show_progress                                          -      62     +62
packed_usage                                       25156   25176     +20
applet_names                                        1958    1973     +15
applet_main                                         2352    2360      +8
target_endian                                          -       4      +4
applet_nameofs                                       588     590      +2
applet_install_loc                                   147     148      +1
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 5/0 up/down: 1184/0)           Total: 1184 bytes
[bigeasy@]$ size miscutils/flash_eraseall.o
   text    data     bss     dec     hex filename
   1586       4       0    1590     636 miscutils/flash_eraseall.o

Signed-off-by: Benedigt Spranger <b.spranger@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2009-02-18 13:23:46 +00:00
Denis Vlasenko
9f00e05781 killall and sestatus also need ARGVN scanning 2009-02-14 01:36:11 +00:00
Denis Vlasenko
a0ab943492 function old new delta
kill_main                                            706     884    +178
2009-02-07 22:30:39 +00:00
Denis Vlasenko
6d5590f9d0 sendmail: remove erroneous usage lines 2009-02-04 00:01:07 +00:00
Denis Vlasenko
4acdb46ff1 ionice: new applet, adapted from Linux kernel' example by Walter Harms
text    data     bss     dec     hex filename
1050316     924   10952 1062192  103530 busybox_old
1050758     924   10952 1062634  1036ea busybox_unstripped
2009-01-31 21:45:57 +00:00
Denis Vlasenko
cab28aa7de init: preparatory patch, no code changes 2009-01-31 01:02:07 +00:00
Denis Vlasenko
39b681343b tunctl: new applet by Vladimir
function                                             old     new   delta
tunctl_main                                            -     371    +371
packed_usage                                       25669   25799    +130
applet_names                                        1981    1988      +7
applet_main                                         1192    1196      +4
applet_nameofs                                       596     598      +2
applet_install_loc                                   149     150      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 515/0)             Total: 515 bytes
2009-01-23 02:07:14 +00:00
Denis Vlasenko
76ddc2e3e4 libbb: add bb_unsetenv (taken from hush).
udhcpc: stop filtering environment passed to the script.
crond: fix uncovered potential bug (failing unsetenv)
mdev: fix uncovered potential bug (failing unsetenv)
tcp, udpsvd: fix uncovered potential bug (failing unsetenv)

function                                             old     new   delta
safe_setenv                                            -      58     +58
bb_unsetenv                                            -      55     +55
builtin_unset                                        139     138      -1
tcpudpsvd_main                                      1843    1830     -13
free_strings_and_unsetenv                             87      53     -34
udhcp_run_script                                    1186    1133     -53
safe_setenv4                                          62       -     -62
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 0/4 up/down: 113/-163)          Total: -50 bytes
2008-12-30 05:05:31 +00:00
Denis Vlasenko
73ac056f50 s/an user/a user/ 2008-12-25 01:01:23 +00:00
Denis Vlasenko
4e12b1a2a9 libbb: introduce and use xmalloc_ttyname (-32 in bss).
ash: small code shrink

   text    data     bss     dec     hex filename
 793669     504    7524  801697   c3ba1 busybox_old
 793659     504    7492  801655   c3b77 busybox_unstripped
2008-12-23 23:36:47 +00:00
Denis Vlasenko
e53738558f *: fix SO_BINDTODEVICE. Kernel wants at least IFNAMSIZ bytes there. 2008-12-10 11:12:16 +00:00
Denis Vlasenko
efb545b9bd optimize 16- and 32-bit moves
function                                             old     new   delta
udhcpd_main                                         1239    1257     +18
udhcp_add_simple_option                               93      92      -1
buffer_read_le_u32                                    19      18      -1
unpack_gz_stream_with_info                           526     520      -6
dnsd_main                                           1470    1463      -7
udhcp_run_script                                    1208    1186     -22
send_ACK                                             255     229     -26
arping_main                                         1661    1623     -38
send_offer                                           470     428     -42
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/8 up/down: 18/-143)          Total: -125 bytes
2008-12-08 22:56:18 +00:00
Denis Vlasenko
15437e3e2a libbb: add xgetgrnam too. ~0 code size change 2008-12-05 16:23:06 +00:00
Denis Vlasenko
e45930e890 Fold mkpasswd applet into cryptpw.
mkpasswd is in Debian, OTOH cryptpw was added to busybox earlier.
Trying to make both camps happy by making those two applets just aliases.
They are command-line compatible. We can decide whether we want to drop one
(and which one) later.

function                                             old     new   delta
cryptpw_main                                         183     314    +131
static.methods                                        21       -     -21
packed_usage                                       25707   25648     -59
mkpasswd_main                                        307       -    -307
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/1 up/down: 131/-387)         Total: -256 bytes
2008-12-04 12:05:26 +00:00
Denis Vlasenko
d7a805efaf libbb: introduce and use xgetpwnam. ~ -150 bytes. 2008-12-03 19:05:55 +00:00
Bernhard Reutner-Fischer
ac1c96f673 - remove superfluous comment from previous commit 2008-12-03 18:49:44 +00:00
Bernhard Reutner-Fischer
82b1429966 - add new applet mkpasswd(1)
function                                             old     new   delta
bb_ask                                                 -     355    +355
mkpasswd_main                                          -     296    +296
.rodata                                           121746  121847    +101
packed_usage                                       24632   24689     +57
static.methods                                         -      21     +21
gmatch                                               229     248     +19
bb_ask_stdin                                           -      11     +11
applet_names                                        1949    1958      +9
applet_main                                         1172    1176      +4
sulogin_main                                         503     505      +2
applet_nameofs                                       586     588      +2
sha256_hash                                          329     327      -2
correct_password                                     208     206      -2
parse_command                                       1442    1439      -3
get_cred_or_die                                      145     141      -4
passwd_main                                         1054    1044     -10
bb_askpass                                           348       -    -348
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 7/5 up/down: 877/-369)          Total: 508 bytes
2008-12-03 18:48:39 +00:00
Denis Vlasenko
6ebb2f56d5 crond: use bb_setpgrp, not setpgrp
platform.h: make a bit more readable
2008-12-03 10:46:12 +00:00
Denis Vlasenko
0c68a874e7 libbb: password/group function helpers rewritten by Tito:
function                                             old     new   delta
xgetpwuid                                              -      27     +27
uid2uname_utoa                                         -      22     +22
gid2group_utoa                                         -      22     +22
uid2uname                                              -      18     +18
gid2group                                              -      18     +18
buffer_fill_and_print                                179     196     +17
print_user                                            12      24     +12
print_group                                           12      24     +12
get_cached                                            89      99     +10
...
print_common                                         134     120     -14
vlock_main                                           415     396     -19
logger_main                                          410     387     -23
crontab_main                                         642     609     -33
bb_getpwuid                                           42       -     -42
bb_getgrgid                                           42       -     -42
bb_getug                                              80       -     -80
------------------------------------------------------------------------------
(add/remove: 6/3 grow/shrink: 9/11 up/down: 187/-296)        Total: -109 bytes
2008-12-02 22:56:59 +00:00
Denis Vlasenko
360d9661b6 libbb: add strncpy_IFNAMSIZ
function                                             old     new   delta
...
udhcp_read_interface                                 225     220      -5
brctl_main                                          1151    1146      -5
add_interface                                        109     104      -5
ipaddr_list_or_flush                                2174    2167      -7
do_add_ioctl                                          88      80      -8
vconfig_main                                         249     240      -9
do_del_ioctl                                          78      68     -10
do_iplink                                           1186    1173     -13
do_if_fetch                                          766     753     -13
buffer_fill_and_print                                196     179     -17
parse_args                                          1709    1684     -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/20 up/down: 11/-140)         Total: -129 bytes
2008-12-02 18:18:50 +00:00
Denis Vlasenko
7a1ddf20f3 mountpoint: add -n option (by Vladimir)
text    data     bss     dec     hex filename
 799859     560    7748  808167   c54e7 busybox_old
 799845     560    7748  808153   c54d9 busybox_unstripped
2008-11-29 12:54:16 +00:00
Denis Vlasenko
d16950ded9 acpid: new applet by Vladimir. +737 bytes 2008-11-29 09:05:50 +00:00
Denis Vlasenko
4240408b70 trim help text a bit 2008-11-24 13:42:24 +00:00
Denis Vlasenko
a9acbe6cad timeout: new applet. 370 bytes. by Roberto Foglietta. 2008-11-24 13:25:20 +00:00
Denis Vlasenko
36309cf3f4 insmod: clarify module_name / file_name distinction 2008-11-22 18:29:01 +00:00
Denis Vlasenko
9a4c0d59a7 inotifyd: exit if x event happened for all files
fix FIONREAD parameter type
 fix default mask code
 shrink help text

function                                             old     new   delta
inotifyd_main                                        497     506      +9
packed_usage                                       25446   25431     -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 9/-15)              Total: -6 bytes
2008-11-20 01:24:39 +00:00
Denis Vlasenko
a09a42cd83 inotify: add x, o, and u events 2008-11-17 22:19:18 +00:00
Denis Vlasenko
2479cd4a5d inotifyd: fix "inotifyd with no params" case 2008-11-14 22:14:12 +00:00