summaryrefslogtreecommitdiffstats
path: root/commands/partition.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused struct partitionSascha Hauer2022-11-231-1/+0
| | | | | | | | struct partition from include/partition.h is entirely unused. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20221117120604.3840211-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-15/+3
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cmdlinepart: add function to parse a cmdline partition stringSascha Hauer2015-02-121-24/+1
| | | | | | | This adds a function to parse a full cmdline partition string. The addpart command is switched to use this function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cmdlinepart: make argument types saferSascha Hauer2015-02-121-2/+2
| | | | | | | The return size should be loff_t to support partitions bigger than 4G. Also use const for the devname and endp. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move cmdline partition parsing code to separate fileSascha Hauer2015-02-121-77/+4
| | | | | | | So it's no longer local to the addpart/delpart code and can be used from other code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-24/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: addpart: Improve descriptionSascha Hauer2014-06-261-7/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | | | | | | | | | | 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>
* mtd: Support for 4GB partitionsDmitry Lavnikevich2014-03-121-2/+2
| | | | | | | | | This patch implements correct way of creating partitions on mtd devices with size >= 4GB. 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>
* mtd: Update internal API to support 64-bit device sizeDmitry Lavnikevich2014-03-121-5/+6
| | | | | | | | | | | | | | | | | | | MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats; - division and modulus of 64-bit values (mtd_div_by_wb, mtd_div_by_eb may be used in some of such cases). Was tested on phyFLEX i.MX6. 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>
* devfs: let devfs_add_partition return the new partitionSascha Hauer2013-07-151-3/+8
| | | | | | Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused debug Kconfig optionsSascha Hauer2013-06-231-4/+0
| | | | | | | | | | | ENABLE_DEVICE_NOISE is used only in two network drivers and is otherwise unused. ENABLE_FLASH_NOISE is completely unused. ENABLE_PARTITION_NOISE enables DEBUG in the partition command, but this code has no debug messages at all. Remove all this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Removed duplicate definition for DEVFS_PARTITION_xxxAlexander Shiyan2012-05-131-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* complete: add delpart complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* addpart: remove duplicate line in help textSascha Hauer2012-04-141-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partition command: optionally do not automatically prepend the device nameSascha Hauer2012-03-181-8/+25
| | | | | | | | | | | | | | | | | | | | | We used to automatically prepend the device name before the partition name. So when we added a partition named 'barebox' to a device named 'nor0' the partition was named 'nor0.barebox'. The Kernel can mount its rootfs based on the mtd name, for example with root=mtd:root. If for example we have multiple mtd devices (nor and nand) 'root' is a bad name for the partition, it should better be 'nor0.root' This patch adds an additional commandline switch to addpart to optionally skip the automatic device name adding. This makes it possible to define our mtd partitions like this: nor_parts="512k(nor0.barebox)ro,128k(nor0.bareboxenv),2M(nor0.kernel),-(nor0.root)" This way the barebox partition names stay the same, but we can now pass the exact name to the kernel (root=mtd:nor0.root). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-2/+2
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: unify documentation for 'delpart'Robert Schwebel2010-11-011-14/+21
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* doc: unify documentation for 'addpart'Robert Schwebel2010-11-011-33/+17
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* doc: add missing quotingRobert Schwebel2010-10-221-1/+1
| | | | | | | | | | Silence this warning: /home/rsc/git/barebox/commands/partition.c:177: Warning: Found unknown command `\offset1' /home/rsc/git/barebox/commands/partition.c:177: Warning: Found unknown command `\offset2' Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: partition.c fix file mod bitsJean-Christophe PLAGNIOL-VILLARD2010-09-201-0/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'pu'Sascha Hauer2010-02-011-2/+2
|\
| * remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-2/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | addpart: support @<offset>Peter Korsgaard2010-01-161-14/+23
|/ | | | | | | | We claim to be compatible with the kernel's cmdlinepart parser, so support <size>@<offset> like the kernel does. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-2/+0
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-191-4/+2
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* introduce cdevSascha Hauer2009-07-211-145/+50
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove warningfredo2008-12-181-1/+1
| | | | | Signed-off-by: Frederic RODO <fred.rodo@gmail.com>
* Revert "partition: fix compiler warning"Sascha Hauer2008-08-271-7/+7
| | | | | | Grumpf. Better compiler warnings than broken code :( This reverts commit 8201d7c5fc46b3355692731f22f0e8631faf51d4.
* partition: fix compiler warningSascha Hauer2008-08-261-7/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partition: rename variableSascha Hauer2008-08-261-13/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Partition: Add an own device id for partitionsSascha Hauer2008-08-141-1/+8
| | | | | | | | Add an own device id for partitions. This is necessary to allow the partition layer to check if the given device is really a partition. Also, check for readonly flag in erase. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Subject: [PATCH] [general] Fixed constant strings in data section issueSascha Hauer2008-04-041-2/+2
| | | | | | | | For practical reasons I changed all string literals assumed to be constant to reside in .rodata subsection at end of .text section. Signed-off-by: Carsten Schlote <schlote@vahanus.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [general] Added more outputs to partition.cCarsten Schlote2008-02-191-13/+25
| | | | | | Added more outputs to partition code. Signed-off-by: Carsten Schlote <schlote@vahanus.net>
* dynamically added partition: check against FIXED partitionsMarc Kleine-Budde2007-11-271-6/+36
| | | | | | | | The dynamic partition adding is improved with this patch. When adding dynamic partitions they are checked against the existing FIXED ones to ensure that they match. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* various doc addedJuergen Beisert2007-11-091-0/+31
| | | | Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
* Merge branch 'master' of jbe@octopus:/home/git/projects/u-boot-v2Juergen Beisert2007-10-191-36/+48
|\
| * Fix documentation for addpart/delpart/devinfo. These commandssascha2007-10-191-10/+7
| | | | | | | | now take a device file, not a device id.
| * - Implement tree structure for devicessascha2007-10-191-26/+41
| | | | | | | | | | | | | | - Use device tree structure to implement partitions - Let devinfo print a nice tree - Introduce 'fixed' partitions which are not removable - Fix mount: It was not possible to mount on a relative path.
* | debug support addedJuergen Beisert2007-10-191-0/+4
|/
* declare lots of functions staticSascha Hauer2007-09-281-2/+2
|
* remove u-boot command paramter flagSascha Hauer2007-09-241-2/+2
|
* implement memmap().Sascha Hauer2007-07-151-0/+1
| | | | | | With this function we can get a pointer to directly memory mapped devices like nor flash or RAM. Useful for bootm where we save one memcopy when the image is mappable
* Lindent commands/partition.cSascha Hauer2007-07-141-107/+108
|
* svn_rev_706Sascha Hauer2007-07-051-0/+23
| | | | add file headers
* svn_rev_651Sascha Hauer2007-07-051-0/+191