summaryrefslogtreecommitdiff
path: root/util-linux
AgeCommit message (Collapse)Author
2015-07-30fbset: fix rgba parsingLinus Walleij
In commit b5c7220e7b2b6611fe5beca494c67bfe51fcfafb "fbset: respect rgba configuration lines in fb.modes" I somehow managed to swap the offset/length markers around. The man page for fb.modes says it should be offset/length not length/offset as I was accidentally parsing it. As my fb.modes file was also reversed I didn't notice until I tried someone elses fb.modes file. Mea culpa. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-07-19libbb: add a function to make a copy of a region of memoryRon Yorston
Introduce a library routine to package the idiom: p = xmalloc(b, n); memcpy(p, b, n); and use it where possible. The example in traceroute used xzalloc but it didn't need to. function old new delta xmemdup - 32 +32 last_main 834 826 -8 make_device 2321 2311 -10 common_traceroute_main 3698 3685 -13 readtoken1 3182 3168 -14 procps_scan 1222 1206 -16 forkchild 655 638 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/6 up/down: 32/-78) Total: -46 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-05-25typo fixesManinder Singh
Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-04-19mdev: if a "future" mdev.seq is seen, do not overwrite it with oursDenys Vlasenko
This was seen to happen if two mdevs are run in parallel, mdev.seq is empty, and the "newer" one manages to write it first. function old new delta mdev_main 1366 1388 +22 atoll - 20 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-04-19mdev: improve loggingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-04-16uevent: new appletDenys Vlasenko
This applet listens on netlink socket with kernel's uevent messages. Run-tested. function old new delta uevent_main - 416 +416 packed_usage 30671 30713 +42 applet_names 2531 2538 +7 applet_main 1468 1472 +4 RCVBUF - 4 +4 applet_nameofs 734 736 +2 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 4/0 up/down: 475/0) Total: 475 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-04-14volume_id: fix a buglet introduced by is_prefixed_with() conversionAlfonso Ranieri
Signed-off-by: Alfonso Ranieri <alforan@tin.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-03-12Use chomp to remove newlinesRon Yorston
function old new delta unix_do_one 548 540 -8 process_timer_stats 508 500 -8 process_irq_counts 532 524 -8 lpd_main 839 831 -8 hwclock_main 502 494 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-50) Total: -40 bytes Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-03-12libbb: introduce and use is_prefixed_with()Denys Vlasenko
function old new delta is_prefixed_with - 18 +18 complete_username 78 77 -1 man_main 737 735 -2 fsck_device 429 427 -2 unpack_ar_archive 80 76 -4 strip_unsafe_prefix 105 101 -4 singlemount 1054 1050 -4 rtc_adjtime_is_utc 90 86 -4 resolve_mount_spec 88 84 -4 parse_one_line 1029 1025 -4 parse_conf 1460 1456 -4 may_wakeup 83 79 -4 loadkmap_main 219 215 -4 get_irqs_from_stat 103 99 -4 get_header_cpio 913 909 -4 findfs_main 79 75 -4 fbsplash_main 1230 1226 -4 load_crontab 776 771 -5 expand_vars_to_list 1151 1146 -5 date_main 881 876 -5 skip_dev_pfx 30 24 -6 make_device 2199 2193 -6 complete_cmd_dir_file 773 767 -6 run_applet_and_exit 715 708 -7 uudecode_main 321 313 -8 pwdx_main 197 189 -8 execute 568 560 -8 i2cdetect_main 1186 1176 -10 procps_scan 1242 1230 -12 procps_read_smaps 1017 1005 -12 process_module 746 734 -12 patch_main 1903 1891 -12 nfsmount 3572 3560 -12 stack_machine 126 112 -14 process_timer_stats 449 435 -14 match_fstype 111 97 -14 do_ipaddr 1344 1330 -14 open_list_and_close 359 343 -16 get_header_tar 1795 1779 -16 prepend_new_eth_table 340 323 -17 fsck_main 1811 1794 -17 find_iface_state 56 38 -18 dnsd_main 1321 1303 -18 base_device 179 158 -21 find_keyword 104 82 -22 handle_incoming_and_exit 2785 2762 -23 parse_and_put_prompt 774 746 -28 modinfo 347 317 -30 find_action 204 171 -33 update_passwd 1470 1436 -34 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-03-11mount: -T OTHERTAB supportIsaac Dunham
function old new delta mount_main 1221 1241 +20 packed_usage 30616 30610 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Isaac Dunham <ibid.ag@gmail.com>
2015-02-23acpid: fix loggingSerj Kalichev
Without this patch acpid can't log the events at all. Moreover it tries to truncate log file every time. Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-18trivial code shrinkDenys Vlasenko
function old new delta rdate_main 246 251 +5 show_entry 291 287 -4 daytime_stream 44 39 -5 packed_usage 30176 30168 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 5/-17) Total: -12 bytes text data bss dec hex filename 929453 932 17684 948069 e7765 busybox_old 929411 932 17684 948027 e773b busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-04fstrim: fix help textDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-01-05swaponoff: add support for -eRené Rhéaume
Signed-off-by: René Rhéaume <rene.rheaume@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-08mdev: treat zero-length /dev/mdev.seq the same as "\n" one. Closes 7334Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-07-04fatattr: use the standard type for 32-bit intDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-30fatattr: new appletPascal Bellard
function old new delta fatattr_main - 281 +281 packed_usage 29821 29871 +50 bit_to_char - 10 +10 applet_names 2472 2480 +8 applet_main 1436 1440 +4 applet_nameofs 718 720 +2 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 4/0 up/down: 355/0) Total: 355 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-05-02rtcwake: fix incorrect (reversed) rtc/sys adjuestment; code shrinkDenys Vlasenko
function old new delta rtcwake_main 482 462 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-01swapon/swapoff: -a returns 0 on ignored errorsTito Ragusa
Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-31swapon/swapoff: size reduction, cleanup, fixes, improvementsTito Ragusa
1) real swapon/swapoff handles also devices on the commandline with -a; 2) xstat(device) in swap_enable_disable aborts on error when cycling through fstab so some devices are not handled; 3) duplicated code for ENABLE_FEATURE_SWAPON_DISCARD and ENABLE_FEATURE_SWAPON_PRI was moved to functions. 4) silence some error messages with -a; 5) minor cleanups and code refactoring reduced the size as per bloat-check: 6) I also added support for /proc/swaps handling to swapoff: "When the -a flag is given, swapping is disabled on all known swap devices and files (as found in /proc/swaps or /etc/fstab)." So now swapoff first cycles through /proc/swaps and then through fstab to swapoff all devices. function old new delta set_discard_flag - 106 +106 swap_enable_disable 147 238 +91 set_priority_flag - 79 +79 retrieve_file_data 470 467 -3 swap_on_off_main 638 418 -220 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 1/2 up/down: 276/-223) Total: 53 bytes Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-23add discard option -d to swaponMatt Whitlock
Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-23fix interaction of -a and -p options in swaponMatt Whitlock
Swap entries in /etc/fstab inherit the priority specified on the command line unless they have 'pri' in their mount options. Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-23avoid calling bb_strtou twice in MIN macro expansionMatt Whitlock
Also, the maximum allowable value of swap priority is technically SWAP_FLAG_PRIO_MASK >> SWAP_FLAG_PRIO_SHIFT. Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-16script: make it work even if fd 0 is closedDenys Vlasenko
Testcase: script -q -c "echo hey" /dev/null 0>&- Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-05use [s]rand(), not [s]random()Denys Vlasenko
rand() is the most standard C library function, and on uclibc they are the same. I guess they are the same in most todays' libc... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-25hwclock: fix setting of tz_minuteswest. Closes 5414Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-29Use unsigned printf/scanf conversion where more appropriateDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-29fix assorted unused code and wrong format specs found by cppchekc (bug 6716)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-12fstrim: use new-style config/kbuild/applet snippets; trim help textDenys Vlasenko
function old new delta packed_usage 29546 29520 -26 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-12fix "warning: ISO C90 forbids mixed declarations and code"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-10fstrim: Needs to fire at the mp, not bdBernhard Reutner-Fischer
It's a filesystem thing from this perspective. +1b Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-10fstrim: Indicate failure on errorBernhard Reutner-Fischer
+14b Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-09fstrim: -17bBernhard Reutner-Fischer
Also, use the name of the block device we found, not necessarily the one we got from the user: fstrim -v / /dev/sdj: 4711 bytes were trimmed Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-09fstrim: New appletMalek Degachi
fstrim applet is a port from util-linux. "Trimming" your NAND/eMMC storage will restore the write performance back to normal after having slow down issues on sequential write and random write due to usage over time. Good reading on subject: http://forum.xda-developers.com/showthread.php?t=1971852 (with long options and CLEAN_UP turned on) function old new delta .rodata 148494 148791 +297 fstrim_main - 283 +283 fstrim_sfx - 128 +128 packed_usage 28826 28903 +77 applet_main 2760 2768 +8 applet_names 2343 2350 +7 applet_nameofs 690 692 +2 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 5/0 up/down: 802/0) Total: 802 bytes Signed-off-by: Malek Degachi <malek-degachi@laposte.net> Cc: Eugene San (eugenesan) <eugenesan@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-11-08swaponoff: shrinkBernhard Reutner-Fischer
function old new delta .rodata 148469 148468 -1 swap_on_off_main 381 379 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-3) Total: -3 bytes text data bss dec hex filename 803030 4090 9504 816624 c75f0 busybox_old 803027 4090 9504 816621 c75ed busybox_unstripped
2013-09-06Make smart_ulltoa return pointer to end (allows for code shink in callers)Denys Vlasenko
function old new delta smart_ulltoa5 405 408 +3 smart_ulltoa4 273 276 +3 list_table 1113 1114 +1 scale 36 34 -2 put_lu 55 53 -2 ulltoa6_and_space 19 14 -5 powertop_main 1470 1461 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-20fdisk: fix GPT size math errorsJody Bruchon
Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-08swapon: support "pri=NNN" in fstabTito Ragusa
function old new delta swap_on_off_main 244 365 +121 Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-01volume_id: add f2fs detectionSven-Göran Bergh
function old new delta volume_id_probe_f2fs - 98 +98 Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-31volume_id: nilfs config description.Sven-Göran Bergh
Config description for nilfs added. No code change. Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-31volume_id: Adopt to new config style.Sven-Göran Bergh
Config instructions for util-linux/volume_id are moved into the source files according to the new config feature. No code change. Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-31volume_id: Adopt to new kbuild style.Sven-Göran Bergh
Kbuild instructions for util-linux/volume_id are moved into the source files according to the new build feature. No code change. Signed-off-by: Sven-Göran Bergh <sgb@systemasis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-13Commonalize typical [b,]k,m suffix structDenys Vlasenko
function old new delta bkm_suffixes - 32 +32 static.km_suffixes 24 - -24 suffixes 32 - -32 static.bkm 32 - -32 head_tail_suffixes 32 - -32 ------------------------------------------------------------------------------ (add/remove: 2/6 grow/shrink: 0/0 up/down: 72/-160) Total: -88 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-27losetup: assorted fixes. Closes 6314Denys Vlasenko
"losetup -d" was not complaining that LOOPDEV is missing. "losetup -a" was listing only up to /dev/loop9. "losetup -f" looped forever if llop0 was taken, and never tried anything after /dev/loop9. "-o" with other options (say, -r) had no effect. function old new delta losetup_main 376 419 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-15volume_id_internal.h: drop unoptimized byteswap routinesDenys Vlasenko
function old new delta volume_id_probe_hfs_hfsplus 802 627 -175 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-13mdev: use $DEVNAME in uevent sysfs file for device node nameNikolaus Voss
516530c932bd17d87c9eb4347a490be051e495f4 uses $DEVNAME variable for device node name. This is fine, but only works for hotplugging, "mdev -s" will behave differently when DEVNAME and basename(path) differ. This patch extracts the DEVNAME from the uevent sysfs file in make_device(), thus works for hot- and coldplugging; so using the environment DEVNAME on hotplug events is no longer necessary. Signed-off-by: Nikolaus Voss <n.voss@weinmann.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-09volume_id: fix ntfs attribute searchOliver Metz
len is declared as uint32_t but le16_to_cpu macro is used Signed-off-by: Oliver Metz <oliver.metz@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-04-02mdev: call index_in_strings on $ACTION only after we checked it for NULLDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-27hexdump: need to use xstrtoull for off_tDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-27hexdump: don't unconditionally limit the usable address rangeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>