aboutsummaryrefslogtreecommitdiff
path: root/util-linux (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2024-10-081-3/+8
|\
| * hexdump: accept hex numbers in -n, closes 16195Denys Vlasenko2024-10-081-3/+8
| | | | | | | | | | | | | | function old new delta hexdump_main 366 383 +17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2024-09-281-1/+1
|\|
| * wget: fix compile warnings when WGET_FTP is not selectedDenys Vlasenko2024-09-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2024-06-231-23/+1
|\|
| * nproc: prepare for arbitrarily large CPU masksDenys Vlasenko2024-05-311-23/+1
| | | | | | | | | | | | | | | | | | | | | | function old new delta get_malloc_cpu_affinity - 76 +76 nproc_main 216 206 -10 process_pid_str 250 206 -44 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 76/-54) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2024-01-051-1/+27
|\|
| * util-linux/lsusb.c: print manufacturer/product strings if availablePeter Korsgaard2023-12-131-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just listing the vendor/product IDs is not always very helpful, so add logic to print the manufacturer and product strings similar to the "big" usbutils versions. Not all devices provide sensible strings though. The usbutils version works around this by falling back to looking up the vendor/product IDs in the hwdb and using those strings instead, which is not an option here - Instead simply trim() the strings for readability. lsusb | sort Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0bda:5539 Realtek Semiconductor Corp. Integrated_Webcam_HD Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp. 58200 Bus 001 Device 030: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP) Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 002: ID 0bda:5487 Realtek Semiconductor Corp. Dell dock Bus 006 Device 003: ID 0bda:5413 Realtek Semiconductor Corp. Dell dock Bus 006 Device 004: ID 413c:b06e Dell Computer Corp. Dell dock Bus 006 Device 005: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub Bus 006 Device 006: ID 0bda:402e Realtek Semiconductor Corp. USB Audio Bus 006 Device 007: ID 413c:1010 Dell Computer Corp. USB 2.0 Hub [MTT] Bus 006 Device 008: ID 413c:b06f Dell Computer Corp. Dell dock Bus 006 Device 009: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse Bus 006 Device 010: ID 413c:2110 Dell Computer Corp. Dell Wired Multimedia Keyboard Bus 006 Device 011: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub Bus 006 Device 012: ID 0451:3410 Texas Instruments, Inc. TUSB3410 Microcontroller Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 007 Device 002: ID 0bda:0487 Realtek Semiconductor Corp. Dell dock Bus 007 Device 003: ID 0bda:0413 Realtek Semiconductor Corp. Dell dock Bus 007 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter ./busybox lsusb | sort Bus 001 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 001 Device 002: ID 0bda:5539 CNFHH53Q0324300ACA10 Integrated_Webcam_HD Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp 58200 Bus 001 Device 030: ID 8087:0aaa Bus 002 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 003 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 004 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 005 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 dummy_hcd Dummy host controller Bus 006 Device 001: ID 1d6b:0002 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 006 Device 002: ID 0bda:5487 Dell Inc. Dell dock Bus 006 Device 003: ID 0bda:5413 Dell Inc. Dell dock Bus 006 Device 004: ID 413c:b06e Dell dock Bus 006 Device 005: ID 0451:8142 Bus 006 Device 006: ID 0bda:402e Generic USB Audio Bus 006 Device 007: ID 413c:1010 USB 2.0 Hub [MTT] Bus 006 Device 008: ID 413c:b06f Dell dock Bus 006 Device 009: ID 046d:c016 Logitech Optical USB Mouse Bus 006 Device 010: ID 413c:2110 Dell Dell Wired Multimedia Keyboard Bus 006 Device 011: ID 0451:8142 Bus 006 Device 012: ID 0451:3410 Texas Instruments TUSB3410 Boot Device Bus 007 Device 001: ID 1d6b:0003 Linux 6.1.0-13-amd64 xhci-hcd xHCI Host Controller Bus 007 Device 002: ID 0bda:0487 Dell Inc. Dell dock Bus 007 Device 003: ID 0bda:0413 Dell Inc. Dell dock Bus 007 Device 004: ID 0bda:8153 Realtek USB 10/100/1000 LAN ./scripts/bloat-o-meter busybox_unstripped{_orig,} function old new delta trim - 101 +101 fileAction 338 431 +93 add_sysfs_prop - 70 +70 open_read_close - 54 +54 read_close - 35 +35 .rodata 3268 3294 +26 ------------------------------------------------------------------------------ (add/remove: 5/0 grow/shrink: 2/0 up/down: 379/0) Total: 379 bytes Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* | Merge branch 'busybox' into mergeRon Yorston2023-08-104-44/+45
|\|
| * introduce and use exitcode_tDenys Vlasenko2023-07-173-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * hwclock: force LONG_OPTS, stop accepting non-compatible -tDenys Vlasenko2023-07-141-41/+42
| | | | | | | | | | | | | | | | | | | | function old new delta hwclock_main 576 579 +3 .rodata 105404 105349 -55 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 3/-55) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2023-07-1354-66/+144
|\|
| * hwclock: add get/set parameters optionAndrej Picej2023-07-121-5/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In kernel 5.16 special ioctls were introduced to get/set RTC parameters. Add option to get/set parameters into busybox version of hwclock. Implementation is similar to the one already used in linux-utils hwclock tool. Example of parameter get use: $ hwclock -g 2 The RTC parameter 0x2 is set to 0x2. $ hwclock --param-get bsm The RTC parameter 0x2 is set to 0x2. Example of parameter set use: $ hwclock -p 2=1 The RTC parameter 0x2 will be set to 0x1. $ hwclock -p bsm=2 The RTC parameter 0x2 will be set to 0x2. function old new delta hwclock_main 298 576 +278 .rodata 105231 105400 +169 packed_usage 34541 34576 +35 static.hwclock_longopts 60 84 +24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 506/0) Total: 506 bytes Signed-off-by: Andrej Picej <andrej.picej@norik.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update applet size estimatesDenys Vlasenko2023-07-1053-58/+58
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: code shrink: introduce and use [_]exit_FAILURE()Denys Vlasenko2023-06-152-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2023-06-162-14/+18
|\|
| * hexdump: code shrinkDenys Vlasenko2023-05-261-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta add_format - 50 +50 add_first 10 - -10 hexdump_main 401 366 -35 .rodata 105306 105255 -51 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 50/-96) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexdump, xxd: shrink stringsDenys Vlasenko2023-05-262-11/+11
| | | | | | | | | | | | | | | | | | | | function old new delta add_first 12 10 -2 .rodata 105321 105306 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-17) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2023-04-171-2/+3
|\|
| * mkfs_vfat: do not generate same volume_id when run in rapid successionDenys Vlasenko2023-04-101-2/+3
| | | | | | | | | | | | | | function old new delta mkfs_vfat_main 1502 1523 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | runuser,drop: drop runuser, tweak dropRon Yorston2023-03-191-164/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the runuser applet, leaving only drop. Move drop from util-linux to miscutils. A command of the form 'drop -c command' causes the BusyBox shell to be used, just like 'drop' without any arguments. A simple OpenSSH configuration with 'drop.exe' as DefaultShell and no DefaultShellArguments now works both for interactive login and to run a command. This is useful for older versions of OpenSSH which don't support DefaultShellArguments. Saves 208-232 bytes.
* | runuser,drop: code shrinkRon Yorston2023-03-191-13/+7
| | | | | | | | | | | | | | | | | | Make quote_arg() always return an allocated string so we can free it unconditionally. Always use argv[1] as the first part of the command string. Saves 48 bytes.
* | runuser: add 'drop' as an alias for runuserRon Yorston2023-03-161-22/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'drop' alias for 'runuser' relaxes a number of constraints that were introduced for compatibility: - It works even if the current process doesn't have elevated privileges. - It isn't necessary to specify the name of the user. - Any command can be invoked, not just the BusyBox shell. - If the command doesn't specify a path 'drop' will first look for a BusyBox applet then search PATH. Adds 320-336 when built along with runuser. (GitHub issue #240)
* | runuser: new appletRon Yorston2023-03-131-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a cut down, Windows-specific implementation of `runuser` from util-linux. This allows elevated privileges to be dropped when running in an SSH session. It also works when using `su` or starting busybox-w32 'as administrator'. There are complications: - The method used to drop privileges leaves the access token in the TokenIsElevated state. Detecting this is likely to be fragile. - The unprivileged shell is started by CreateProcessAsUserA(). In older versions of Windows this has to be loaded dynamically. Adds about 900 bytes. (GitHub issue #240)
* | win32: add support for virtual terminal inputRon Yorston2023-03-051-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alter certain applets to support virtual terminal input, if enabled. In many places this is achieved by building previously excluded upstream terminal-handling code. The busybox-w32 implementation of termios(3) functions does nothing if virtual terminal input is disabled, so it can be invoked regardless. Some applet-specific terminal-handling code is also required. This affects less, more, vi and command line editing in the shell. (The `more` applet isn't enabled in the default configuration.) This series of patches adds about 1.7KB to the binaries.
* | Merge branch 'busybox' into mergeRon Yorston2023-01-053-9/+13
|\|
| * xxd: use bb_simple_perror_msg... where appropriateDenys Vlasenko2023-01-031-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: fix use of non-initialized dataDenys Vlasenko2023-01-021-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * more: accept and ignore -eNatanael Copa2022-12-141-1/+2
| | | | | | | | | | | | | | | | Accept and ignore -e which is specified in POSIX. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: fix typo in trivial usageBrandon Maier2022-12-081-1/+1
| | | | | | | | | | Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Remove "select PLATFORM_LINUX"Denys Vlasenko2022-11-2924-28/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Fix non-Linux buildsSamuel Thibault2022-11-2924-0/+28
| | | | | | | | | | | | | | | | | | | | | | 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>
| * fbset: support setting pixel clock rateDario Binacchi2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | Only in case the FEATURE_FBSET_FANCY configuration is enabled. function old new delta fbset_main 733 766 +33 Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fbset: abort on not handled optionsDario Binacchi2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all options are actually implemented. In this case, return a message and an error code to make it clear that the requested command has not been executed. function old new delta .rodata 105200 105224 +24 fbset_main 747 733 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 24/-14) Total: 10 bytes Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | getopt: use name supplied with '-n' to report errorRon Yorston2022-11-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows: $ getopt -o a -n my_script -- -z getopt: unknown option -- z On Linux: $ getopt -o a -n my_script -- -z my_script: unknown option -- z The difference arises because the Mingw-w64 implementation of getopt(3) uses __argv[0] to report errors, not the first element of the argument array passed to it. Make __argv[0] point to the name supplied with the '-n' option to match behaviour when glibc getopt(3) is used. (GitHub issue #274)
* | xxd: avoid use of uninitialised variableRon Yorston2022-10-121-0/+4
| | | | | | | | | | | | | | If xxd is run with '-r' but no '-s' the value of opt_s passed to reverse() is uninitialised. This patch has been submitted upstream but hasn't been applied yet.
* | Merge branch 'busybox' into mergeRon Yorston2022-10-121-25/+89
|\|
| * xxd -r: handle offsetsDenys Vlasenko2022-08-221-8/+50
| | | | | | | | | | | | | | | | | | | | function old new delta xxd_main 1076 1439 +363 .rodata 105239 105251 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 375/0) Total: 375 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: without -p, stop at more than one whitespace, closes 14786Denys Vlasenko2022-08-221-17/+39
| | | | | | | | | | | | | | function old new delta xxd_main 888 1076 +188 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: it's not a part of util-linux, move to miscutilsDenys Vlasenko2022-05-021-239/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: manually inline seed_rngBernhard Reutner-Fischer2022-05-011-21/+15
| | | | | | | | | | | | | | | | | | | | We can now remove a separate buffer function old new delta seedrng_main 930 884 -46 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: shorten --help, assorted small cleanupsDenys Vlasenko2022-05-011-11/+10
| | | | | | | | | | | | | | function old new delta packed_usage 34295 34290 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: reduce MAX_SEED_LEN from 512 to 256Denys Vlasenko2022-05-011-1/+5
| | | | | | | | | | | | | | As proposed by Jason. getrandom() is more likely to block on reads larger than this. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: do not hash lengths, they are very predictableDenys Vlasenko2022-05-011-3/+5
| | | | | | | | | | | | | | function old new delta seedrng_main 982 930 -52 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: code shrinkDenys Vlasenko2022-05-011-8/+10
| | | | | | | | | | | | | | function old new delta seedrng_main 994 982 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: explain why we need locking and fsync'ingDenys Vlasenko2022-05-011-8/+18
| | | | | | | | | | | | | | | | | | | | Also, do not test for locking errors: on Linux, they do not happen. function old new delta .rodata 104900 104878 -22 seedrng_main 1022 994 -28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: remove redundant assignmentDenys Vlasenko2022-04-301-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: re-add fsync after unlink, and explain its purposeDenys Vlasenko2022-04-301-1/+12
| | | | | | | | | | | | | | function old new delta seedrng_main 1003 1022 +19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: include fiel/dir names in error messagesDenys Vlasenko2022-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | function old new delta .rodata 104898 104900 +2 seedrng_main 1011 1003 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-8) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: use more xfuncs where appropriateDenys Vlasenko2022-04-301-12/+12
| | | | | | | | | | | | | | | | function old new delta .rodata 104929 104898 -31 seedrng_main 1050 1011 -39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>