summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-02-10 00:46:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-14 08:40:35 +0000
commita3479ab45d89273b4474ca54517554fc5346da32 (patch)
tree92ce5d7e2ca92bf15f5a57f8f8b8339e0377053d /scripts
parent93e2de4f4b71775d70ac2ccb7e2d26ca95b96186 (diff)
downloadopenembedded-core-a3479ab45d89273b4474ca54517554fc5346da32.tar.gz
openembedded-core-a3479ab45d89273b4474ca54517554fc5346da32.tar.bz2
openembedded-core-a3479ab45d89273b4474ca54517554fc5346da32.zip
wic: add GPT support
Add GPT partition table support. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/utils/partitionedfs.py9
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 *
# Overhead of the MBR partitioning scheme (just one sector)
MBR_OVERHEAD = 1
+# Overhead of the GPT partitioning scheme
+GPT_OVERHEAD = 34
+
# Size of a sector in bytes
SECTOR_SIZE = 512
@@ -122,7 +125,7 @@ class Image:
msger.debug("Assigning %s partitions to disks" % ptable_format)
- if ptable_format not in ('msdos'):
+ if ptable_format not in ('msdos', 'gpt'):
raise ImageError("Unknown partition table format '%s', supported " \
"formats are: 'msdos'" % ptable_format)
@@ -156,6 +159,8 @@ class Image:
if d['numpart'] == 1:
if ptable_format == "msdos":
overhead = MBR_OVERHEAD
+ elif ptable_format == "gpt":
+ overhead = GPT_OVERHEAD
# Skip one sector required for the partitioning scheme overhead
d['offset'] += overhead
@@ -214,6 +219,8 @@ class Image:
# minumim disk sizes.
for disk_name, d in self.disks.items():
d['min_size'] = d['offset']
+ if d['ptable_format'] == "gpt":
+ d['min_size'] += GPT_OVERHEAD
d['min_size'] *= self.sector_size