summaryrefslogtreecommitdiffstats
path: root/commands/ubiformat.c
Commit message (Collapse)AuthorAgeFilesLines
* move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: avoid macros in help textJan Luebbe2014-06-261-5/+5
| | | | | | | To simplify parsing of the help strings, we need to avoid using macros there. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: check file sizeJan Weitzel2013-06-241-0/+5
| | | | | | | | | If size of a flash image file is 0 ubiformat silently formats the volume. Check size and abort if size == 0. This may be the case if an empty or tftp mounted file is used. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiformat: get buffer from mallocJan Weitzel2013-04-031-7/+15
| | | | | | | | | There was a erase block sized (here 131072) char buf array on the stack. Changed this to get the space from malloc preventing stack overflows. Also fix a wrong return without clean up. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2013-03-041-4/+4
|\ | | | | | | | | | | Conflicts: arch/arm/configs/eukrea_cpuimx27_defconfig drivers/mtd/core.c
| * libmtd: rename functions from mtd_* to libmtd_*Sascha Hauer2013-02-141-4/+4
| | | | | | | | | | | | | | | | | | | | The kernel nowadays has mtd_read/write and other functions. In barebox we also have these functions, but with a different prototype, namely they correspond to the libmtd userspace functions. Rename these functions to libmtd_* to avoid name clashes with future mtd updates. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ubiformat: open flash image readonlySascha Hauer2013-02-211-1/+1
|/ | | | | | | ubiformat only needs readonly access to the image to flash, so open it readonly. Opening r/w may fail for example on tftp servers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fixup! commands: add ubiformatSascha Hauer2013-01-091-0/+784
This adds the missing ubiformat.c file missing from: commit 5a29d4aea71336558e13eb6ad8e662781653ae56 Author: Wolfram Sang <w.sang@pengutronix.de> Date: Mon Dec 17 16:48:33 2012 +0100 commands: add ubiformat Imported from mtd-utils and stripped down to needed functionality. Based on an older version (1.4.5.) since the newer do use MEMWRITE interfaces which we don't have in barebox (yet). Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>