diff options
| author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-02-10 00:46:44 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-14 08:40:59 +0000 |
| commit | 8102bd01721e4e1f0ef94f9c7b005987ac4b21ba (patch) | |
| tree | 36e59ccefad0501fc707cf3e05a10e4f90863f2e /scripts/lib/wic/utils/partitionedfs.py | |
| parent | fa818fbb7b5449bd98f2e5d70f62698b52af830f (diff) | |
| download | poky-8102bd01721e4e1f0ef94f9c7b005987ac4b21ba.tar.gz | |
wic: add GPT support
Add GPT partition table support.
(From OE-Core rev: a3479ab45d89273b4474ca54517554fc5346da32)
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/utils/partitionedfs.py')
| -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 | ||
