aboutsummaryrefslogtreecommitdiff
path: root/util-linux
AgeCommit message (Collapse)Author
2016-11-23Convert all util-linux/* applets to "new style" applet definitionsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-16Make mkfs.vfat and mkdosfs individually selectableDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-16Make mke2fs and mkfs.ext2 individually selectableDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-14Make swapon and swapoff individually selectable.Denys Vlasenko
For example, without swapoff, code shrinks by 277 bytes. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-11-13Make setarch/linux32/linux64 independently selectableDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-11more: accept and ignore a bunch of optionsDenys Vlasenko
Alpine Linux stumbled over "more -s": http://bugs.alpinelinux.org/issues/5190 function old new delta more_main 857 872 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-27mount: for cifs, dont insert "ip=ADDR" option if user gave it explicitlyDenys Vlasenko
This makes it possible to use scoped IPv6 addresses: mount -t cifs -o ip=<ADDR>%<iface_id> //<ADDR>/test test Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-26mount: tweak "IPv6 scoped addr" commitDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-26libbb: make xmalloc_sockaddr2dotted use NI_NUMERICSCOPEDenys Vlasenko
Gives "mount -t cifs //fe80::6a05:caff:fe3e:dbf5%eth0/test test" a chance to work: mount must pass "ip=numeric_IPv6%numeric_iface_id" in the omunt option string. Currently, it does not. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-17fdisk: fix CONFIG_FEATURE_SUN_LABEL=y buildDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-07mdev: create devices from /sys/devDenys Vlasenko
Currently some new devices that have a bus but no class will be missed by mdev coldplug device creation after boot. This happens because mdev recursively searches /sys/class which will by definition only find class devices. Some important devices such as iio and gpiochip does not have a class. But users will need them. This switches from using /sys/class as the place to look for devices to create to using /sys/dev where all char and block devices are listed. The subsystem lookup code that provide the G.subsystem environment variable is changed from using the directory name of the class device to instead dereference the "subsystem" symlink for the device, and look at the last element of the path of the symlink for the subsystem, which will work with class devices and bus devices alike. (The new bus-only devices only symlink to the /sys/bus/* hierarchy.) We delete the legacy kernel v2.6.2x /sys/block device path code as part of this change. It's too old to be kept alive. Tested on kernel v4.6-rc2 with a bunch of devices, including some IIO and gpiochip devices. With a print inserted before make_device() the log looks like so: Create device from "/sys/dev/char/1:1", subsystem "mem" Create device from "/sys/dev/char/1:2", subsystem "mem" Create device from "/sys/dev/char/1:3", subsystem "mem" Create device from "/sys/dev/char/1:5", subsystem "mem" (...) Create device from "/sys/dev/block/179:56", subsystem "block" Create device from "/sys/dev/block/179:64", subsystem "block" function old new delta mdev_main 1388 1346 -42 dirAction 134 14 -120 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-162) Total: -162 bytes Cc: Isaac Dunham <ibid.ag@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-06volume_id: Add support for UBIFSSerj Kalichev
Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-23fdisk: tweak some messagesDenys Vlasenko
"Total allocated sectors 2021315 greater than the maximum 2020356" maximum what? Turns out, that's the CHS size of the disk. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-23fdisk: print much less cryptic partition tableDenys Vlasenko
Before: Device Boot Start End Blocks Id System /dev/sdb1 * 1 998 255471+ 6 FAT16 What are "blocks"? What is that "+"? How big is this partition? Is start/end shown came from LBA fields or CHS fields? Why are we torturing the user?? After: Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/sdb1 * 0,1,1 996,15,32 32 510974 510943 249M 6 FAT16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-22unshare: --network should be --net. Closes 9116Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-07-06getopt32: add new syntax of 'o:+' and 'o:*' for -o NUM and -o LISTDenys Vlasenko
In many cases, this aqllows to drop use of opt_complementary. Approximately -400 bytes: function old new delta getopt32 1423 1502 +79 opt_string 17 18 +1 OPT_STR 24 25 +1 uniq_main 416 406 -10 timeout_main 279 269 -10 sulogin_main 270 260 -10 readprofile_main 1825 1815 -10 ps_main 543 533 -10 pidof_main 245 235 -10 pgrep_main 611 601 -10 od_main 2600 2590 -10 mkfs_minix_main 2684 2674 -10 mkfs_ext2_main 2603 2593 -10 microcom_main 712 702 -10 makemime_main 315 305 -10 ionice_main 282 272 -10 inetd_main 2074 2064 -10 ifplugd_main 1144 1134 -10 halt_main 353 343 -10 getopt_main 636 626 -10 fdisk_main 2854 2844 -10 env_main 206 196 -10 dmesg_main 319 309 -10 conspy_main 1214 1204 -10 awk_main 981 971 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/22 up/down: 81/-220) Total: -139 bytes text data bss dec hex filename 919373 906 14060 934339 e41c3 busybox_old 918969 906 14060 933935 e402f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-06-20randomconfig fixes 5: false positive for tar; mount emits corrupted messageDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-06-19randomconfig fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-24flock: merge spawn_and_wait() code patchs for -c and sans-c usesDenys Vlasenko
function old new delta flock_main 334 319 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-24flock: fix -c; improve error handling of fork+execDenys Vlasenko
function old new delta flock_main 254 334 +80 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-22*: slap on a few ALIGN1/2s where appropriateDenys Vlasenko
The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" text data bss dec hex filename 829901 4086 1904 835891 cc133 busybox_before 829665 4086 1904 835655 cc047 busybox Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21*: hopefully all setup_common_bufsiz() are in placeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21*: add most of the required setup_common_bufsiz() callsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-21libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko
The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-02nsenter,unshare: work around older headerDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-02nsenter,unshare: share common code; fix a bug of not closing all fdsDenys Vlasenko
function old new delta xvfork_parent_waits_and_exits - 64 +64 exec_prog_or_SHELL - 39 +39 unshare_main 873 810 -63 nsenter_main 663 596 -67 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 106/-130) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-02unshare: remove stale commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-01nsenter: new appletBartosz Golaszewski
function old new delta nsenter_main - 663 +663 .rodata 155147 155612 +465 packed_usage 30536 30708 +172 nsenter_longopts - 116 +116 open_by_path_or_target - 58 +58 applet_names 2518 2526 +8 applet_main 2920 2928 +8 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 4/0 up/down: 1490/0) Total: 1490 bytes text data bss dec hex filename 827956 4078 9080 841114 cd59a busybox_old 829214 4086 9080 842380 cda8c busybox_unstripped Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-01libbb: two new functions: wait_for_exitstatus(pid), xfchdir(fd)Denys Vlasenko
Bartosz Golaszewski proposed xfchdir() Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-04-01unshare: new appletBartosz Golaszewski
function old new delta unshare_main - 873 +873 .rodata 154444 155131 +687 packed_usage 30329 30520 +191 unshare_longopts - 106 +106 mount_namespaces - 99 +99 mount_or_die - 51 +51 ns_list - 48 +48 wait_for_exitstatus - 41 +41 opt_str - 17 +17 applet_names 2510 2518 +8 applet_main 2912 2920 +8 applet_suid 91 92 +1 applet_install_loc 182 183 +1 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 6/0 up/down: 2131/0) Total: 2131 bytes text data bss dec hex filename 826110 4070 9080 839260 cce5c busybox_old 827961 4078 9080 841119 cd59f busybox_unstripped Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-30mkfs_vfat: use bb_error_msg for logging, not bb_info_msgDenys Vlasenko
This affects only a commented-out code section which searches for bad blocks Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-30Replace a few more bb_info_msg's by bb_error_msg or printfDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-30Use bb_error_msg instead of bb_info_msg in all commented-out debug printoutsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-28umount: build fix for older glibcDenys Vlasenko
Based on a patch by Veli-Pekka Peltola <veli-pekka.peltola@ray.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-03-14more bionic fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-01-02blkdiscard: new appletAri Sundholm
function old new delta blkdiscard_main - 264 +264 Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-12-30mount: support "nofail" option. Closes 8551Denys Vlasenko
function old new delta singlemount 1045 1060 +15 mount_option_str 338 345 +7 mount_it_now 355 361 +6 mount_options 172 176 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 32/0) Total: 32 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-12-18swaponoff: fix compile-time warningDenys Vlasenko
CC util-linux/swaponoff.o cc1: warnings being treated as errors util-linux/swaponoff.c: In function 'swap_enable_disable': util-linux/swaponoff.c:100: warning: passing argument 1 of 'resolve_mount_spec' from incompatible pointer type make[1]: *** [util-linux/swaponoff.o] Error 1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-12-16blkid: add bcache supportMike Frysinger
URL: https://bugs.gentoo.org/508596 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2015-12-16swapon/swapoff: refine the -e (ifexists) optionMike Frysinger
The -e option should only apply to swapon, and it should swallow all errors/warnings when the device does not exist. So delete the flag from the swapoff patch and unify the check in the swapoff path. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2015-10-19setarch: add support for '-R' (disable randomization)Denys Vlasenko
This commit adds support for the -R flag of setarch, which disables randomization of the virtual address space. function old new delta setarch_main 115 150 +35 packed_usage 30664 30651 -13 Signed-off-by: Jan Heylen <heyleke@gmail.com> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-19libbb: get_uidgid() always called with allow_numeric=1Denys Vlasenko
function old new delta xget_uidgid 30 25 -5 make_device 2188 2183 -5 main 797 792 -5 get_uidgid 240 225 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-13libbb: introduce kernel-style BUILD_BUG_ON()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-13typo fix in commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-08join some common strings, -400 bytesDenys Vlasenko
function old new delta print_intel_cstates 499 511 +12 file_insert 355 364 +9 dpkg_main 2944 2940 -4 ifenslave_main 645 640 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9) Total: 12 bytes text data bss dec hex filename 937564 932 17676 956172 e970c busybox_old 937164 932 17676 955772 e957c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-07build system: -fno-builtin-printfDenys Vlasenko
Benefits are: drops reference to out-of-line putchar(), fixes a few cases of failed string merge. function old new delta i2cdump_main 1488 1502 +14 sha256_process_block64 423 433 +10 sendmail_main 1183 1185 +2 list_table 1114 1116 +2 i2cdetect_main 1235 1237 +2 fdisk_main 2852 2854 +2 builtin_type 119 121 +2 unicode_conv_to_printable2 325 324 -1 scan_recursive 380 378 -2 mkfs_minix_main 2687 2684 -3 buffer_fill_and_print 178 169 -9 putchar 152 - -152 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167) Total: -133 bytes text data bss dec hex filename 937788 932 17676 956396 e97ec busybox_old 937564 932 17676 956172 e970c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-07libbb: more compact API for bb_parse_mode()Denys Vlasenko
function old new delta make_device 2182 2188 +6 parse_command 1440 1443 +3 parse_params 1497 1499 +2 install_main 773 769 -4 mkdir_main 168 160 -8 getoptscmd 641 632 -9 builtin_umask 158 147 -11 bb_parse_mode 431 410 -21 umaskcmd 286 258 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/6 up/down: 11/-81) Total: -70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-01umount: always use umount2 syscall with specified flagsDenys Vlasenko
Make umount -f more compatible with util-linux 2.22.2. Before: * 'umount -f': calls umount syscall, if it fails calls umount2 with 'MNT_FORCE' * 'mount -f -l': calls umount syscall, if it fails calls umount2 with 'MNT_LAZY'. 'MNT_FORCE' dropped After: * 'umount -f': calls umount2 syscall with 'MNT_FORCE' * 'mount -f -l': calls umount2 syscall with 'MNT_LAZY' and 'MNT_FORCE' function old new delta umount 45 - -45 umount_main 610 555 -55 Signed-off-by: Anton Bondarenko <anton.bondarenko@axis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-08-24dmesg: add -r option to print raw format even when FEATURE_DMESG_PRETTY is ↵Peter Korsgaard
enabled Similar to the "big" util-linux version. For !DMESG_PRETTY, the option is accepted (but ignored) as well, for compatibility reasons. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-08-24libbb: add setsockopt_foo helpersDenys Vlasenko
function old new delta setsockopt_int - 23 +23 do_load 918 934 +16 setsockopt_SOL_SOCKET_int - 14 +14 setsockopt_keepalive - 10 +10 setsockopt_SOL_SOCKET_1 - 10 +10 buffer_fill_and_print 169 178 +9 setsockopt_1 - 8 +8 nfsmount 3560 3566 +6 redirect 1277 1282 +5 tcpudpsvd_main 1782 1786 +4 d6_send_kernel_packet 272 275 +3 i2cget_main 380 382 +2 ed_main 2544 2545 +1 scan_recursive 380 378 -2 nbdclient_main 492 490 -2 hash_find 235 233 -2 cmdputs 334 332 -2 parse_command 1443 1440 -3 static.two 4 - -4 ntpd_main 1039 1035 -4 const_int_1 4 - -4 const_IPTOS_LOWDELAY 4 - -4 RCVBUF 4 - -4 ntp_init 474 469 -5 change_listen_mode 316 310 -6 uevent_main 416 409 -7 arping_main 1697 1690 -7 telnet_main 1612 1603 -9 socket_want_pktinfo 42 33 -9 setsockopt_reuseaddr 21 10 -11 setsockopt_broadcast 21 10 -11 httpd_main 772 757 -15 get_remote_transfer_fd 109 94 -15 make_new_session 503 487 -16 ftpd_main 2177 2160 -17 read_bunzip 1896 1866 -30 common_traceroute_main 4099 4058 -41 common_ping_main 1836 1783 -53 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 8/21 up/down: 111/-283) Total: -172 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>