summaryrefslogtreecommitdiff
path: root/miscutils
AgeCommit message (Collapse)Author
2024-03-02crond: log5 fix typo, replace log level '4' with '5'Jones Syue
log5() with crondlog(5, msg, va) seems making logging more consistent. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes Signed-off-by: Jones Syue <jonessyue@qnap.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2024-01-01time: implement %% and \escapes in -f FMTDenys Vlasenko
function old new delta time_main 1217 1316 +99 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-12-31time: fix max resident set size unitNatanael Copa
The ru_maxrss is already in Kbytes and not pages. function old new delta ptok 21 - -21 time_main 1261 1217 -44 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-65) Total: -65 bytes fixes: https://bugs.busybox.net/show_bug.cgi?id=15751 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-17introduce and use exitcode_tDenys Vlasenko
function old new delta strings_main 422 420 -2 setfattr_main 175 173 -2 brctl_main 1548 1546 -2 makedevs_main 979 975 -4 rev_main 337 332 -5 getfattr_main 307 302 -5 cut_main 1201 1196 -5 cksum_main 398 393 -5 umount_main 573 565 -8 ln_main 516 508 -8 expand_main 660 652 -8 df_main 1068 1060 -8 renice_main 346 332 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/13 up/down: 0/-76) Total: -76 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-17getfattr: fix "getfattr NOTEXIST" - now prints error msgDenys Vlasenko
function old new delta getfattr_main 309 307 -2 .rodata 105395 105391 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-6) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-16getfattr: new appletYU Jincheng
function old new delta getfattr_main - 309 +309 print_attr - 115 +115 packed_usage 34576 34631 +55 .rodata 105349 105395 +46 lgetxattr - 41 +41 getxattr - 41 +41 llistxattr - 35 +35 listxattr - 35 +35 applet_names 2806 2815 +9 applet_main 1620 1624 +4 ------------------------------------------------------------------------------ (add/remove: 7/0 grow/shrink: 4/0 up/down: 690/0) Total: 690 bytes Signed-off-by: YU Jincheng <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-10i2ctransfer: fix build warningDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-07-10Update applet size estimatesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-06-15libbb: code shrink: introduce and use [_]exit_FAILURE()Denys Vlasenko
function old new delta exit_FAILURE - 7 +7 _exit_FAILURE - 7 +7 run 198 199 +1 restore_state_and_exit 114 115 +1 xbsd_write_bootstrap 399 397 -2 vfork_compressor 209 207 -2 sig_handler 12 10 -2 serial_ctl 154 152 -2 parse_args 1169 1167 -2 onintr 21 19 -2 make_new_session 493 491 -2 login_main 988 986 -2 gotsig 35 33 -2 do_iplink 1315 1313 -2 addgroup_main 397 395 -2 inetd_main 1911 1908 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-11seedrng: fix for glibc <= 2.24 not providing random headerThomas Devoogdt
- dropped the wrong define (not sure why it was there) - <sys/random.h> not available if glibc <= 2.24 - GRND_NONBLOCK not defined if <sys/random.h> not included - ret < 0 && errno == ENOSYS has to be true to get creditable set Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10seedrng: fix for glibc <= 2.24 not providing getrandom()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-11-29Remove "select PLATFORM_LINUX"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-11-29Fix non-Linux buildsSamuel Thibault
Various tools are Linuxish and should thus only attempted to build on Linux only. Some features are also Linux-only. Also, libresolv is used on all GNU platforms, notably GNU/Hurd and GNU/kfreeBSD. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-30*: style fixDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-26devmem: add 128-bit widthAaro Koskinen
Add 128-bit width if the compiler provides the needed type. function old new delta devmem_main 405 464 +59 .rodata 109025 109043 +18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-26tree: unicode tweak (use normal space char, 0x20)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-26tree: make it unicode-awareDenys Vlasenko
function old new delta tree_print 396 420 +24 .rodata 105251 105266 +15 tree_main 86 91 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 44/0) Total: 44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-08-18bc: hopefully fix bug 14956 (use-after-free)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-06-30tree: new appletRoger Knecht
Adds the tree program to list directories and files in a tree structure. function old new delta tree_print - 343 +343 scandir64 - 330 +330 scandir - 330 +330 tree_main - 86 +86 .rodata 105150 105228 +78 packed_usage 34511 34557 +46 alphasort64 - 31 +31 alphasort - 31 +31 strcoll - 5 +5 applet_names 2801 2806 +5 applet_main 1616 1620 +4 applet_suid 101 102 +1 applet_install_loc 202 203 +1 ------------------------------------------------------------------------------ (add/remove: 11/0 grow/shrink: 6/0 up/down: 1291/0) Total: 1291 bytes Signed-off-by: Roger Knecht <rknecht@pm.me> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-03seedrng: do not hash in a constant string, it's not adding entropyDenys Vlasenko
function old new delta seedrng_main 906 880 -26 .rodata 104899 104873 -26 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-52) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-02seedrng: restore error check on fsyncDenys Vlasenko
Or else security people will never stop nagging us. function old new delta seedrng_main 884 906 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-02seedrng: it's not a part of util-linux, move to miscutilsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-05-02crond: implement support for setting PATH in crontab filesPaul Fox
It's very inconvenient for a cron user not to be able to set a "personal" PATH for their cron jobs, as is possible with other crons function old new delta load_crontab 868 942 +74 .rodata 104878 104884 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 80/0) Total: 80 bytes Signed-off-by: Paul Fox <pgf@foxharp.boston.ma.us> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-02-06*: slap on a few ALIGN_PTR where appropriateDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-02-06*: slap on a few ALIGN* where appropriateDenys Vlasenko
The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" function old new delta .rodata 108586 108460 -126 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-126) Total: -126 bytes text data bss dec hex filename 970412 4219 1848 976479 ee65f busybox_old 970286 4219 1848 976353 ee5e1 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-17fix "defined but not used" warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-17ash,hush: fix handling of SIGINT while waiting for interactive inputDenys Vlasenko
function old new delta lineedit_read_key 160 237 +77 __pgetc 522 589 +67 fgetc_interactive 244 309 +65 safe_read_key - 39 +39 read_key 588 607 +19 record_pending_signo 23 32 +9 signal_handler 75 81 +6 .rodata 104312 104309 -3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/1 up/down: 282/-3) Total: 279 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-13libbb: introduce and use chdir_or_warn()Denys Vlasenko
function old new delta chdir_or_warn - 37 +37 send_cgi_and_exit 720 711 -9 xchdir 27 15 -12 setup_environment 233 217 -16 fork_job 449 433 -16 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 37/-53) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-13libbb: invert the meaning of SETUP_ENV_NO_CHDIR -> SETUP_ENV_CHDIRDenys Vlasenko
Double negatives are hard to grok. function old new delta login_main 986 988 +2 su_main 474 470 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-4) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-05libbb: code shrink: introduce and use [_]exit_SUCCESS()Denys Vlasenko
function old new delta exit_SUCCESS - 7 +7 _exit_SUCCESS - 7 +7 run_pipe 1562 1567 +5 pseudo_exec_argv 399 400 +1 finish 86 87 +1 start_stop_daemon_main 1109 1107 -2 shutdown_on_signal 38 36 -2 runsv_main 1662 1660 -2 redirect 1070 1068 -2 read_line 79 77 -2 pause_and_low_level_reboot 54 52 -2 list_i2c_busses_and_exit 483 481 -2 less_exit 12 10 -2 identify 4123 4121 -2 grep_file 1161 1159 -2 getty_main 1519 1517 -2 fsck_minix_main 2681 2679 -2 free_session 132 130 -2 fdisk_main 4739 4737 -2 clean_up_and_exit 53 51 -2 bsd_select 1566 1564 -2 bb_daemonize_or_rexec 198 196 -2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-01-05less: code shrinkDenys Vlasenko
function old new delta restore_tty - 29 +29 less_main 2107 2105 -2 getch_nowait 253 251 -2 buffer_print 614 612 -2 less_exit 51 12 -39 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 29/-45) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-10*: add NOINLINEs where code noticeably shrinksDenys Vlasenko
function old new delta display 85 1463 +1378 -73 bytes select_and_cluster - 1088 +1088 -139 bytes parse_reply - 979 +979 -109 bytes zbc_num_sqrt - 632 +632 -191 bytes show_bridge_port - 585 +585 -56 bytes sp_256_proj_point_add_8 - 576 +576 -45 bytes encode_then_append_var_plusminus - 554 +554 -118 bytes read_mode_db - 537 +537 -47 bytes fbset_main 1331 747 -584 sp_256_ecc_mulmod_8 1157 536 -621 brctl_main 2189 1548 -641 expand_one_var 2544 1872 -672 zxc_vm_process 6412 5589 -823 send_queries 1813 725 -1088 recv_and_process_peer_pkt 2245 1018 -1227 bb_dump_dump 1531 80 -1451 ------------------------------------------------------------------------------ (add/remove: 7/0 grow/shrink: 1/8 up/down: 6329/-7107) Total: -778 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-28less: Ignore -XIsmael Luceno
The flag disables termcap init/deinit of the terminal, which the applet doesn't do anyway. Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-09-06chat: hopefully fix infinite spinning on input EOFDenys Vlasenko
function old new delta chat_main 1295 1303 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-21ascii: new appletDenys Vlasenko
function old new delta .rodata 103397 103670 +273 ascii_main - 177 +177 applet_names 2739 2745 +6 applet_main 1584 1588 +4 applet_suid 99 100 +1 applet_install_loc 198 199 +1 packed_usage 33716 33713 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/1 up/down: 462/-3) Total: 459 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-15man: fix segfault in "man 1"Denys Vlasenko
function old new delta man_main 942 954 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-15shuf: simplify check that we have at least one FILEDenys Vlasenko
function old new delta .rodata 103190 103194 +4 packed_usage 33541 33537 -4 shred_main 354 337 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 4/-21) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-15*: more --help tweaksDenys Vlasenko
function old new delta packed_usage 33552 33541 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-14*: --help tweaksDenys Vlasenko
function old new delta packed_usage 33589 33552 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-13*: more --help tweakingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-13*: more --help tweaks, mostly expanding ts --helpDenys Vlasenko
function old new delta packed_usage 33554 33596 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-13*: --help tweaksDenys Vlasenko
function old new delta .rodata 103190 103189 -1 packed_usage 33590 33566 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-25) Total: -25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-12bc: tweak overflow detection in a^bDenys Vlasenko
function old new delta zbc_num_p 506 510 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-12bc: code shrink: combine init() and copy() where we canDenys Vlasenko
function old new delta bc_num_init_and_copy - 27 +27 zxc_program_popResultAndCopyToVar 495 483 -12 zxc_num_printNum 518 506 -12 zbc_num_p 518 506 -12 zxc_program_assign 357 341 -16 zbc_num_m 298 267 -31 zxc_vm_process 6498 6412 -86 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/6 up/down: 27/-169) Total: -142 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-12bc: fix for mul overflow in scale calculation in a^bDenys Vlasenko
function old new delta zbc_num_p 516 518 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-14platform.h: fix for Bionic >= 21 not having wait3()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-14*: --help text tweaksDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-13watchdog: make open-write-close-open functionality a config knobRasmus Villemoes
The behaviour introduced by commit 31c765081dc4 ("watchdog: stop watchdog first on startup") causes warnings in the kernel log when the nowayout feature is enabled: [ 16.212184] watchdog: watchdog0: nowayout prevents watchdog being stopped! [ 16.212196] watchdog: watchdog0: watchdog did not stop! The latter may also appear by itself in case the watchdog is of the type that cannot be stopped once started (e.g. the common always-running gpio_wdt kind). These warnings can be somewhat ominous and distracting, so allow configuring whether to use this open-write-close-open sequence rather than just open. Also saves a bit of .text when disabled: function old new delta shutdown_on_signal 31 58 +27 watchdog_main 339 306 -33 shutdown_watchdog 34 - -34 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 27/-67) Total: -40 bytes Make it default n: - It's a workaround for one specific type of watchdog (and that seems to be a defect in the kernel driver) - Even when not enabled in busybox config, it can easily be implemented outside busybox - Code size - Commit 31c765081dc4 should be considered a regression for all the boards that now end up with KERN_CRIT warnings in dmesg. - The author of that commit said "This use case is evidently rare, so if it is indeed causing problems for other people I'd OK then I understand whatever needs to be done." in the v1 thread. Cc: Matt Spinler <mspinler@linux.vnet.ibm.com> Cc: deweloper@wp.pl Cc: tito <farmatito@tiscali.it> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-03-23timeout,top,watch,ping: parse NN.N fractional duration in locales with other ↵Denys Vlasenko
separators Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-02-26bc: typo fix in commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>