Commit Graph

41 Commits

Author SHA1 Message Date
Denys Vlasenko
87c40cf4de e2fsprogs: code shrink
function                                             old     new   delta
print_e2flags_long                                     -     109    +109
list_attributes                                      248     232     -16
print_e2flags                                        169      47    -122
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 109/-138)          Total: -29 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-24 09:31:57 +02:00
Denys Vlasenko
9468ea06d2 lsattr,chattr: do not open e.g. device files unless asked directly; do not follow links
Add O_NOFOLLOW (and O_NOCTTY for good measure) to open calls like e2fsprogs does.

In lsattr, when recursing, operate only on regular files, symlinks, and directories.
(Otherwise, "lsattr /dev" can e.g. open a watchdog device... not good).

At this time, looks like chattr/lsattr can't operate on symlink inodes -
ioctls do not work on open(O_PATH | O_NOFOLLOW) fds.

function                                             old     new   delta
lsattr_dir_proc                                      168     203     +35
change_attributes                                    410     408      -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 35/-2)              Total: 33 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-24 01:07:56 +02:00
Denys Vlasenko
85a5bc9148 chattr,lsattr: share stat error message
function                                             old     new   delta
.rodata                                           103692  103684      -8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-23 15:33:22 +02:00
Denys Vlasenko
96436fb36a e2fsprogs/*: remove ioctl calling obfuscation
function                                             old     new   delta
change_attributes                                    326     416     +90
list_attributes                                      222     248     +26
close_silently                                        22       -     -22
.rodata                                           103722  103692     -30
fgetsetversion                                        74       -     -74
fgetsetprojid                                        107       -    -107
fgetsetflags                                         148       -    -148
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 2/1 up/down: 116/-381)         Total: -265 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-23 12:56:40 +02:00
Denys Vlasenko
526b834790 lsattr,chattr: support -p
function                                             old     new   delta
fgetsetprojid                                          -     107    +107
list_attributes                                      169     222     +53
change_attributes                                    277     326     +49
chattr_main                                          272     307     +35
close_silently                                         -      22     +22
.rodata                                           103378  103393     +15
packed_usage                                       33658   33666      +8
fgetsetversion                                        88      74     -14
fgetsetflags                                         162     148     -14
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 5/2 up/down: 289/-28)           Total: 261 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-20 11:02:49 +02:00
Ron Yorston
5c69ad0ecd build system: drop PLATFORM_LINUX
PLATFORM_LINUX is a hidden configuration option which is disabled by
default and enabled at over a hundred locations for features that are
deemed to be Linux specific.

The only effect of PLATFORM_LINUX is to control compilation of
libbb/match_fstype.c.  This file is only needed by mount and umount.

Remove all references to PLATFORM_LINUX and compile match_fstype.c
if mount or umount is enabled.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-13 17:12:56 +02:00
Denys Vlasenko
b097a84d62 config: update size information
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-12-28 03:20:17 +01:00
Denys Vlasenko
99125c0495 chattr,lsattr,tune2fs: make them NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-08-05 20:38:04 +02:00
Denys Vlasenko
72089cf6b4 config: deindent all help texts
Those two spaces after tab have no effect, and always a nuisance when editing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-21 09:50:55 +02:00
Denys Vlasenko
4eed2c6c50 Update menuconfig items with approximate applet sizes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-18 22:01:24 +02:00
Denys Vlasenko
36647abcc3 chattr,lsattr: shorten help message
function                                             old     new   delta
packed_usage                                       30662   30645     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-19 01:29:20 +02:00
Denys Vlasenko
000eda41c0 e2fsprogs/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-18 22:40:23 +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
Pere Orga
6a3e01d5a9 move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c editors/*.c loginutils/*.c mailutils/*.c
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-03 01:33:55 +02:00
Denys Vlasenko
d5f1b1bbe0 *: add FAST_FUNC to function ptrs where it makes sense
function                                             old     new   delta
evalcommand                                         1195    1209     +14
testcmd                                                -      10     +10
printfcmd                                              -      10     +10
echocmd                                                -      10     +10
func_exec                                            270     276      +6
echo_dg                                              104     109      +5
store_nlmsg                                           85      89      +4
pseudo_exec_argv                                     195     198      +3
dotcmd                                               287     290      +3
machtime_stream                                       29      31      +2
discard_stream                                        24      26      +2
argstr                                              1299    1301      +2
killcmd                                              108     109      +1
evalfor                                              226     227      +1
daytime_stream                                        43      44      +1
run_list                                            2544    2543      -1
lookupvar                                             62      61      -1
ipaddr_modify                                       1310    1309      -1
...
parse_stream                                        2254    2245      -9
evalpipe                                             356     347      -9
collect_if                                           210     197     -13
read_opt                                             869     851     -18
handle_dollar                                        681     658     -23
print_addrinfo                                      1342    1303     -39
iterate_on_dir                                       156      59     -97
print_route                                         1709    1609    -100
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767)       Total: -693 bytes
   text    data     bss     dec     hex filename
 841748     467    7872  850087   cf8a7 busybox_old
 841061     467    7872  849400   cf5f8 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-05 12:06:05 +02:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
53354ac47d libbb: introduce and use print_flags().
Mostly by Natanael Copa <natanael.copa AT gmail.com>

function                                             old     new   delta
print_e2flags                                          -     189    +189
print_flags_separated                                  -      86     +86
static.flag_labels                                     -      60     +60
static.dma_wmode_masks                                 -      32     +32
static.flag_masks                                      -      28     +28
static.arp_labels                                      -      16     +16
static.arp_masks                                       -      12     +12
ls_main                                              836     843      +7
...
popstring                                            140     134      -6
arp_show                                             740     708     -32
print_flags                                          189      25    -164
ipaddr_list_or_flush                                2396    2170    -226
process_dev                                         5306    4706    -600
------------------------------------------------------------------------------
(add/remove: 10/0 grow/shrink: 5/10 up/down: 458/-1043)      Total: -585 bytes
   text    data     bss     dec     hex filename
 810564     624    7060  818248   c7c48 busybox_old
 810002     624    7060  817686   c7a16 busybox_unstripped
2008-06-07 15:10:29 +00:00
Denis Vlasenko
62a90cdd74 *: shrink by using [f]open_or_warn_stdin where appropriate
function                                             old     new   delta
lsattr_main                                           62     143     +81
open_or_warn_stdin                                     -      36     +36
fclose_if_not_stdin                                   20      47     +27
xfopen_stdin                                           -      20     +20
tac_main                                             336     356     +20
cksum_main                                           249     259     +10
bb_argv_dash                                           -       8      +8
su_main                                              448     455      +7
cmp_main                                             630     633      +3
passwd_main                                         1072    1074      +2
uudecode_main                                        317     315      -2
text_yank                                            110     108      -2
handle_incoming_and_exit                            2653    2651      -2
flags                                                  5       1      -4
write_leases                                         235     230      -5
fopen_or_warn_stdin                                   48      42      -6
fold_main                                            648     642      -6
static.argv_dash                                       8       -      -8
sum_main                                             142     128     -14
tail_main                                           1237    1221     -16
sed_main                                             711     695     -16
cmp_xfopen_input                                      17       -     -17
bb_cat                                               113      96     -17
catv_main                                            328     306     -22
strings_main                                         457     434     -23
hash_file                                            298     274     -24
sum_file                                             353     325     -28
sort_main                                            904     859     -45
expand_main                                          736     686     -50
cut_main                                            1116    1065     -51
md5_sha1_sum_main                                    549     493     -56
lsattr_args                                           90       -     -90
read_stduu                                           408     255    -153
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 7/20 up/down: 214/-657)        Total: -443 bytes
   text    data     bss     dec     hex filename
 797417     658    7428  805503   c4a7f busybox_old
 796973     658    7428  805059   c48c3 busybox_unstripped
2008-03-17 09:07:36 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
d059ddc1bb e2fsprogs: code shrink
text    data     bss     dec     hex filename
 776594     974    9420  786988   c022c busybox_old
 776494     974    9420  786888   c01c8 busybox_unstripped
2007-10-30 19:36:07 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
4daad9004d introduce bb_putchar(). saves ~1800 on uclibc (less on glibc). 2007-09-27 10:20:47 +00:00
Denis Vlasenko
fe7cd642b0 don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes
   text    data     bss     dec     hex filename
 773469    1058   11092  785619   bfcd3 busybox_old
 772644    1058   11092  784794   bf99a busybox_unstripped
2007-08-18 15:32:12 +00:00
Denis Vlasenko
b6adbf1be2 usage.c: remove reference to busybox.h
*: s/include "busybox.h"/include "libbb.h"
2007-05-26 19:00:18 +00:00
Denis Vlasenko
8acf521432 e2fsprogs: stop using statics in chattr. Minor code shrinkage (-130 bytes) 2007-04-15 11:48:27 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
c4f623ef2a put small subset of e2fsprogs back in the tree:
lsattr, chattr, fsck. Old e2fsprogs tree is in
e2fsprogs/old_e2fsprogs/*.
2006-12-26 01:30:59 +00:00
Denis Vlasenko
64c5402584 remove e2fsprogs. Nobody volunteered to clean up that mess 2006-12-26 01:25:48 +00:00
Denis Vlasenko
c6f188def8 silly size savings and capitalization fixes 2006-10-26 00:37:00 +00:00
Denis Vlasenko
7039a66b58 correct largefile support, add comments about it. 2006-10-08 17:54:47 +00:00
Denis Vlasenko
5625415085 dd: make it recognize not only 'k' but 'K' too;
make it (partially) CONFIG_LFS-aware
2006-10-07 16:24:46 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
Rob Landley
7c94bed234 Big dead code elimination pass from Garrett. 2006-05-03 21:58:45 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
"Vladimir N. Oleynik"
083d3f49c2 bb_mkdep: Rewroted. removed problem "include name must uniq", speed up * 3.
e2fsprogs: remove confuse bb_mkdep. Use internal e2fsprogs includes only.
other: remove confuse bb_mkdep.
2005-10-10 11:35:17 +00:00
Mike Frysinger
ea338fffb5 patch by Tito which uses a lot more busybox functions to reduce size nicely 2005-05-07 07:17:43 +00:00
Mike Frysinger
d6a8f5f0d0 use a generic error message 2005-04-25 05:27:12 +00:00
Mike Frysinger
c238a97a9e use asprintf in place of malloc/sprintf as suggested by solar 2005-04-25 05:24:35 +00:00
Mike Frysinger
d2a64d2fc2 bbify to shrink size 2005-04-25 04:10:35 +00:00
Mike Frysinger
d89e629e52 add new subdir for e2fsprogs 2005-04-24 05:07:59 +00:00