summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * examples/udhcp/simple.script: up interface on deconfig eventDenys Vlasenko2019-09-051-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: add a FIXME commentDenys Vlasenko2019-09-051-1/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix "set -o INVALID" affecting -e flag stateDenys Vlasenko2019-09-051-11/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: code shrinkDenys Vlasenko2019-09-051-9/+9
| | | | | | | | | | | | | | function old new delta gzip_main 267 264 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: set default compression level to 6 when CONFIG_FEATURE_GZIP_LEVELS=nDaniel Edgecumbe2019-09-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, GNU gzip -n and BusyBox gzip now produce identical output assuming that CONFIG_GZIP_FAST=2. >> Excuse me, but I wonder one thing: Why should we follow >> strictly with gzip on the no-options default behavior? > First, the default 6 compression level is a de-facto standard. BSD gzip > and Apple gzip (on macOS) use this default as well. So there is a > reasonable expectation that different gzip implementations act the same. > For instance, if the default for busybox gzip becomes 9, then someone > writing a script using busybox gzip could reasonably expect that the > compression level will still be 9 when the same script is run on another > system. That would be wrong. Implementations should not deviate from > de-facto standards without a strong reason. > > Second, the inherent reason for this default has not gone away. While > processor speeds have exploded since the default was set, so has the > typical size of compressed files. Multiple gigabytes are nothing unusual > these days. And gzip is often used for compression on the fly, precisely > because it offers a good compromise between speed and compression ratio. > So I believe 6 continues to be a reasonable default. function old new delta deflate 939 927 -12 Signed-off-by: Daniel Edgecumbe <git@esotericnonsense.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: set compression flags correctly as per standardDaniel Edgecumbe2019-09-051-8/+18
| | | | | | | | | | | | | | | | | | | | With this change and CONFIG_GZIP_FAST=2, CONFIG_FEATURE_GZIP_LEVELS=y, GNU gzip and BusyBox gzip now produce identical output at each compression level (excluding 1..3, as BusyBox does not implement these levels). Signed-off-by: Daniel Edgecumbe <git@esotericnonsense.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip: default level with ENABLE_FEATURE_GZIP_LEVELS should be 6Daniel Edgecumbe2019-09-051-1/+1
| | | | | | | | | | | | | | Fixes an off-by-one that actually resulted in level 7 being used Signed-off-by: Daniel Edgecumbe <git@esotericnonsense.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: Parse error & fix out of bounds read in xc_program_printStringBrian Foley2019-09-052-2/+24
| | | | | | | | | | | | | | | | function old new delta xc_program_print 712 735 +23 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: Fix segfault when executing strings generated using asciifyBrian Foley2019-09-052-2/+13
| | | | | | | | | | | | | | | | function old new delta zxc_vm_process 6884 6891 +7 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: execute shouldn't pop if stack head is not a stringBrian Foley2019-09-052-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches the behaviour of both GNU dc (as specified in its man page), and BSD dc (where stack_popstring() pops only if the head is a string.) Add a couple of tests to verify this behavior. function old new delta zxc_vm_process 6882 6884 +2 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: support stateless DHCPv6Eivind Versvik2019-08-241-9/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -l will send Information-Request to request configuration parameters function old new delta packed_usage 33114 33180 +66 send_d6_info_request - 62 +62 udhcpc6_main 2534 2593 +59 udhcpc6_longopts 199 211 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/0 up/down: 199/0) Total: 199 bytes Signed-off-by: Eivind Versvik <versvikeivind@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | winansi: code shrinkRon Yorston2020-01-081-37/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the ANSI emulation code to reduce its size. - Fetch console attributes when required rather than caching them. The init() function is no longer required; the only remaining initialisation is now performed in is_console(). - Turning off inverse video (ESC[27m) didn't work properly. This has been improved though it still doesn't work in some unlikely cases (ESC[7;27m). These changes save 180 bytes.
* | Update copyright dateRon Yorston2020-01-082-2/+2
| |
* | winansi: restore correct attributes after lsRon Yorston2020-01-071-1/+7
| | | | | | | | | | | | | | | | | | As reported in GitHub issue #178 the last colour set by the ls command is retained in the console. This is due to the previous commit reinitialising the stored attributes more frequently than it should. Attriubutes should only be initialised once.
* | winansi: fix escape processing in Windows 10 release 1809Ron Yorston2020-01-061-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in GitHub issue #177, ANSI escape sequences don't work reliably after shell redirection. The problem appears to be due to a change in the behaviour of dup2() in Windows 10 release 1809. The escape handling code kept a copy of the console handle for internal use. Prior to Windows 10 release 1809 this worked; since then unwinding shell redirections results in the actual console handle changing from time to time for reasons that are unknowable without access to the source code. Fix this by always fetching the console handle instead of caching it.
* | ash: copy line editing history during forkshellRon Yorston2019-12-161-10/+94
| | | | | | | | | | Add code to store line editing history in the forkshell data block. This allows things like 'history | grep whatever' to work.
* | ash: copy alias table during forkshellRon Yorston2019-12-151-1/+77
| | | | | | | | | | | | | | | | The alias table has never been copied during forkshell. As a result any attempts to use the alias command in conjunction with pipes or backquote expansion, for example, fail. Fix this by adding the necessary code.
* | Update README.mdRoss Smith II2019-12-011-1/+1
| |
* | testsuite: ensure tests work when directory name has spacesFRP-3244-g48128b9aaRon Yorston2019-08-162-4/+4
| |
* | ash: revert change to behaviour of -s optionRon Yorston2019-08-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Upstream BusyBox commit f3634584d (ash,hush: show 'c' in $- if run in "sh -c CMD") changed the behaviour of -s to match that of bash rather than dash. This means that the -s and -c options can't be combined. This combination of options is used by the Windows 'su' applet to prevent the new console window from shutting down after the command has run. It's also useful when the shell is to be run with an initialisation command (GitHub issue #100). Revert the change so -s behaves as in dash.
* | Merge branch 'busybox' into mergeRon Yorston2019-08-16244-1248/+1714
|\|
| * top: do not use previous colleced data wheh "h" toggles threads displayDenys Vlasenko2019-08-111-1/+4
| | | | | | | | | | | | | | | | | | This prevents first update from showing incorrect CPU usage data function old new delta handle_input 620 643 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: s/iphdr/ip6_hdr/Denys Vlasenko2019-08-091-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nmeter: do not clamp down %Nc to minimum of 10 (think nmeter "%`nproc`c")Denys Vlasenko2019-08-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Also, go for unsigned divisions. function old new delta init_cpu 61 73 +12 collect_cpu 444 422 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 12/-22) Total: -10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * stat: print nanosecond times, fix printing of empty linesDenys Vlasenko2019-08-031-39/+36
| | | | | | | | | | | | | | function old new delta human_time 36 73 +37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix set -o to not show "nameless" optionsDenys Vlasenko2019-08-021-0/+2
| | | | | | | | | | | | Patch by Martijn Dekker <martijn@inlv.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: change -a from meaning "lzma" to mean "autodetect by extension"Denys Vlasenko2019-08-021-18/+42
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta tar_main 1026 1100 +74 packed_usage 33311 33329 +18 tar_longopts 309 325 +16 vfork_compressor 246 210 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 108/-36) Total: 72 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: code shrinkDenys Vlasenko2019-08-011-12/+13
| | | | | | | | | | | | | | | | | | | | function old new delta writeLongname 226 228 +2 static.prefilled 48 - -48 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 2/-48) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: only catch unexpected exceptions in PS1 expansionRon Yorston2019-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d1a2fa2a4 (ash: catch error in arithmetic expansion in PS1) catches all exceptions raised by expandarg(). Some exceptions, such as the EXEXIT raised when command expansion is used, are expected: export PS1='$(echo "$ ")' These should be processed normally or the shell hangs at the prompt. function old new delta expandstr 344 353 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 9/0) Total: 9 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unicode: code shrink in character width determinationDenys Vlasenko2019-07-231-0/+6
| | | | | | | | | | | | | | function old new delta bb_wcwidth 267 238 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: include <crypt.h> only if necessaryDenys Vlasenko2019-07-161-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: add comment about mode6, no code changesDenys Vlasenko2019-07-021-0/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: commonalize message stringsDenys Vlasenko2019-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta recv_and_process_peer_pkt 961 973 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 12/0) Total: 12 bytes text data bss dec hex filename 953108 481 7288 960877 ea96d busybox_old 953086 481 7288 960855 ea957 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-02225-736/+845
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: abort if argvs are (unexpectedly) givenDenys Vlasenko2019-07-021-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * free: include SReclaimable in cached valueLukas Rusak2019-06-251-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that the 'used' values from busybox free and procps-ng free differed so I looked into why. It turns out that procps-ng uses the "SReclaimable" value as part of the cached value. This was changed in procps-ng commit 05d751c4f076a2f0118b914c5e51cfbb4762ad8e function old new delta free_main 633 653 +20 Signed-off-by: Lukas Rusak <lorusak@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: deal with "declaration of 'link' shadows a global declaration" warningDenys Vlasenko2019-06-251-7/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * pidof: support "pidof /path/to/binary" caseDenys Vlasenko2019-06-151-1/+5
| | | | | | | | | | | | | | function old new delta find_pid_by_name 230 227 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * readlink,realpath: fix a case with a symplink, closes 11021Denys Vlasenko2019-06-131-0/+29
| | | | | | | | | | | | | | function old new delta xmalloc_realpath_coreutils 125 201 +76 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc: fix comment, no code changesDenys Vlasenko2019-06-131-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: fix aliasing warningDenys Vlasenko2019-06-111-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dhcpc.c: Added support for relay server parameter.Martin Lewis2019-06-111-4/+9
| | | | | | | | | | | | | | | | | | | | Resolved a TODO by adding support for gateway_nip parameter. function old new delta udhcp_run_script 792 835 +43 Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Start 1.32.0 development cycleDenys Vlasenko2019-06-101-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Bump version to 1.31.01_31_0Denys Vlasenko2019-06-101-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * mount,losetup: use /dev/loop-control is it existsDenys Vlasenko2019-06-093-10/+47
| | | | | | | | | | | | | | | | | | | | | | function old new delta get_free_loop - 58 +58 set_loop 597 649 +52 losetup_main 482 476 -6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 110/-6) Total: 104 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * start-stop-daemon: change priority before dropping privilegesAitor Esteve Alvarado2019-06-091-9/+9
| | | | | | | | | | | | | | | | | | Currently start-stop-daemon fails when using both the -c option (set uid) and -N option (set niceness/priority) as it first drops privileges and then tries to increase the priority. This patch changes the order of execution. Signed-off-by: Aitor Esteve Alvarado <aesteve@singularaircraft.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tftp: allow -lc and -cl optionsDenys Vlasenko2019-06-091-1/+9
| | | | | | | | | | | | | | function old new delta tftp_main 394 396 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tftpd: revert erroneous changeDenys Vlasenko2019-06-091-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tftp: optional tftp-hpa compatDenys Vlasenko2019-06-092-3/+43
| | | | | | | | | | | | | | function old new delta tftp_main 276 394 +118 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * expand: add commented-out code to handle NULsDenys Vlasenko2019-06-091-8/+35
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>