aboutsummaryrefslogtreecommitdiff
path: root/miscutils/nandwrite.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* nanddump: don't show --bb in usage when disabledBaruch Siach2014-12-181-1/+3
| | | | | | | | 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>
* nandwrite: fix build when long options are disabledBaruch Siach2014-12-171-3/+4
| | | | | | | | | | | | 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>
* nanddump: change default to --bb=skipbadRichard Genoud2014-06-251-1/+1
| | | | | | | | 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>
* nanddump: kill -b Omit bad blockRichard Genoud2014-06-251-26/+12
| | | | | | | | 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>
* nanddump: add options --bb=skipbad and padbadRichard Genoud2014-06-251-9/+56
| | | | | | | | | | | | | | | | | 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>
* nanddump: correct rounding to next page (lead to infinite loop)Richard Genoud2014-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* nanddump: fix build if nandwrite isn't enabledAlexander Shiyan2013-03-151-4/+4
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nanddump: invert the meaning of the -o parameter to match upstreamBaruch Siach2012-10-151-4/+4
| | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nanddump: skip bad blocks when instructed to do soBaruch Siach2012-10-151-1/+1
| | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nanddump: use the right operator of logic ANDBaruch Siach2012-10-151-1/+1
| | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nanddump: make dumping read-only partitions workMatt Reimer2012-06-131-1/+1
| | | | | | | | Make dumping read-only partitions work by opening the device O_RDONLY; otherwise the open() will fail with -EPERM. Signed-off-by: Matt Reimer <mreimer@sdgsystems.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* conspy,nandwrite,nanddump: enable in defconfigDenys Vlasenko2011-08-131-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixesDan Fandrich2011-07-081-1/+1
| | | | | Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-2/+0
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Replace "depends on PLATFORM_LINUX" with "select PLATFORM_LINUX"Denys Vlasenko2011-02-261-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass removal of underscores from _BB_DIR_foo and _BB_SUID_fooDenys Vlasenko2011-01-181-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: whitespace fixesDenys Vlasenko2010-10-281-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nanddump: make oobbuf allocation dynamicBaruch Siach2010-10-181-6/+6
| | | | | | | | In accordance with upstream mtd-utils commit 96a5eeaf (mtd-utils: nanddump: Dynamic buffer, increase pagesize/oobsize). Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* nanddump: new appletBaruch Siach2010-10-181-28/+127
| | | | | | | | | | | | | | | | | function old new delta nandwrite_main 418 936 +518 dump_bad - 119 +119 packed_usage 27752 27810 +58 next_good_eraseblock 84 106 +22 applet_names 2366 2375 +9 applet_main 1380 1384 +4 applet_nameofs 690 692 +2 bbconfig_config_bz2 4932 4922 -10 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/1 up/down: 732/-10) Total: 722 bytes Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nandwrite: always check the first erase blockBaruch Siach2010-08-291-2/+14
| | | | | | | | Current code does not check the first erase block when mtdoffset is not erase block aligned. Fix this. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nandwrite: complain on malformed -s NUMDenys Vlasenko2010-08-291-0/+2
| | | | | | Elsewhere: use common error message. -30 bytes net size change Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nandwrite: allow hex values in the -s parameterBaruch Siach2010-08-291-1/+1
| | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nandwrite: new appletBaruch Siach2010-08-251-0/+128
function old new delta nandwrite_main - 382 +382 packed_usage 27119 27135 +16 applet_names 2275 2285 +10 applet_main 1340 1344 +4 applet_nameofs 670 672 +2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/0 up/down: 414/0) Total: 414 bytes Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>