aboutsummaryrefslogtreecommitdiff
path: root/util-linux
Commit message (Collapse)AuthorAgeFilesLines
* acpid: only display -p if supported in usageGravatar Norbert Lange13 days1-1/+3
| | | | | Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nologin: make it possible to build it as single appletGravatar Denys Vlasenko2020-06-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: add HFS / HFS+ partition typeGravatar Denys Vlasenko2020-02-141-6/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove stime() function callsGravatar Alistair Francis2019-11-191-2/+6
| | | | | | | | | | | | | | | | | stime() has been deprecated in glibc 2.31 and replaced with clock_settime(). Let's replace the stime() function calls with clock_settime() in preperation. function old new delta rdate_main 197 224 +27 clock_settime - 27 +27 date_main 926 941 +15 stime 37 - -37 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: tighten the check for stride valuesGravatar Denys Vlasenko2019-11-091-2/+2
| | | | | | | function old new delta taskset_main 986 987 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: implement stride argumentGravatar Denys Vlasenko2019-11-091-5/+10
| | | | | | | function old new delta taskset_main 925 986 +61 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: update commentGravatar Denys Vlasenko2019-11-081-2/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: add support for taking/printing CPU list (-c option)Gravatar Denys Vlasenko2019-11-011-11/+118
| | | | | | | | | function old new delta taskset_main 511 855 +344 Based on patch by Fryderyk Wrobel <frd1996@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* suppress a few "unused function" warningsGravatar Denys Vlasenko2019-10-251-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk_aix: fix aliasing warning, comment out unused global variablesGravatar Denys Vlasenko2019-10-042-23/+23
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: avoid overflow in "mega/gigabytes" calculation, code shrinkGravatar Denys Vlasenko2019-10-044-34/+29
| | | | | | | function old new delta list_disk_geometry 175 145 -30 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: reduce the overhead of single parameter bb_error_msg() callsGravatar James Byrne2019-07-0228-79/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mount,losetup: use /dev/loop-control is it existsGravatar Denys Vlasenko2019-06-091-1/+7
| | | | | | | | | | | 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>
* blockdev: add usage comment, no code changesGravatar Denys Vlasenko2019-06-081-1/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: move netlink socket binding to the utility functionGravatar Denys Vlasenko2019-06-032-47/+18
| | | | | | | | | | | | function old new delta create_and_bind_to_netlink - 134 +134 ifplugd_main 1117 1052 -65 uevent_main 399 306 -93 mdev_main 314 215 -99 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 134/-257) Total: -123 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add support to run as daemonGravatar Jan Klötzke2019-06-031-17/+120
| | | | | | | | | | | | | | | | | | | | Adds the -d option to run mdev in daemon mode handling hotplug events from the kernel like udev. If the system generates many hotplug events this mode of operation will consume less resources than registering mdev as hotplug helper or using the uevent applet. function old new delta daemon_loop - 152 +152 initial_scan - 127 +127 open_mdev_log - 85 +85 mdev_main 255 314 +59 packed_usage 33284 33316 +32 process_action 1051 992 -59 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 2/1 up/down: 455/-59) Total: 396 bytes Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: use option parser helperGravatar Jan Klötzke2019-06-031-2/+9
| | | | | | | | | | | function old new delta process_action - 1051 +1051 mdev_main 1324 255 -1069 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 1051/-1069) Total: -18 bytes Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: move action processing into separate functionsGravatar Jan Klötzke2019-06-031-72/+82
| | | | | | | | This purely moves code from main() to separate functions for better extensibility. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* losetup: Add partition scanning optionGravatar Jack O'Sullivan2019-05-301-10/+17
| | | | | | | | | | | | | Add -P option from util-linux losetup to scan for partitions. function old new delta losetup_main 449 482 +33 packed_usage 33264 33292 +28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0) Total: 61 bytes Signed-off-by: Jack O'Sullivan <jackos1998@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* losetup: implement -cGravatar Denys Vlasenko2019-05-231-10/+22
| | | | | | | | | | | function old new delta losetup_main 422 449 +27 packed_usage 33243 33264 +21 get_next_block 1677 1681 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 52/0) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* style fix, no code changesGravatar Denys Vlasenko2019-05-141-1/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chrt: fix for SCHED_RESET_ON_FORK bitGravatar Denys Vlasenko2019-04-051-0/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chrt: do not segfault if policy number is unknownGravatar Denys Vlasenko2019-04-051-28/+34
| | | | | | | | | | | | | | | | | | While at it, improve help text function old new delta packed_usage 33319 33344 +25 policy_name - 22 +22 show_min_max 59 64 +5 chrt_main 432 429 -3 policies 72 - -72 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/1 up/down: 52/-75) Total: -23 bytes text data bss dec hex filename 982150 485 7296 989931 f1aeb busybox_old 982183 485 7296 989964 f1b0c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* blockdev: code shrinkGravatar Denys Vlasenko2019-03-301-81/+58
| | | | | | | | | | | | | | | | function old new delta bdcmd_names - 82 +82 bdcmd_ioctl - 44 +44 bdcmd_flags - 11 +11 blockdev_main 273 258 -15 bdcommands 176 - -176 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 0/1 up/down: 137/-191) Total: -54 bytes text data bss dec hex filename 982326 485 7296 990107 f1b9b busybox_old 982272 485 7296 990053 f1b65 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix off by one error in FAT16 <=> FAT32 detectionGravatar Thomas Frauendorfer2019-03-151-1/+1
| | | | | | | | | | | cluster_count is compared against FAT16_MAX, which is defined as 0xfff4 That is the maximum number of cluster a FAT16 can have. For reference also check the hardware whitepaper from Microsoft FAT: General Overview of On-Disk Format, version 1.03 page 15 Signed-off-by: Thomas Frauendorfer <tf@miray.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: add size information for three more appletsGravatar Denys Vlasenko2018-12-282-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: update size informationGravatar Denys Vlasenko2018-12-2853-60/+60
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: suppress aliasing warningGravatar Denys Vlasenko2018-12-081-1/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: allow hush to run embedded scriptsGravatar Ron Yorston2018-11-271-1/+1
| | | | | | | | | | | | | Embedded scripts require a shell to be present in the BusyBox binary. Allow either ash or hush to be used for this purpose. If both are enabled ash takes precedence. The size of the binary is unchanged in the default configuration: both ash and hush are present but support for embedded scripts isn't compiled into hush. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* docs: add embedded-scripts.txtGravatar Ron Yorston2018-11-271-1/+1
| | | | | Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Treat custom and applet scripts as appletsGravatar Ron Yorston2018-11-171-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BusyBox has support for embedded shell scripts. Two types can be distinguished: custom scripts and scripts implementing applets. Custom scripts should be placed in the 'embed' directory at build time. They are given a default applet configuration and appear as applets to the user but no further configuration is possible. Applet scripts are integrated with the BusyBox build system and are intended to be used to ship standard applets that just happen to be implemented as scripts. They can be configured at build time and appear just like native applets. Such scripts should be placed in the 'applets_sh' directory. A stub C program should be written to provide the usual applet configuration details and placed in a suitable subsystem directory. It may be helpful to have a configuration option to enable any dependencies the script requires: see the 'nologin' applet for an example. function old new delta scripted_main - 41 +41 applet_names 2773 2781 +8 applet_main 1600 1604 +4 i2cdetect_main 672 674 +2 applet_suid 100 101 +1 applet_install_loc 200 201 +1 applet_flags 100 101 +1 packed_usage 33180 33179 -1 tryexec 159 152 -7 evalcommand 1661 1653 -8 script_names 9 - -9 packed_scripts 123 114 -9 complete_cmd_dir_file 826 811 -15 shellexec 271 254 -17 find_command 1007 990 -17 busybox_main 642 624 -18 run_applet_and_exit 100 78 -22 find_script_by_name 51 - -51 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 6/9 up/down: 58/-174) Total: -116 bytes text data bss dec hex filename 950034 477 7296 957807 e9d6f busybox_old 949918 477 7296 957691 e9cfb busybox_unstripped Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unzip: use printable_string() for printing filenamesGravatar Denys Vlasenko2018-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | function old new delta unzip_main 2726 2792 +66 printable_string2 - 57 +57 identify 4329 4336 +7 expmeta 659 663 +4 add_interface 99 103 +4 beep_main 286 289 +3 changepath 192 194 +2 builtin_type 115 117 +2 devmem_main 469 470 +1 input_tab 1076 1074 -2 create_J 1821 1819 -2 poplocalvars 314 311 -3 doCommands 2222 2214 -8 do_load 918 902 -16 printable_string 57 9 -48 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 8/6 up/down: 146/-79) Total: 67 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move storage helpers to libbb.hGravatar Denys Vlasenko2018-09-283-46/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: code shrinkGravatar Denys Vlasenko2018-07-251-5/+27
| | | | | | | | | | function old new delta get_nonexisting_partition 119 104 -15 fdisk_main 2640 2622 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-33) Total: -33 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: sync up with some util-linux 2.31 behaviorGravatar Denys Vlasenko2018-07-253-48/+46
| | | | | | | | | | | | | | | | | = display default is no longer in cylinders = +sizeC is no longer supported = add +sizeT suffix - terabytes are here = K,M,G,T and k,m,g,t suffixes all are binary, not decimal = +sizeM results in last sector +(size * 1Mbyte - 1), not +(size * 1Mbyte) = fix comparison to "YES" answer for sgi/sun function old new delta read_int 492 519 +27 fdisk_main 2644 2640 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 27/-4) Total: 23 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: use strtoul[l] instead of atoi, closes 11176Gravatar Denys Vlasenko2018-07-252-4/+7
| | | | | | | Couldn't create partitions bigger than 1TB (when using 512 bytes sectors, on 32 bits architectures). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesGravatar Denys Vlasenko2018-07-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: placate warning of strncpy not copying NUL byteGravatar Denys Vlasenko2018-06-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesGravatar Denys Vlasenko2018-06-261-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* restore documentation on the build config languageGravatar Kartik Agaram2018-06-062-2/+2
| | | | | | | | | | Kconfig-language.txt was deleted in commit 4fa499a17b52b back in 2006. Move to docs/ as suggested by Xabier Oneca: http://lists.busybox.net/pipermail/busybox/2014-May/080914.html Also update references to it everywhere. Signed-off-by: Kartik Agaram <akkartik@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: remove "Partition N does not end on cylinder boundary" messageGravatar Denys Vlasenko2018-05-261-6/+0
| | | | | | | | | fdisk from util-linux 2.31 (maybe earlier) does not print this. function old new delta check_consistency 449 399 -50 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nsenter: fix parsing of -t, -S and -G optionsGravatar Euan Harris2018-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -t, -S and -G each take mandatory integer arguments. getopt32long()'s option string syntax for this type of argument is 'c:+', however nsenter's opt_str uses 'c+', which specifies two options 'c' and '+' which do not take arguments. This means that giving a target PID causes nsenter to exit and print the usage string: # nsenter -t1 sh nsenter: unrecognized option: 1 BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary. ... The long form options are also broken: # nsenter --setuid=1000 --setgid=1000 sh BusyBox v1.29.0.git (2018-05-04 13:56:49 UTC) multi-call binary. ... `nsenter --target=<pid> sh` parses correctly and appears to work, but <pid> is ignored and set to 0. This doesn't raise an error unless one of the namespace arguments is also given: # ./busybox_unstripped nsenter --target=42 sh # exit # ./busybox_unstripped nsenter -n --target=42 sh BusyBox v1.29.0.git (2018-05-04 13:56:49 UTC) multi-call binary. ... This has caused problems in a couple of places: https://github.com/linuxkit/linuxkit/issues/567 https://github.com/gliderlabs/docker-alpine/issues/359 https://github.com/kontena/pharos-cluster/pull/81 Signed-off-by: Euan Harris <euan.harris@docker.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nsenter: Rename --network option to --netGravatar Euan Harris2018-05-131-1/+1
| | | | | | | | | | | | | | In nsenter from util-linux, the long version of the -n option is --net=<path>. BusyBox's version expects --network=<path>, so scripts and examples written for util-linux's version cause BusyBox's version to exit with the usage message. Confusingly, until commit 036585a911a5f, the usage message erroneously claimed that the long option was indeed called --net; after that commit long options are not listed at all. Signed-off-by: Euan Harris <euan.harris@docker.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: new option FEATURE_ETC_SERVICES: if off, /etc/services reads often ↵Gravatar Denys Vlasenko2018-04-171-1/+1
| | | | | | | | | | | | | | | | | | | avoided In practice, "wget http://host.com/" always uses port 80. People explicitly set non-standard ports via options or parameters ("telnet 1.2.3.4 567" or "telnet 1.2.3.4 ftp") instead of modifying /etc/services. function old new delta telnet_main 1466 1464 -2 rdate_main 215 198 -17 fakeidentd_main 269 252 -17 parse_url 459 392 -67 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103) Total: -103 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb.h: always include sys/resource.hGravatar Denys Vlasenko2018-04-081-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fstrim: do not check that specified file is on a block deviceGravatar Denys Vlasenko2018-03-291-3/+11
| | | | | | | | | Kernel will surely inform us in FITRIM does not make sense on a given file. function old new delta fstrim_main 241 221 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* readprofile: code shrinkGravatar Denys Vlasenko2018-03-111-34/+33
| | | | | | | | | | | | | | function old new delta defaultpro 14 - -14 defaultmap 17 - -17 readprofile_main 1762 1719 -43 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/1 up/down: 0/-74) Total: -74 bytes text data bss dec hex filename 933081 473 6836 940390 e5966 busybox_old 933035 473 6836 940344 e5938 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ipcs: further code shrinkGravatar Denys Vlasenko2018-03-081-24/+23
| | | | | | | | | | function old new delta packed_usage 32543 32547 +4 ipcs_main 1014 980 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-34) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ipcs: code shrinkGravatar Denys Vlasenko2018-03-081-24/+15
| | | | | | | | | | | | | | function old new delta packed_usage 32539 32543 +4 format 1 - -1 do_shm 883 880 -3 do_sem 636 633 -3 do_msg 782 779 -3 ipcs_main 1049 1014 -35 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/4 up/down: 4/-45) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: compile capability code only if FEATURE_SETPRIV_CAPABILITIES or RUN_INITGravatar Denys Vlasenko2018-02-211-0/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>