summaryrefslogtreecommitdiffstats
path: root/common/partitions
Commit message (Collapse)AuthorAgeFilesLines
* partitions: efi: Constify force_gptAndrey Smirnov2018-10-291-1/+1
| | | | | | | No one is modifying 'force_gpt', so constify it to reflect that fact. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: Treat all extended partition types equallyAndrey Smirnov2018-01-221-7/+18
| | | | | | | | | | | | | | | | | | | | Creating logical DOS partitions with fdisk (Fedora 27, fdisk from util-linux 2.30.2) results in extended partition of type 0x05 being created on the device. Partitioned like this, device is succesfully recognized by Linux, but, due to algorithm in dos_partition(), not Barebox. Looking closer at the actual contents of MBR shows that while marked as "Extended partition with CHS addressing" that partition still have all of the LBA adressed fields filled correctly. Given the above and the fact that similar code in Linux kernel (block/partitions/msdos.c) does not make a distinction between types 0x0f and 0x05, port Linux's is_extended_partition() and convert the code to treat types 0x05, 0x0f and 0x85 the same way. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make parameter functions more consistentSascha Hauer2017-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | This patch creates a consitent set of device parameter functions. With this we have: dev_add_param_<type><access> "type" is one of: int32, uint32, int64, uint64, string, mac, ipv4, enum, bitmask The improvement here is that we now can exactly specify the width of the int type parameters and also correctly distinguish between signed and unsigned variables which means that a variable no longer ends up with INT_MAX when it's assigned -1. "access" can be empty for regular read/write parameter, "_ro" for readonly parameters which get their value from a variable pointer in the background or "_fixed" for parameters which are set to a fixed value (without a pointer in the background). Some more exotic types are not (yet) implemented, like dev_add_param_ip_ro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: add partuuid string for logical partitionsUwe Kleine-König2016-05-101-2/+7
| | | | | | | | | | | Commit bc31d85c6e23 ("cdev: Add partuuid string to struct cdev") added partuuid strings for dos partitions but only for the (up to) four primary partitions. Do the same for the logical partitions. Their numbers start at 5 independently of the number of available primary partitions. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: move crc specific stuff to crc.hSascha Hauer2016-04-151-0/+1
| | | | | | | We have a crc.h, so move our crc function prototypes there to further cleanup common.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions/efi: Add partuuid to partition descriptionTrent Piepho2016-01-082-0/+2
| | | | | | | | | | In commit bc31d85c6e23d724664e76bcfc3b2eda778012a3 the partition UUID was added to the partition struct and thence to the cdev(s) for the partition. But just for DOS partitions. Do this for GPT aka EFI partitions too. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: Add partuuid string to struct cdevSascha Hauer2015-06-182-0/+5
| | | | | | | | 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>
* partitions/efi: Fix off-by-one error in 'last_lba'Andrey Smirnov2014-11-111-1/+1
| | | | | | | | LBAs are numbered starting from zero so the last LBA # would be equal to total number of blocks minus one. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add initial EFI architecture supportSascha Hauer2014-07-161-1/+1
| | | | | | | This adds support for running barebox in an EFI environment on X86 PC hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Move efi.h to include/Sascha Hauer2014-07-141-1/+1
| | | | | | | With upcoming EFI payload support the efi.h file will diverge from the kernel, so move it from include/linux/ to include/ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-111-4/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: parse extended partitionUwe Kleine-König2013-11-081-1/+75
| | | | | | | | DOS MBRs might contain an extended partition that holds several logical partitions. Add these to the partitions of the block device. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: don't open code get_unaligned_le32Uwe Kleine-König2013-11-081-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: improve guess of disk sizeUwe Kleine-König2013-11-081-5/+9
| | | | | | | | | | | | The code used to ineffectively take the end of the last partition as guess for the disk size. Better use the end of the partition that has its end rearmost. Also return an unsigned type instead of int as the result is always non-negative. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: store dos partition type in struct cdevSascha Hauer2013-10-142-2/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: dos: fix memory leak in nt disk signatureSascha Hauer2013-06-191-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partition: DOS: Add parameter for the NT disk SignatureSascha Hauer2013-06-021-0/+88
| | | | | | | | | | The NT disk Signature is a unique 32-bit value in the MBR allowing to identify a MSDOS partitioned disk. The signature can be used to specify the Linux rootfs. This patch adds support for the NT disk Signature in the form of a device parameter which can both be read and written. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* partitions: Add missing depends on BLOCKSascha Hauer2013-06-021-0/+1
| | | | | | | The disk partitions use blockdevice functions, so add the corresponding depends on BLOCK. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: implement block_read/block_write functionsSascha Hauer2013-05-311-2/+2
| | | | | | | | | 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>
* disk: partitions: add EFI GUID Partition TableJean-Christophe PLAGNIOL-VILLARD2013-02-184-0/+620
| | | | | | | | | | | | | | | | | | form linux 3.8 so you can have part by num or name not by GUID as this is a non human reading name `---- ffe08000.sata `---- 0x00000000-0x3fffffff: /dev/ata0 `---- 0x00100000-0x063fffff: /dev/ata0.0 `---- 0x00100000-0x063fffff: /dev/ata0.boot `---- 0x06400000-0x3fefffff: /dev/ata0.1 `---- 0x06400000-0x3fefffff: /dev/ata0.linux 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>
* disk: introduce partition nameJean-Christophe PLAGNIOL-VILLARD2013-02-162-1/+3
| | | | | | | | 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-164-0/+137
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>