aboutsummaryrefslogtreecommitdiff
path: root/nand-utils
AgeCommit message (Collapse)Author
2017-06-14Use defines for exit code valuesDaniel Wagner
Make the usage of exit consist. That is use the pre defined exit values. Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-01-18nanddump: Add --skip-bad-blocks-to-start optionMike Crowe
The --skip-bad-blocks-to-start option will increase the start address by the size of each bad block encountered between the start of the partition and the specified start address. This can be useful if other readers of the partition will be reading using a simple bad-block-skipping algorithm. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-01-18nandwrite: Add --skip-bad-blocks-to-start optionMike Crowe
The --skip-bad-blocks-to-start option will increase the seek offset by the size of each bad block encountered between the start of the partition and the specified start address. This can be useful when writing part way through a partition that will be read using a simple bad-block-skipping algorithm. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-01-12nandwrite: fix/cleanup bad block skippingDavid Oberhollenzer
JFFS2 supports clustering erase blocks to virtual erase blocks. nandwrite supports this, but previously mixed up virtual and physical erase block numbers when checking for bad blocks. This patch adds a function for checking if a virtual erase block is bad and replaces the broken mtd_is_bad loop. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-01-12nandwrite: replace erase loop with mtd_erase_multiDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-01-12nandwrite: add stricter sanity checking for blockalignDavid Oberhollenzer
This patch makes sure that a virtual erase block is always composed of a postivie number of erase blocks (i.e. 1 or more) and enforces the block alignment to be a power of two as suggested by the help text and assumed throughout the program. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2016-12-09nandwrite: Factor out buffer checking codeMarek Vasut
Pull the buffer content checking code into separate function and simplify the code invoking it slightly. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2016-12-06common: Fix 'unchecked return code' warningsBoris Brezillon
Several tools are simply not checking return code of functions marked with 'warn_unused_result'. Provide wrappers for the read/write functions to avoid patching old code and providing proper error handling. Fix the remaining ones (calls to fgets() and system()). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2016-12-06nandwrite: add skip-all-ff-pages-optionKees Trommel
Signed-off-by: Kees Trommel <ctrommel@linvm302.aimsys.nl> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2016-11-17Unify version string printingDavid Oberhollenzer
When a program does sophisticated enough command line processing (i.e. getopt), make sure it responds to -V and --version. When a program prints a version string, make sure it uses the common_print_version macro to print out its name, that it is part of mtd-utils and the mtd-utils version from the build system in a fashion similar to common program packages like the GNU coreutils. When a program responds to -V/--version or -h/--help, make sure it reports success exit status. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
2016-11-17Integrate tests into autotools build systemDavid Oberhollenzer
Add automake files for the test binaries. If configured to do so, install the test binaries to libexec/mtd-utils and use autoconf to fix the paths in the test scripts. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
2016-11-17Change build system to autotoolsRichard Weinberger
This patch is largely based on Richards original RFC. The major differences to the RFC patch are: - Add missing sumtools & mtdpart targets - Fix name of mkfs.jffs2 target - Add missing subdir-objects option for non-recursive make - Move all automake options to configure.ac - Add manpages to install target - Make XATTR & LZO support configurable - Install binaries to sbin directory like in the old build system - Install flash_erase wrapper script - Add files missing from distribution target Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
2016-11-17nanddump: check write function result for errorsRafał Miłecki
Errors may happen, it's e.g. easy on embedded devices to run out of space when dumping big partitions. This patch adds a helper function for writing. It deals with partial writes and just returns 0 on success or error number. The old code didn't check for errors at all which could result in incomplete dumps without exiting with an error. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
2016-08-25mtd-utils: nanddump: write requested length onlyGary Bisson
nanddump was always writing a whole page of data into the output discarding the length actually requested. This patch allows to write only the remaining length if oob is omitted. In case oob is needed, it makes sense to copy the entire page. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-11-11mtd-utils: Restructure the mtd-utils source.Dongsheng Yang
* There is no code modification in this commit, only moving * the files to proper place. The user tools looks a little messy as we place almost the all tools in the root directory of mtd-utils. To make it more clear, I propose to introduce the following structure for our source code. mtd-utils/ |-- lib |-- include |-- misc-utils |-- jffsX-utils |-- nand-utils |-- nor-utils |-- ubi-utils |-- ubifs-utils `-- tests Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>