diff options
-rw-r--r-- | scripts/lib/wic/utils/partitionedfs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 87d2929f6c..162f8e1b9c 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py | |||
@@ -29,6 +29,9 @@ from wic.utils.oe.misc import * | |||
29 | # Overhead of the MBR partitioning scheme (just one sector) | 29 | # Overhead of the MBR partitioning scheme (just one sector) |
30 | MBR_OVERHEAD = 1 | 30 | MBR_OVERHEAD = 1 |
31 | 31 | ||
32 | # Overhead of the GPT partitioning scheme | ||
33 | GPT_OVERHEAD = 34 | ||
34 | |||
32 | # Size of a sector in bytes | 35 | # Size of a sector in bytes |
33 | SECTOR_SIZE = 512 | 36 | SECTOR_SIZE = 512 |
34 | 37 | ||
@@ -122,7 +125,7 @@ class Image: | |||
122 | 125 | ||
123 | msger.debug("Assigning %s partitions to disks" % ptable_format) | 126 | msger.debug("Assigning %s partitions to disks" % ptable_format) |
124 | 127 | ||
125 | if ptable_format not in ('msdos'): | 128 | if ptable_format not in ('msdos', 'gpt'): |
126 | raise ImageError("Unknown partition table format '%s', supported " \ | 129 | raise ImageError("Unknown partition table format '%s', supported " \ |
127 | "formats are: 'msdos'" % ptable_format) | 130 | "formats are: 'msdos'" % ptable_format) |
128 | 131 | ||
@@ -156,6 +159,8 @@ class Image: | |||
156 | if d['numpart'] == 1: | 159 | if d['numpart'] == 1: |
157 | if ptable_format == "msdos": | 160 | if ptable_format == "msdos": |
158 | overhead = MBR_OVERHEAD | 161 | overhead = MBR_OVERHEAD |
162 | elif ptable_format == "gpt": | ||
163 | overhead = GPT_OVERHEAD | ||
159 | 164 | ||
160 | # Skip one sector required for the partitioning scheme overhead | 165 | # Skip one sector required for the partitioning scheme overhead |
161 | d['offset'] += overhead | 166 | d['offset'] += overhead |
@@ -214,6 +219,8 @@ class Image: | |||
214 | # minumim disk sizes. | 219 | # minumim disk sizes. |
215 | for disk_name, d in self.disks.items(): | 220 | for disk_name, d in self.disks.items(): |
216 | d['min_size'] = d['offset'] | 221 | d['min_size'] = d['offset'] |
222 | if d['ptable_format'] == "gpt": | ||
223 | d['min_size'] += GPT_OVERHEAD | ||
217 | 224 | ||
218 | d['min_size'] *= self.sector_size | 225 | d['min_size'] *= self.sector_size |
219 | 226 | ||