summaryrefslogtreecommitdiff
path: root/miscutils
AgeCommit message (Collapse)Author
2015-02-10i2cget, i2cset, i2cdetect, i2cdump: new appletsBartosz Golaszewski
Add a minimal implementation of i2cget, i2cset, i2cdump and i2cdetect tools. Supports most features of upstream i2c-tools. function old new delta i2cdump_main - 1444 +1444 i2cset_main - 1239 +1239 i2cdetect_main - 611 +611 list_i2c_busses_and_exit - 532 +532 packed_usage 29975 30438 +463 i2cget_main - 380 +380 check_read_funcs - 140 +140 i2c_funcs_tab - 128 +128 confirm_action - 100 +100 i2c_dev_open - 57 +57 i2c_smbus_access - 44 +44 confirm_or_abort - 43 +43 check_funcs_test_end - 39 +39 i2c_smbus_read_word_data - 38 +38 i2c_smbus_read_byte_data - 38 +38 i2c_smbus_read_byte - 37 +37 i2c_set_slave_addr - 32 +32 applet_names 2480 2512 +32 adap_descs - 32 +32 i2c_set_pec - 29 +29 get_funcs_matrix - 21 +21 i2c_parse_data_addr - 18 +18 i2c_parse_bus_addr - 18 +18 i2c_bus_lookup - 18 +18 i2c_smbus_write_byte - 17 +17 applet_main 1440 1456 +16 will_skip - 14 +14 no_support - 11 +11 applet_nameofs 720 728 +8 applet_install_loc 180 182 +2 ------------------------------------------------------------------------------ (add/remove: 26/0 grow/shrink: 5/0 up/down: 5601/0) Total: 5601 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-01-30ubiattach: add option -OMicke Prag
Some images do not have the default VID offset. The option -O must be used to attach such images. Signed-off-by: Micke Prag <micke.prag@telldus.se> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-18nanddump: don't show --bb in usage when disabledBaruch Siach
The --bb options now depends on LONG_OPTS. Omit mentions of --bb from usage text when LONG_OPTS is disabled. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-17nandwrite: fix build when long options are disabledBaruch Siach
The Required_argument macro is only defined when long options are enabled. Fixes the following build error: miscutils/nandwrite.c: In function 'nandwrite_main': miscutils/nandwrite.c:120:10: error: expected ',' or ';' before 'Required_argument' Reported-by: Christian Kästner <kaestner at cs.cmu.edu> Signed-off-by: Baruch Siach <baruch at tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-10flashcp: change BUFSIZE to 4kJacob Kjaergaard
some flash partitions can be smaller than the existing BUFSIZE thus write BUFSIZE will fail with "no space left on device" Signed-off-by: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-11-30man: do not mangle $MANPATH in memoryDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-11-27man: accept a list of dirs in $MANPATHDenys Vlasenko
function old new delta add_MANPATH - 143 +143 man_main 852 731 -121 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 143/-121) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-25ubiupdatevol: fix -t to not require an option. Closes 7466Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-23less: make -E workAaro Koskinen
function old new delta buffer_print 71 104 +33 Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-22less: trivial code shrinkDenys Vlasenko
function old new delta read_lines 715 695 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-22less: move "retry-on-EAGAIN" logic closer to read opsDenys Vlasenko
This makes "G" (goto end of input) command work as well as /search_for_nonexistent_string: both will read to EOF now even from somewhat slow input (such as kernel's "git log"). function old new delta ndelay_on 35 43 +8 ndelay_off 35 43 +8 read_lines 695 691 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 16/-4) Total: 12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-09-21less: disable "suppress empty wraparound" optimizationDenys Vlasenko
It is buggy wrt another use case... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-31taskset: fix logic error in "if it doesn't start with 0x..."Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-17taskset: support CPU masks for more than 64 CPUsDenys Vlasenko
function old new delta taskset_main 522 631 +109 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25nanddump: change default to --bb=skipbadRichard Genoud
since mtd-utils 1.4.7, the default behaviour of nanddump is skipbad (commit 2521d4f1b6b9866a9c89f3c11a4f6a3d763ff1d7) Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25nanddump: kill -b Omit bad blockRichard Genoud
since mtd-utils 1.4.7, the omit bad block method has been removed. (cf commit d8b8f780ec3c916f3990e9227d6bfbb22bf42ef8) Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25nanddump: add options --bb=skipbad and padbadRichard Genoud
In mtd-utils, the bad block options changed in favor of --bb=[skipbad|padbad|dumpbad] and omitbad has been removed. This patch add the --bb=skipbad and padbad methods to busybox' nanddump. padbad is the current default behaviour. The difference between skipbad and omitbad is this one: On a 16K block NAND, if the 1st block of mtd0 is bad, we'll have: nanddump -b -l 16384 /dev/mtd0 | wc -c 0 nanddump --bb=skipbad -l 16384 /dev/mtd0 | wc -c 16384 <- data from 1st good block Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25nanddump: correct rounding to next page (lead to infinite loop)Richard Genoud
The rounding to next page formula was wrong: ex: (len | ~(meminfo->writesize - 1)) + 1; len=128K writesize=4K (len | ~(meminfo->writesize - 1)) + 1 => 4 294 963 201 ?! correct rounding formula: ((len - 1) | (meminfo->writesize - 1)) + 1 => 128K len = 130K ((len - 1) | (meminfo->writesize - 1)) + 1 => 132K modprobe nandsim parts="20,20" badblocks="22,23" without patch: nanddump /dev/mtd1 | wc -c [...] infinite loop with the patch: nanddump /dev/mtd1 | wc -c 327680 Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-05-02Fix compile failuresDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-30crond: implement "SHELL=prog" in crontab. Export LOGNAME as POSIX wantsDenys Vlasenko
function old new delta fork_job 343 456 +113 load_crontab 688 777 +89 crond_main 1456 1434 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 202/-22) Total: 180 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-30crond: simplify logging codeDenys Vlasenko
Slight change in behavior: now -l 5 will enable the same messages formerly only enabled for -d 5. (Old behavior was non-sensical). function old new delta reopen_logfile_to_stderr - 34 +34 log8 - 26 +26 log7 - 26 +26 log5 - 26 +26 load_crontab 706 688 -18 rescan_crontab_dir 157 137 -20 crond_main 1486 1456 -30 fork_job 389 343 -46 crondlog 108 38 -70 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 0/5 up/down: 112/-184) Total: -72 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-30libbb: make syslog level for bb_error_msg's configurable. use it in crondDenys Vlasenko
function old new delta bb_verror_msg 380 386 +6 syslog_level - 1 +1 crondlog 165 108 -57 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-30crond: tweak help text, make course less crypticDenys Vlasenko
function old new delta packed_usage 29736 29740 +4 crond_main 1485 1486 +1 load_crontab 712 706 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-17adjtimex: make its help text and printed data a bit less crypticDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-13less: fix bugs discovered with "git log -p | less -m" on kernel treeDenys Vlasenko
function old new delta read_lines 685 733 +48 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-03man: default to asciiDenys Vlasenko
Default to ascii instead of latin1. Otherwise man pages can be displayed incorrectly. E.g. bullets show as "<B7>". Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-02zcat: complain if input is not compressedDenys Vlasenko
function old new delta buffer_fill_and_print 178 191 +13 varvalue 735 743 +8 bbunpack 747 755 +8 open_zipped 85 89 +4 xmalloc_open_zipped_read_close 61 63 +2 get_addr_1 240 242 +2 fbsplash_main 1228 1230 +2 pstree_main 322 321 -1 builtin_type 121 119 -2 do_load 954 926 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/3 up/down: 39/-31) Total: 8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22less: accept and ignore -sDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22man: parse "DEFINE pager" in configJohn Spencer
function old new delta man_main 789 844 +55 Signed-off-by: John Spencer <maillist-busybox@barfooze.de> 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-26devfsd: remove static variableDenys Vlasenko
function old new delta static.msg 4 - -4 get_uid_gid 114 107 -7 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-11) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-20rfkill: use new-style config/kbuild/appletDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-10-08wall,crontab: use xopen_as_uid_gid()Ryan Mallon
This fixes a narrow security race in crontab. function old new delta xopen_as_uid_gid - 80 +80 seteuid - 64 +64 setegid - 64 +64 setreuid - 37 +37 xseteuid - 22 +22 xsetegid - 22 +22 crontab_main 590 577 -13 setfsuid 33 - -33 setfsgid 33 - -33 wall_main 138 102 -36 open_as_user 109 - -109 text data bss dec hex filename 893539 497 7568 901604 dc1e4 busybox_old 893618 497 7568 901683 dc233 busybox_unstripped Signed-off-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-10-06wall: access FILE under real user's credentialsDenys Vlasenko
While at it, move applet/config/kbuild bits into wall.c. (This way, it's more visible that applet is suid'ed). function old new delta wall_main 87 138 +51 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-25man: find posix man pagesJohn Spencer
Add the 0p/1p/3p sections to the search. Signed-off-by: John Spencer <maillist-busybox@barfooze.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-08-07setsid: code shrink, expanded commentsDenys Vlasenko
function old new delta setsid_main 56 53 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-04ubi_tools: fix typo in strcpyPaul B. Henson
Signed-off-by: Paul B. Henson <henson@acm.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-08-04less: support "less 1<>TTY"Denys Vlasenko
function old new delta less_main 2466 2507 +41 xmalloc_ttyname 46 42 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-07-08chrt: remove warning for _POSIX_PRIORITY_SCHEDULINGBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-06-30ubi_tools: enhance -s option to allow size multiplier to match mtd-utilsDenys Vlasenko
Based on patch by Paul B. Henson <henson@acm.org> function old new delta static.size_suffixes - 32 +32 ubi_tools_main 1141 1148 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-30ubi_tools: add forgotten argv++Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-30ubi_tools: extend supported volume size to 64 bits; shrink codeDenys Vlasenko
function old new delta get_num_from_file - 90 +90 packed_usage 29395 29377 -18 ubi_tools_main 1349 1141 -208 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 90/-226) Total: -136 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-30ubimkvol: add -m option to create volume of maximum sizePaul B. Henson
Signed-off-by: Paul B. Henson <henson@acm.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-22setserial: Fix typo: s/baund_rate/baud_rate/gBernhard Reutner-Fischer
as noted by Christoph Handel opensource at macht-blau.org Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-15flash_eraseall: implement -NAlexander Shiyan
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-03-15nanddump: fix build if nandwrite isn't enabledAlexander Shiyan
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-28flashcp: trivial code shrinkDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-23flashcp: pad output to BUFSIZE. Hopefully closes 5882Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-18dc: code shrinkDenys Vlasenko
function old new delta stack_machine 103 101 -2 operators 176 168 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>