summaryrefslogtreecommitdiffstats
path: root/common/partitions.c
Commit message (Collapse)AuthorAgeFilesLines
* of: partitions: flag partitions from a partition tableSascha Hauer2017-03-311-0/+2
| | | | | | | | | We are going to call the of_partition_fixup for regular block devices like MMC/SD aswell. Add a flag to partitions indicating they are instanciated from a on-disk partition table so that they won't be added as device tree partitions during fixup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+1
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partition: Create links with partition namesSascha Hauer2016-01-081-13/+7
| | | | | | | When a partition has a name create a link to the original partition rather than registering a second cdev. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: Add partuuid string to struct cdevSascha Hauer2015-06-181-0/+1
| | | | | | | | This adds the partuuid string to struct cdev in order to have this available for constructing a suitable Linux root=PARTUUID= option for booting Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: fix mbr filetype detectionZahari Doychev2014-11-051-0/+2
| | | | | | | | | | | | | | Sometimes mbr is erroneously recocognised as FAT partion. Due to this the mbr partition parser is not being called and the partitions on the media are not detected. This patch should fix the problem. The checking is done as in the linux kernel. I have seen the problem using usb sticks. Although partitioning and formatting them under linux. The file system type field in the mbr remains there which causes the wrong detections as FAT32 type and not as mbr. Signed-off-by: Zahari Doychev <zahari.doychev@linux.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: store dos partition type in struct cdevSascha Hauer2013-10-141-1/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: let devfs_add_partition return the new partitionSascha Hauer2013-07-151-4/+8
| | | | | | Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: implement block_read/block_write functionsSascha Hauer2013-05-311-1/+1
| | | | | | | | | Some drivers use blk->ops->read/write. This bypasses the caching block layer and was never intended like this. The upper API to the block layer is the cdev layer. This patch adds block_read and block_write functions and uses them where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/partition: check only for partition table typesHubert Feurstein2013-04-291-2/+2
| | | | | | | | The detection of the partition table fails when we have a barebox image in the MBR. So check only for partition table types. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* disk: introduce partition nameJean-Christophe PLAGNIOL-VILLARD2013-02-161-12/+42
| | | | | | | | so we can register partion with name as present in EFI GPT Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitons: add frameworkJean-Christophe PLAGNIOL-VILLARD2013-02-161-86/+55
| | | | | | | | | | so we can support multiple format use filetpye to detect the parser to use Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2012-11-161-1/+2
|\ | | | | | | | | | | | | Conflicts: commands/Makefile Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common/partitions.c: make use of is_fat_or_mbrFranck Jullien2012-10-121-1/+2
| | | | | | | | | | Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common/paritions.c: force little endian readsFranck Jullien2012-10-121-4/+4
|/ | | | | | | | When reading values from a DOS disk, we need to force a little endian reading. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+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>
* Merge branch 'for-next/size-decrease'Sascha Hauer2012-07-021-1/+1
|\
| * dos partitions: enable disk size guessing only for bios disksSascha Hauer2012-06-281-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dma-cache-align'Sascha Hauer2012-07-021-2/+3
|\ \
| * | partition: Use dma_alloc for allocating buffersSascha Hauer2012-06-301-2/+3
| |/ | | | | | | | | | | | | Drivers may use dma to transfer blocks, so put them into dma save memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / partitions: Make 64bit capableSascha Hauer2012-06-301-29/+0
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dos partitions: Do not register as fixed partitionsSascha Hauer2012-02-171-1/+1
| | | | | | | | A fixed partition means that we can't remove it. This is only suitable for our vital /dev/self0 and /dev/env0 partitions, so remove the fixed flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* DISK: Add common partition handling for disk like mediaJuergen Beisert2011-11-281-0/+200
This covers disk like media like SD card, CF cards, regular hard disks and also USB mass storage devices. Most common used partition table is still of DOS type. This implementation is prepared to support more partition types in the future. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>