summaryrefslogtreecommitdiff
path: root/ubi-utils
AgeCommit message (Collapse)Author
2010-01-10ubiformat: be consistent with sequence numbersArtem Bityutskiy
This commit fixes a stupid an nasty bug. When we flash an UBI image, we do not change its sequence numbers. But when we format the rest of the PEBs (beyond the flashed image), we use a random (or specified via cmdline) sequence number. As a result, we have a broken flash format and UBI refuses it, because half of it has one sequence number, another half has a different one. What we have to do instead, we have to substitute image's sequence number with ours. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-01-10ubiformat: always initialize seq numberArtem Bityutskiy
For some reasons sequence number was set to 0 in some case, which is wrong. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-09ubiformat: fix error messagev1.3.0Artem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-09ubiformat: check that min IO size is power of 2Artem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-11-26ubi-utils: add ubirsvol to .gitignoreArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-11-26ubiformat: fix --erase-counter handlingArtem Bityutskiy
The --erase-counter option did not work and this was reproted by Darwin Rambo <drambo@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-10-05ubi-utils: add ubirsvol tool to resize UBI volumesArnaud Mouiche
This is nearly a copy/paste from ubirmvol. Signed-off-by: Arnaud Mouiche <arnaud.mouiche@thomson.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubinize/ubiformat: improve random number seedingArtem Bityutskiy
Add current time to the PID to improve the pseudo-random number generator seeding. Also, use 'rand()' instead of 'random()', because 'srand()' is for 'rand()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubiformat/ubinize: Don't randomize 0xFFFFFFFF sequence numberMichael Roth
args.image_seq is of type uint32_t and was initialized to -1 which becomes 0xFFFFFFFF in this case. Later the value -1 was used as a flag that args.image_seq should be replaced with a randomized value. With the option --image-seq (-Q) a user could provide any sequence number at will. But when the user provided sequence number was 0xFFFFFFFF this was understood effectivly as -1 and got overridden by a randomized sequence number. So this patch change the programm flow to respect the principle of least surprise and never use a randomized sequence number when the user provide one at own will. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubiformat/ubinize: fix more 64-bit image sequence number confusionMichael Roth
The sequence number is only 32 bit as the strtoul() function. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubiformat: add image sequence supportArtem Bityutskiy
Similarly to ubinize, add image sequence number support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubinize: fix 64-bit image sequence number confusionArtem Bityutskiy
UBI image sequence number which we store in EC headers is 32 bits, not 64-bits. I was confused when noticed that the 'image_seq' variable had type 'unsigned long long'. Turn it into a 'uint32_t' type. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubiformat: fix typo in the help outputArtem Bityutskiy
The UBI image sequence number is a 64-bit integer, not 32-bit integer. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24mkfs.ubifs: do not forget to torture PEBArtem Bityutskiy
We added PEB torturing for the case when we fail during flashing an image, but forgot to add it for the case when we are formating the flash. Add the forgottent torturing call. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-30ubiformat: clean up help output a littleArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubinize: add sequence number supportArtem Bityutskiy
UBI now supports the image sequence number feature which prevents UBI from mistakingly accepting half-written images, if the image was written on top of an older image. Support this feature in ubinize and make it pick a random number for the UBI image sequence number. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubi-utils: remove depricated -d optionArtem Bityutskiy
It's already about 2 years since the "-d" option was declared deprecated. UBI utils have printed a warning about this. Now it is time to kill this option completely. The affected utilities are ubimkvol, ubirmvol and ubiupdatevol. Their versions are also increased. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26common: remove depricated KB,MB,GB supportArtem Bityutskiy
KiB, MiB and GiB should be used instead. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubiformat: version 1.4Artem Bityutskiy
Increase ubiformat version to reflect the fact that now we torture PEBs before marking them as bad. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubiformat: make badblocks output less confusingArtem Bityutskiy
When ubiformat prints something like ubiformat: bad eraseblocks: 1400 it looks like there are 1400 bad eraseblock, although there is only one with number 1400. Fix this but turning the print into ubiformat: 1 bad eraseblock found, numbers: 1400 Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubiformat: nicify error outputArtem Bityutskiy
Do not print extra newline if write fails, because mtd_write prints a message and adds newline. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubiformat: minor printing clean-upArtem Bityutskiy
When a PEB is marked as bad while we are formatting, ubiformat prints 99% done at the end. Make it print 100% done instead. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-26ubiformat: torture eraseblocks on write errorsArtem Bityutskiy
When fail to write to PEBs, and the error is EIO, torture the PEB before marking it as bad. Basically, the code is copied from the kernel UBI. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-03ubi-utils: fix compilation errors when using CPPFLAGSMike Frysinger
The CPPFLAGS in the env changes how make initializes/appends CPPFLAGS in sub-makes. This causes the old ubi utils to find the newer headers at ubi-utils/include/ before the ubi-utils/old-utils/inc/. Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-06-30ubiformat: allow zero erase counterArtem Bityutskiy
This patch fixes the following issue: $ ubiformat /dev/mtd2 -e 0 ubiformat: error!: bad erase counter value: "0" Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-06-08libubi: fix wrong size calculation with sizes > 4GiBDetlef Bardtholdt
This fixes the handling of total_bytes, avail_bytes and rsvd_bytes. The result of the multiplication must be 64 Bit. Signed-off-by: Detlef Bardtholdt <bardtholdt.detlef@ng-litef.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-05ubiformat: add a TODO entryArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-06-02libmts: recognize pre-MTD-sysfs kernels betterArtem Bityutskiy
Not-so-old linux kernel like 2.6.29 do already have "/sys/class/mtd/mtdX" directories, while very old kernels do not. But in 2.6.29 these directories do not contain any information. Anyway, the logic in libmtd which checked whether the system supports sysfs was broken, because it assumed that old systems do not even have "/sys/class/mtd/" directory. Fix this problem by checking for "/sys/class/mtd/mtdX/name". If this is present - the system really has sysfs support. This patch also adds an extra print to libmtd. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-11ubi-utils: fix memory corruptionsArtem Bityutskiy
This patch contains changes similar to the ones in the previous patch. Also, it changes all invocations of memset and makes sure the argument is 0, not '\0', because memset expects int, not char. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-11libubi: fix multiple memory corruptionsCorentin Chary
The memset is obviously wrong, and valgrind tells use there are some uninitialised bytes used after read() Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-11libubi: add ubi_is_mapped() functionCorentin Chary
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-11ubi-utils: add sysfs interface support and new toolArtem Bityutskiy
This large commit makes several things. 1. Switches libmtd to use the new sysfs interface 2. Implements new handy 'mtdinfo' utility 3. Does minore amendmends in libubi and some ubi-tools. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libubi: add ubi_leb_unmap interfaceArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libubi: add ubi_set_property interfaceArtem Bityutskiy
This is needed for io_paral test.
2009-05-08libmtd: make type_str to be an arrayArtem Bityutskiy
This is a prepearation to the coming sysfs interface support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libmtd: rename num fieldArtem Bityutskiy
This is a preparation for the coming sysfs support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libmtd: rename rdonly fieldArtem Bityutskiy
This is a preparation for the coming sysfs support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libmtd: rename allows_bb fieldArtem Bityutskiy
This is a preparation for the coming sysfs support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08mtd-utils: minor amendments in crc32.hArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libubigen: add missing includeArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08libubi: do not use udevsettleArtem Bityutskiy
Not sure why, but udevsettle does not work when threads are used. In the io_paral test I experience the problem when udevsettle opens UBI volumes and prevents tests to open them (EBUSY is returned). Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-07ubiformat: fix build errorArtem Bityutskiy
src/ubiformat.c: In function ‘main’: src/ubiformat.c:741: error: too many arguments to function ‘libubi_open’
2009-05-07ubi-utils: remove debugging leftoversArtem Bityutskiy
Remove -g -O0 which I accidentally introduce. Sorry for that. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-22libubi: improve errors handlingArtem Bityutskiy
Improve comments about what is returned if UBI device or node does not exist. Better check for ENODEV error code. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-22libubi: improve libubi_open interfaceArtem Bityutskiy
Remove the not very nice @required parameter, and add a possibility to distinguish between real errors and a situation when UBI is not present. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-20libmtd: rename mtd_infoArtem Bityutskiy
Rename 'struct mtd_info' to 'struct mtd_dev_info' to reflect the fact that it provides information about a specific MTD device. Also, this is more consistent with libubi. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-20libmtd: rename mtd_get_infoArtem Bityutskiy
Rename 'mtd_get_info()' into 'mtd_get_dev_info()' to be consistent to libubi. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-20ubi-utils: rename ubi_node_typeArtem Bityutskiy
Re-name the 'ubi_node_type()' function to a more meaningful name: 'ubi_probe_node()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-20ubinfo: handle -d correctlyArtem Bityutskiy
Fix ubinfo utility and make it handle -d parameter correctly. Without this patch it simple refuses working with -d. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-04-18ubiformat: increase version to 1.2Artem Bityutskiy
The previous patch fixed a nasty bug, so it is nice to increase program version to reflect that. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>