aboutsummaryrefslogtreecommitdiff
path: root/util-linux (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: indentation fixDenys Vlasenko2021-08-161-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: disallow "taskset -p 0"Denys Vlasenko2021-08-151-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fdisk: commonalize stringsDenys Vlasenko2021-06-251-2/+2
| | | | | | | function old new delta .rodata 103674 103667 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* xxd: compat tweak for -iDenys Vlasenko2021-06-251-6/+9
| | | | | | | | | | function old new delta xxd_main 888 893 +5 .rodata 103669 103674 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 10/0) Total: 10 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* switch_root: code shrink - use iterate_on_dir()Denys Vlasenko2021-06-241-21/+14
| | | | | | | | | | function old new delta rmrf - 46 +46 delete_contents 181 99 -82 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 46/-82) Total: -36 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: use iterate_on_dir()Denys Vlasenko2021-06-241-18/+17
| | | | | | | | | | | function old new delta iter - 27 +27 process_pid_str 854 856 +2 taskset_main 181 135 -46 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 29/-46) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: fix for PID longer than 12 charsDenys Vlasenko2021-06-201-2/+3
| | | | | | | | | | | | Should we validate that PID is a number for "taskset -ap PID"? We don't actually need it, and pathological input like "../../DIR_WITH_LOTS_OF_PIDS" can only cause "taskset"ing of many pids. Which is something user can do anyway. function old new delta taskset_main 190 181 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* taskset: implement -aDenys Vlasenko2021-06-191-39/+69
| | | | | | | | | | | | function old new delta process_pid_str - 854 +854 .rodata 103363 103378 +15 packed_usage 33654 33658 +4 taskset_main 936 190 -746 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 873/-746) Total: 127 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* xxd: implement -i "C style output"Denys Vlasenko2021-06-181-11/+38
| | | | | | | | | | | | | function old new delta xxd_main 710 888 +178 .rodata 103252 103331 +79 print_C_style - 78 +78 packed_usage 33639 33652 +13 next 276 278 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 350/0) Total: 350 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* xxd: implement -o DISPLAYOFFSETDenys Vlasenko2021-06-171-5/+14
| | | | | | | | | | | | | | function old new delta xxd_main 680 710 +30 xstrtoll - 30 +30 bb_dump_dump 1511 1531 +20 rewrite 941 951 +10 packed_usage 33629 33639 +10 .rodata 103250 103252 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/0 up/down: 102/0) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ionice: implement -tDenys Vlasenko2021-06-171-7/+10
| | | | | | | | | | | function old new delta packed_usage 33618 33629 +11 ionice_main 272 282 +10 .rodata 103250 103251 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* blockdev: support --get/setraDenys Vlasenko2021-06-161-5/+23
| | | | | | | | | | | | | function old new delta blockdev_main 251 263 +12 bdcmd_names 82 94 +12 packed_usage 33534 33542 +8 bdcmd_ioctl 44 52 +8 bdcmd_flags 11 13 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 42/0) Total: 42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more --help tweaksDenys Vlasenko2021-06-151-1/+1
| | | | | | | function old new delta packed_usage 33552 33541 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: --help tweaksDenys Vlasenko2021-06-142-2/+3
| | | | | | | function old new delta packed_usage 33589 33552 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more --help tweakingDenys Vlasenko2021-06-133-7/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use fputs_stdoutRon Yorston2021-02-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta fputs_stdout - 12 +12 zxc_vm_process 7237 7230 -7 yes_main 85 78 -7 write_block 380 373 -7 wrapf 305 298 -7 strings_main 437 430 -7 show_bridge 353 346 -7 rev_main 384 377 -7 put_prompt_custom 58 51 -7 put_cur_glyph_and_inc_cursor 168 161 -7 print_numbered_lines 152 145 -7 print_named_ascii 130 123 -7 print_name 135 128 -7 print_login_issue 386 379 -7 print_ascii 208 201 -7 powertop_main 1249 1242 -7 od_main 1789 1782 -7 logread_main 518 511 -7 head_main 804 797 -7 display_process_list 1319 1312 -7 cut_main 1002 995 -7 bb_dump_dump 1550 1543 -7 bb_ask_noecho 393 386 -7 baseNUM_main 702 695 -7 expand_main 755 745 -10 dumpleases_main 497 487 -10 write1 12 - -12 putcsi 37 23 -14 print_login_prompt 55 41 -14 paste_main 525 511 -14 cat_main 440 426 -14 print_it 245 230 -15 print_addrinfo 1188 1171 -17 print_rule 770 750 -20 print_linkinfo 842 822 -20 httpd_main 791 771 -20 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/34 up/down: 12/-341) Total: -329 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use xgettimeofday(), do not truncate 64-bit time_t in ↵Denys Vlasenko2020-12-303-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | shells function old new delta xgettimeofday - 11 +11 get_local_var_value 280 281 +1 svlogd_main 1323 1322 -1 change_epoch 67 66 -1 timestamp_and_log 461 458 -3 hwclock_main 301 298 -3 fmt_time_bernstein_25 135 132 -3 step_time 331 326 -5 script_main 1207 1202 -5 machtime 34 28 -6 curtime 61 54 -7 ts_main 423 415 -8 nmeter_main 761 751 -10 gettime1900d 67 46 -21 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/12 up/down: 12/-73) Total: -61 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2020-12-291-2/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: Surround syslog.h with the config checkLauri Kasanen2020-12-251-0/+2
| | | | | | | | This lets bb mount build for limited targets without syslog.h, as long as the parts using it like NFS are disabled. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* help text tweaksDenys Vlasenko2020-12-186-11/+11
| | | | | | | function old new delta packed_usage 33570 33502 -68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move ADJTIME_PATH define to header filesDenys Vlasenko2020-12-172-10/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use xsettimeofday()Denys Vlasenko2020-12-162-8/+5
| | | | | | | | | | | | | | | function old new delta xsettimeofday - 25 +25 rdate_main 274 260 -14 step_time 348 331 -17 set_kernel_timezone_and_clock 119 102 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 25/-48) Total: -23 bytes text data bss dec hex filename 1020753 559 5052 1026364 fa93c busybox_old 1020708 559 5052 1026319 fa90f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hwclock: improve --help (-l is a compatible shortcut for --localtime)Denys Vlasenko2020-12-161-19/+50
| | | | | | | function old new delta packed_usage 33605 33568 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hwclock: fix musl breakage of settimeofday(tz)Denys Vlasenko2020-12-161-53/+75
| | | | | | | | | | | function old new delta set_kernel_timezone_and_clock - 119 +119 set_kernel_tz - 28 +28 hwclock_main 480 301 -179 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 147/-179) Total: -32 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak help textsDenys Vlasenko2020-12-162-18/+11
| | | | | | | function old new delta packed_usage 33650 33605 -45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: add and use infrastructure for fixed page size optimizationDenys Vlasenko2020-12-141-1/+1
| | | | | | | | | | | | | | | function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: create and use mmap() helpersDenys Vlasenko2020-12-141-6/+1
| | | | | | | | | | | | | | function old new delta mmap_anon - 22 +22 mmap_read - 21 +21 xmmap_anon - 16 +16 rpm_gettags 465 447 -18 bb_full_fd_action 498 480 -18 uevent_main 337 310 -27 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* help text: replace [OPTIONS] with actual options (if not too long)Denys Vlasenko2020-12-132-12/+4
| | | | | | | function old new delta packed_usage 33620 33665 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* more --help text tweaksDenys Vlasenko2020-12-132-3/+2
| | | | | | | function old new delta packed_usage 33545 33581 +36 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nsenter: stop option parsing on 1st non-optionDenys Vlasenko2020-12-121-1/+2
| | | | | | "nsenter ls -l" gives: invalid option -- 'l' Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: fix incorrect "success" exitcode if loop device setup failsDenys Vlasenko2020-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | When mounting, in parallel, multiple loop devices (squashfs for the submitter's case), the following behavior can be observed: stat64(/path/to/image, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0 openat(AT_FDCWD, /path/to/image, O_RDWR|O_LARGEFILE) = 3 openat(AT_FDCWD, /dev/loop-control, O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4 ioctl(4, LOOP_CTL_GET_FREE) = 12 close(4) = 0 openat(AT_FDCWD, /dev/loop12, O_RDWR|O_LARGEFILE) = 4 ioctl(4, LOOP_GET_STATUS64, {lo_offset=0, lo_number=12, lo_flags=LO_FLAGS_AUTOCLEAR, lo_file_name=/path/to/image, ...}) = 0 close(4) = 0 close(3) = 0 write(2, "mount: can't setup loop device\n", 31mount: can't setup loop device ) = 31 exit_group(0) = ? +++ exited with 0 +++ The ioctl LOOP_CTL_GET_FREE has resulted in the same result for a competing mount process. The subsequent ioctl LOOP_GET_STATUS64 fails, having succeeded for the competing mount process. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: implement -o nosymfollow, remove bogus -o unionDenys Vlasenko2020-12-061-4/+4
| | | | | | | | | | | | The (1 << 8) MS_ flag is MS_NOSYMFOLLOW, not MS_UNION. As far as I see in git history of kernel and util-linux, MS_UNION did not ever exist. Why did it appear in our tree in 2009?... function old new delta mount_option_str 379 385 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: add -o nostrictatime and -o [no]lazytimeDenys Vlasenko2020-12-061-24/+34
| | | | | | | | | | function old new delta mount_option_str 345 379 +34 mount_options 176 188 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 46/0) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: do not guess mount as NFS if "hostname:" contains slashesDenys Vlasenko2020-12-051-7/+11
| | | | | | | function old new delta singlemount 1273 1295 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: do not guess bind mounts as nfsDenys Vlasenko2020-12-021-0/+1
| | | | | | | | | | | | Fails as follows: $ mount -o bind /dev/disk/by-path/pci-0000:13:00.0-scsi-0:0:3:0 /dir mount: bad address '/dev/disk/by-path/pci-0000' function old new delta singlemount 1256 1273 +17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: make filesystems[] array byte-alignedDenys Vlasenko2020-11-301-1/+1
| | | | | | | | text data bss dec hex filename 1021120 559 5052 1026731 faaab busybox_old 1021092 559 5052 1026703 faa8f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* decrease padding: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-301-1/+1
| | | | | | | | text data bss dec hex filename 1021236 559 5052 1026847 fab1f busybox_old 1021120 559 5052 1026731 faaab busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-309-15/+15
| | | | | | | | text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use sleep1()Denys Vlasenko2020-11-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | function old new delta sleep1 - 9 +9 run_shutdown_and_kill_processes 97 95 -2 restore_state_and_exit 116 114 -2 reread_partition_table 67 65 -2 flush_buffer_cache 80 78 -2 chat_main 1302 1300 -2 timeout_main 310 307 -3 telnet_main 1235 1232 -3 stop_handler 86 83 -3 process_action 1078 1075 -3 nbdclient_main 1185 1182 -3 init_main 789 786 -3 getty_main 1541 1538 -3 do_time 410 407 -3 runsv_main 1682 1677 -5 pause_and_low_level_reboot 59 54 -5 inetd_main 1917 1911 -6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/16 up/down: 9/-50) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: clear LOGMODE_STDIO only directly before daemonizingDenys Vlasenko2020-11-221-10/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uevent: make it survive ENOBUFSDenys Vlasenko2020-11-221-13/+22
| | | | | | | function old new delta uevent_main 285 337 +52 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: clean upDenys Vlasenko2020-11-221-10/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add -v to increase log verbosityJan Klötzke2020-11-221-3/+8
| | | | | | | | | | If logging to stderr and/or syslog the -v option can be given one or more times to increase the log verbosity. If mdev is used as hotplug helper the log level is fixed set to 2 if mdev.log is found an appended because there is no possiblity to pass arguments to the hotplug helper. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: add syslog logging modeJan Klötzke2020-11-221-6/+18
| | | | | | | | | | | | If mdev is run as daemon it should be possible to forward the debug messages to syslog. This feature might be useful if mdev is run with -s during boot too. OTOH it makes no sense for the daemon to log to mdev.log. This can be handled by a syslog daemon way better. If the daemon stays in the foreground due to -f, the messages are still written to stderr as before. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: re-initialize if uevent messages were lostJan Klötzke2020-11-221-0/+10
| | | | | | | | | | If the netlink read() failed with ENOBUFS we know that we have missed at least one message due to a socket receive buffer overrun. The only way how to recover is to drop the old socket, open a fresh one and make a cold-plug scan of the current system state. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: move daemon setup to dedicated functionJan Klötzke2020-11-221-17/+27
| | | | | Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uevent: increase netlink buffer sizesDenys Vlasenko2020-11-221-10/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mdev: increase netlink buffer sizesJan Klötzke2020-11-221-9/+17
| | | | | | | | | | The socket receive buffer turned out to be too small for real world systems. Use the same size as udevd to be on the safe side. As this is just a limit and the memory is not allocated by the kernel until really needed there is actually no memory wasted. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* volume_id: improve struct layout (smaller offesets, smaller insns on x86)Denys Vlasenko2020-11-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta volume_id_probe_xfs 101 98 -3 volume_id_probe_vfat 827 824 -3 volume_id_probe_udf 541 538 -3 volume_id_probe_ubifs 67 64 -3 volume_id_probe_squashfs 86 83 -3 volume_id_probe_romfs 97 94 -3 volume_id_probe_reiserfs 246 243 -3 volume_id_probe_ocfs2 110 107 -3 volume_id_probe_ntfs 288 285 -3 volume_id_probe_nilfs 100 97 -3 volume_id_probe_minix 85 82 -3 volume_id_probe_luks 92 89 -3 volume_id_probe_linux_swap 251 248 -3 volume_id_probe_linux_raid 131 128 -3 volume_id_probe_lfs 62 59 -3 volume_id_probe_jfs 110 107 -3 volume_id_probe_iso9660 318 315 -3 volume_id_probe_f2fs 107 104 -3 volume_id_probe_exfat 285 282 -3 volume_id_probe_erofs 89 86 -3 volume_id_probe_cramfs 67 64 -3 volume_id_probe_btrfs 134 131 -3 volume_id_probe_bcache 107 104 -3 volume_id_probe_sysv 194 188 -6 volume_id_probe_hfs_hfsplus 518 512 -6 add_to_uuid_cache 271 265 -6 volume_id_probe_ext 131 122 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/27 up/down: 0/-96) Total: -96 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* util-linux: support erofs filesystemNorbert Lange2020-11-183-0/+72
| | | | | | | | | | | | | Add erofs to the known volume_ids. function old new delta volume_id_probe_erofs - 89 +89 fs1 24 28 +4 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 1/0 up/down: 93/0) Total: 93 bytes Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>