summaryrefslogtreecommitdiffstats
path: root/commands/ubi.c
Commit message (Collapse)AuthorAgeFilesLines
* ubimkvol: add support for `volume_id` parameterLeif Middelschulte2018-11-261-3/+7
| | | | | | | | The volume id can be used to refer to a specific volume. This adds support to choose a corresponding argument when creating a UBI volume. Signed-off-by: Leif Middelschulte <leif.middelschulte@gmail.com>
* commands: ubi: ubiupdatevol: Reduce error code to 0 or 1Daniel Schultz2018-01-301-1/+1
| | | | | | | | do_ubiupdatevol can either return 0 or the ioctl return value. This is not in conformity with the other ubi comannds return values. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubi: ubiupdatevol: Open device with O_TRUNCTeresa Remmet2017-01-111-1/+1
| | | | | | | | Static ubi volumes should be opend with O_TRUNC as the device file size equals the content. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: commands: added the new command 'ubirename'.Giorgio Dal Molin2016-09-271-0/+77
| | | | | Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: commands: use function API to access ubi volumesSascha Hauer2016-09-271-9/+30
| | | | | | We have a function API to manipulate ubi volumes, use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubiupdatevol: confirm success with return value 0Ulrich Ölmann2016-09-061-2/+3
| | | | | | | | | Treat the write() case analogously to the read() case and do not return the number of most recently written bytes as the status of sucessful command execution. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubiupdatevol: store return value of read() in a signed intUlrich Ölmann2016-09-061-2/+1
| | | | | | | With an unsigned int test for errors from read() can never become true. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubi: Add ubiupdatevol commandTeresa Remmet2016-06-281-0/+87
| | | | | | | | Add ubiupdatevol command. This is to update static and dynamic volumes. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubimkvol: Add option for static volumesTeresa Remmet2016-06-281-7/+25
| | | | | | | | Creating static volumes in barebox already works, only the option was missing. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: ubidetach: Allow mtd devices as argumentSascha Hauer2016-04-081-4/+26
| | | | | | | Instead of only allow ubi numbers make it possible to detach a mtd device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: make ubi_detach_mtd_dev ubi internalSascha Hauer2016-04-081-1/+1
| | | | | | | | | | We want to extend the functionality of the ubi detach function, but we don't want to change the original detach function to make UBI updates easier. This adds a barebox specific detach function which encapsulates the original UBI function. Also this makes the original ubi detach function internal to ubi. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix 'new blank line at EOF' formatting errorAntony Pavlov2015-07-021-1/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: add setting devnum to ubiattachMichael Grzeschik2014-09-011-3/+8
| | | | | | | | Sometimes we need to have a defined devicenumber for the ubi partitions. This patch adds the option to ubiattach. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | | | | | | | | | | | | 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>
* ubi: Fix for creating ubi volumes with 64bit sizeDmitry Lavnikevich2014-03-121-2/+2
| | | | | | | | | Since MTD is already supports >= 4GB device sizes it is better to allow ubi valumes also be created of larger sizes. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command: ubiattach: add option to pass VID offsetJean-Christophe PLAGNIOL-VILLARD2013-09-181-4/+16
| | | | | | | | | | use the same option as linux -O as example due to a bug in already deployed kernel we must for the VID offset at 512 even it should be at 256 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: reimport UBI from Linux v3.10Sascha Hauer2013-07-251-1/+1
| | | | | | | | | | | This is a fresh UBI import from Linux v3.10 This is done mainly to get fastmap support. This was tested with the i.MX nand driver, the MXS nand driver and on CFI NOR flash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubiattach command: Properly check return valuesSascha Hauer2013-07-231-4/+9
| | | | | | | | | - print error when ioctl fails, not a combined message when one of ioctl or ubi_attach_mtd_dev failed. - ubi_attach_mtd_dev() returns the ubi number for success, not 0, so check for ret < 0 to detect errors. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* UBI: Add ubidetach commandSascha Hauer2013-07-231-0/+26
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubimkvol: Typo fixAlexander Shiyan2013-04-221-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ubi: consolidate ubi-media.hWolfram Sang2012-12-191-1/+1
| | | | | | | | We have two versions in the tree. Use the newer one, and put it into the mtd directory while we are at it. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-3/+3
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add UBI commands: ubiattach, ubidetach, ubimkvol, ubirmvolSascha Hauer2010-07-051-0/+129
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>