aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils/src/ubinize.c
AgeCommit message (Collapse)Author
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-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-04-09mtd-utils: switch ubi and ubifs tools to use common strtoX funcsArtem Bityutskiy
Instead of using strtol and Co directly, use our share simple_strtoX() helpers. This is just a cleanup. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-27ubi-utils: tweak const strings declsMike Frysinger
Shrink the data size a little by declaring addresses of constant strings instead of pointers to it. Also slip in static & const on long_options missing them. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-27mtd-utils: standardize PROGRAM_NAMEMike Frysinger
Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-07-17libs: remove ubiutils-specific stuff from common.hArtem Bityutskiy
Now include/common.h contains things that really everyone can use. And all the stuff specific to ubi-utils is in ubi-utils/include/ubiutils-common.h 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-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-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-03-17ubi-utils: re-arrange directory layoutArtem Bityutskiy
Move new-utils to ubi-utils and old ones to ubi-utils/old-utils. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-02-19Revert ubi-tools changesArtem Bityutskiy
Restore ubi tools to their "original" state, which means to the state they were before I stareted cleaning them up. Instead, create a "new-utils" subdirectory and move my work there. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-02-16ubinize: bugfix in parsing image size stringArtem Bityutskiy
This is a copy-paste problem: copied, but forgot to change the argument. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-02-06ubi-tools: improve printing macrosArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-02-01ubi-tools: fix ubinizeAdrian Hunter
ubinize reserves 2 eraseblocks for the volume table at the start of the output file and then never seeked back to the start of the file. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-24ubinize: remove dead codeArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-24ubinize: add autoresize flag supportArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-24ubi-utils: check image file size in ubinizeArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-24ubi-utils: add ubinize documentationArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-23ubi-utils: remove all old toolsArtem Bityutskiy
Remove all old tools because I cannot maintain them and the original authors do not seem to have time for this. Some of the tools do not work properly, some are just vague and undocumented and seem to be oriented to the environment of the IBM guys. Nevertheless, I'll return the tool as is in the next commit, becouse they are still useful. This commit also adds a ubinize utility to generate UBI images. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>