]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
wic: Add gpt-hybrid partition layout
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 30 Aug 2023 14:20:17 +0000 (08:20 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Sep 2023 10:47:39 +0000 (11:47 +0100)
commite50e4c2a5ada6947b3503ca4d8e9c30d359e8a5d
tree70e387cdab02df9abe3ec1832bc8f05dd444542d
parent6ca7fe3d9f209a05daf094ad051175cf56b5cebd
wic: Add gpt-hybrid partition layout

Add support for formatting a disk with a hybrid MBR & GPT partition
scheme. In this scheme, the primary partitioning method is GPT, but a
valid MBR header is also written than can point to a subset of the GPT
partitions on the disk (any partitions marked with the `--mbr` flag will
be included in this MBR). The primary purpose of this method is to allow
for SoCs that can only find a bootloader in an MBR partition to use GPT
once the bootloader is running. As an example, older versions of the
Raspberry Pi firmware can only parse MBR partitions to find a kernel (or
other bootloader like u-boot), but once those have booted GPT partitions
can be used.

In addition to the partitions annotated with the `--mbr`, a "protective"
GPT partition of type 0xEE is added, as the existence of such a
partition is the indication to tooling that this a hybrid MBR and that
the GPT partition table should be parsed instead.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/ksparser.py
scripts/lib/wic/partition.py
scripts/lib/wic/plugins/imager/direct.py