diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-08-30 08:20:17 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-02 11:47:50 +0100 |
commit | 93388921ab6fa78658461eefbf0b7beae5a52a9d (patch) | |
tree | cf5c32d3c8621b43cb2aa0e8cc73ed687e50028e /scripts/lib/wic/ksparser.py | |
parent | 9d9c7d4b0bb8fe7681496804b7afe8fc2d967419 (diff) | |
download | poky-93388921ab6fa78658461eefbf0b7beae5a52a9d.tar.gz |
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.
(From OE-Core rev: e50e4c2a5ada6947b3503ca4d8e9c30d359e8a5d)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/ksparser.py')
-rw-r--r-- | scripts/lib/wic/ksparser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py index 667b2ff9c3..7ef3dc83dd 100644 --- a/scripts/lib/wic/ksparser.py +++ b/scripts/lib/wic/ksparser.py | |||
@@ -188,11 +188,12 @@ class KickStart(): | |||
188 | part.add_argument('--uuid') | 188 | part.add_argument('--uuid') |
189 | part.add_argument('--fsuuid') | 189 | part.add_argument('--fsuuid') |
190 | part.add_argument('--no-fstab-update', action='store_true') | 190 | part.add_argument('--no-fstab-update', action='store_true') |
191 | part.add_argument('--mbr', action='store_true') | ||
191 | 192 | ||
192 | bootloader = subparsers.add_parser('bootloader') | 193 | bootloader = subparsers.add_parser('bootloader') |
193 | bootloader.add_argument('--append') | 194 | bootloader.add_argument('--append') |
194 | bootloader.add_argument('--configfile') | 195 | bootloader.add_argument('--configfile') |
195 | bootloader.add_argument('--ptable', choices=('msdos', 'gpt'), | 196 | bootloader.add_argument('--ptable', choices=('msdos', 'gpt', 'gpt-hybrid'), |
196 | default='msdos') | 197 | default='msdos') |
197 | bootloader.add_argument('--timeout', type=int) | 198 | bootloader.add_argument('--timeout', type=int) |
198 | bootloader.add_argument('--source') | 199 | bootloader.add_argument('--source') |