aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-07-20Makefile: fix "version.h" build for cross-compilingBrian Norris
When using "make CROSS=mipsel-linux-", I get the following errors: /bin/sh: /home/norris/git/mtd-utils/mipsel-linux/include/version.h.tmp: No such file or directory make: *** [/home/norris/git/mtd-utils/mipsel-linux/include/version.h.tmp] Error 1 Fix (suggested by Mike Frysinger): create the directory if it doesn't exist. Also, $(CC) needs to be able to find the generated header in $(BUILDDIR)/include. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-07-04mkfs.ubifs: fix a gcc warningArtem Bityutskiy
This patch "fixes" the following gcc warning: mkfs.ubifs/mkfs.ubifs.c: In function ‘main’: mkfs.ubifs/ubifs.h:420:2: warning: ‘child_cnt’ may be used uninitialized in this function [-Wuninitialized] mkfs.ubifs/mkfs.ubifs.c:1735:6: note: ‘child_cnt’ was declared here by initializing the ‘child_cnt’ to zero. Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-07-04mkfs.ubifs: remove root inode squash featureArtem Bityutskiy
Remove the -squash-rino-perm mkfs.ubifs option as this was planned. Remove the corresponding record from the feature-removal-schedule.txt file. Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-30flash_erase: fix incorrect help messageBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-30mtdinfo: remove -m leftoversArtem Bityutskiy
We have removed the -m option, but did not remove args.mtdn which represents the -m parameters. Kill args.mtdn as well. Tweaked by Brian Norris. Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2011-06-29mtdinfo: kill -m optionBrian Norris
According to feature-removal-schedule, we shouldn't use `-m', since it relies on a specific device-naming pattern. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-utils: kill flash_infoBrian Norris
According to "feature-removal-schedule," we kill flash_info in favor of mtdinfo. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-utils: switch more utils to unified versioningBrian Norris
More utilities now use the common VERSION system. For utils that printed a very simple message, we use the new common_print_version() "function." Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-utils: add common version printing functionBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mkfs.ubifs: use common.hBrian Norris
To use more unified versioning and to re-use other existing code, switch to common.h. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-utils: update .gitignore filesBrian Norris
First, the top-level Makefile should not tell git to ignore sub-level .gitignore files. Second, add simple .gitignores to ignore the executables generated under the various `tests' subdirectories. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-utils: remove whitespace at end of linesBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-tests: io_paral: build error, "variable length strings"Brian Norris
Some compilers will complain about use of strlen() within a static array size declaration. For this type of string, "sizeof() - 1" is equivalent and prevents the build error. Error: io_paral.c:48:13: error: variably modified 'vol_nodes' at file scope Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29mtd-tests: checkfs: fix size_t related warningBrian Norris
Depending on your compiler, size_t may or may not be long unsigned int. Use printf's %zu format to clarify. Warning message: checkfs.c:524:28: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-29nanddump: remove unused variableBrian Norris
The "bb_default" bool was temporarily being used to straighten out potential issues with the changing --bb=METHOD options and to warn users properly. Now, it's unnecessary. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-27autogenerate version.h from build systemMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-27rewrite build system to avoid recursionMike Frysinger
The ubi-utils/src/ subdir is tossed as it just complicates things for no real gain. The dictionary.h header is relocated to the ubi-utils/include/ since other headers in there need it. The top level clean is replaced with a `find -delete` on objects, so it might prune more than necessary, but many projects now do this sort of thing and no one complained there. A "mkdep" helper generates the actual rule, and the variables are used with "foreach" to expand these automatically. The tests subdir is updated only to reflect the ubi-utils source move. Otherwise, it is left untouched as making that non-recursive isn't really worth the effort. While we're gutting things, also through in kbuild style output while building to make things more legible. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-25build: remove old SYMLINKS variableMike Frysinger
This is only used to create symlinks to out of tree files. I doubt it has any relevance anymore now that jffs2 has been merged into mainline. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25integck: fix build error (MS_DIRSYNC, MS_RELATIME)Brian Norris
Need to include <linux/fs.h>, at least for my build system. Otherwise, you can't build the 'tests'. integck.c: In function ‘parse_mount_options’: integck.c:2862: error: ‘MS_DIRSYNC’ undeclared (first use in this function) integck.c:2862: error: (Each undeclared identifier is reported only once integck.c:2862: error: for each function it appears in.) integck.c:2872: error: ‘MS_RELATIME’ undeclared (first use in this function) Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25feature-removal: remove completed tasksBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25nanddump: default to NOT dumping OOB dataBrian Norris
Since nandwrite doesn't write OOB data by default, we don't dump OOB data by default, in order to be a more proper inverse function. Remove the warnings and change the default. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25nanddump: change -o to mean --oob, not --omitoobBrian Norris
As warned earlier, we are changing the meaning of `nanddump -o' to mirror the usage in nandwrite, where -o means to include OOB (i.e., `nandwrite -o' writes data to both in-band and out-of-band areas, so `nanddump -o' should dump data from both in-band and out-of-band areas). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25nanddump: change default to --bb=skipbadBrian Norris
As promised, we change the default bad block handling method to --bb=skipbad. This works as a better inverse to nandwrite, since nandwrite skips bad blocks when writing data. And of course, we remove the warning messages. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25nanddump: kill --omitbad, --noskipbadBrian Norris
As mentioned previously, we are killing --omitbad in favor of the new --bb=skipbad option, which functions fairly similarly. Also, --noskipbad has become --bb=dumpbad, so remove the old `-N' and `--noskipbad' flags. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25punt redundant libcrc32v1.4.5Mike Frysinger
The libcrc32.a is only used in one place: mkfs.ubifs. But this also uses libmtd.a, and the only file in libcrc32.a is also in libmtd.a. So libcrc32.a itself is completely redundant. Punt! Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-25mtd-utils: bump nanddump, mtdinfo version numbersBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-23nanddump: document, warn about future default --omitoobBrian Norris
To work as a proper inverse to nandwrite, nanddump must not dump OOB data by default. This patch prints a warning regarding the future change. We also suggest using the new flag, `--oob', for transitioning to the next release with new default behavior. Note that we are changing `-o' to mean `--oob' in the next release, similar to `nandwrite -o'. This is a break from previous behavior. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23nanddump: add --oob optionBrian Norris
Adds an explicit option for including OOB data in our data dump. Currently, this is the default behavior, but in the next release, the default will be to exclude OOB data. This is done to mirror the '-o' option in nandwrite. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23feature-removal-schedule: describe nanddump changesBrian Norris
Include a few notes about the edited options and new defaults for bad block handling in nanddump. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23nanddump: warn about new default BB handlingBrian Norris
In an upcoming release, we will no longer default to --bb=padbad. Instead, the default will be --bb=skipbad. This makes nanddump a better inverse operation to nandwrite. This patch prints warnings for users so that they get a chance to update their scripts before the default changes officially. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23nanddump: update help message for BB method changesBrian Norris
--noskipbad will soon be replaced by --bb=dumpbad, and --omitbad is being removed entirely in favor of --bb=skipbad. This patch adds warnings when using inappropriate configurations and adds info to the help message. Please plan to migrate to the new usages shortly. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23nanddump: remove --skipbad, leaving --bb=skipbadBrian Norris
We are moving to unify bad block handling methods under the --bb=METHOD option. Since --skipbad has not been included in a mtd-utils release yet, we can safely replace it without a deprecation and phase-out period. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-23nanddump: add --bb=METHOD optionBrian Norris
We have too many separate bad block handling methods: --omitbad --noskipbad --skipbad On top of these, we have the default option: that bad blocks are replaced with 0xFF. These options will be unified under --bb=METHOD. The end goal will be something like: ---------------------------------------------------------------------------------------------- Old option New option Comment ---------------------------------------------------------------------------------------------- <default> --bb=padbad dump flash data, substituting 0xFF for any bad blocks --noskipbad --bb=dumpbad dump flash data, including any bad blocks --skipbad --bb=skipbad dump good data, completely skipping any bad blocks (new default) --omitbad N/A very similar to `skipbad' (DEPRECTATED) The BB options are all mutually exclusive, so we check that we do not have more than one BB option explicitly enabled on the command line by tracking whether or not a BB method has been set by the user. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-09mtdinfo: add regioninfo/eraseblock map displayMike Frysinger
This brings the mtdinfo utility in line with the functionality of the flash_info utility. It dumps the erase regioninfo (if the devices has it) as well as showing a handy eraseblock map (if the user has requested it). The eraseblock map also shows which blocks are locked and which ones are bad. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-09mtdinfo: remove now unused ubigen infoMike Frysinger
A previous commit moved the code using this var into a diff func. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08mtdinfo: separate out ubi information printingArtem Bityutskiy
We are going to add some more code which prints eraseblocks map, so we need to make 'print_dev_info()' a bit smaller to keep the code readable. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08libmtd: improve mtd_islocked interfaceArtem Bityutskiy
This patch first of all, re-names 'mtd_islocked()' into 'mtd_is_locked()' since this seems to be the name Mike wanted, and it looks a bit nicer. This patch also makes 'mtd_is_locked()' print an error message if it fails. I'm not sure if it is good idea for a library to do so, but all functions do this, so it certainly _not_ a good idea to be inconsistent. However, for the special case, when the the "is locked" ioctl is not supported or is not valid for this device, we do not print an error message and return ENOTSUPP error code. Thus, the user can distinguish between real errors and non-fatal "not supported" cases. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08libmtd: add helper funcs for getting regioninfo and locked infoMike Frysinger
This extends the libmtd with the helper functions: mtd_regioninfo: interface to MEMGETREGIONINFO mtd_islocked: interface to MEMISLOCKED Users of these functions will follow shortly ... Artem: do not print error message in mtd_islocked() Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08jffs2: make lzo optional at build timeMike Frysinger
The external lzo dep can be a pain to deal with when cross-compiling, so make it optional for jffs2. This is useful if people aren't even using the functionality, or for quicker development. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08flash_info: deprecateMike Frysinger
Artem: tweak the warning message Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-08ubi-utils: send help/version info to stdoutMike Frysinger
Usage/version information should go to stdout when it is expected behavior (i.e. the user requested it explicitly). This info should go to stderr only when the usage info is being shown as a result of incorrect options. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07mtdinfo: deprecate the -m optionArtem Bityutskiy
... because mtd device node name do not have to follow the "/dev/mtd%d" pattern. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07libmtd: use O_CLOEXECMike Frysinger
Not strictly necessary, but this is good library behavior and should carry no runtime overhead. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07include/mtd: sync with kernelMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07flash_info: allow people to get info on multiple devicesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07flash_info: convert to common.hMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-07ignore (FLAT) gdb filesMike Frysinger
Linux FLAT toolchains produce .gdb files alongside the normal program for debugging purposes (so linking to "foo" will also produce "foo.gdb"). Ignore these too. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-06flash_{lock, unlock}: fix off-by-one error for "entire device" lengthSteven Miao
This basically reverts commit 43feb39f35a9ee0ed3 which changed the full length calculation to be one less than one sector. I don't understand the logic in the commit message where it states that the length should be one sector smaller as this results in misbehavior at runtime. For example, with a mtd device with total size 0x400000 and erase block size of 0x20000 (which gives us a total of 32 sectors), this new logic results in: mtdLockInfo.start = 0; mtdLockInfo.length = 0x3e0000; /* (32 - 1) * 0x20000 */ Calling MEMLOCK/MEMUNLOCK on the device with this range leaves the last sector unchanged which is certainly not what we want. So drop this -1 part of the calculation. To look at it another way, if we only attempt to lock one sector, this calculation would end up with the .length set to 0. Calling MEMLOCK with a length of 0 does not lock the sector as this simple code shows: int main(int argc, char *argv[]) { erase_info_t e0 = { 0, 0 }, e1 = { 0, 0x20000 }; int fd = open(argv[1], O_RDONLY); ioctl(fd, MEMUNLOCK, &e1); printf("%i\n", ioctl(fd, MEMISLOCKED, &e1)); ioctl(fd, MEMLOCK, &e0); printf("%i\n", ioctl(fd, MEMISLOCKED, &e1)); } MEMISLOCKED returns 0 both times. If we change the argument to MEMLOCK to e1, then MEMISLOCKED returns 1. Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-06flash_{lock,unlock}: convert to common codeMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-06flash_{lock,unlock}: merge into one utilMike Frysinger
Now that the utils have equivalent functionality, merge the two source code bases so they can't diverge in the future. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>