summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-02-10 16:37:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-15 20:06:35 -0800
commitdbd58b0b32288821d9dd5d1a3118cf7c6e8f098a (patch)
tree3e7da95d2535b34b627bc6647b982da3106eabac
parent700aa424f0aa239cf4149eed4bfb1dc7d9677431 (diff)
downloadopenembedded-core-dbd58b0b32288821d9dd5d1a3118cf7c6e8f098a.tar.gz
openembedded-core-dbd58b0b32288821d9dd5d1a3118cf7c6e8f098a.tar.bz2
openembedded-core-dbd58b0b32288821d9dd5d1a3118cf7c6e8f098a.zip
wic: direct: move generation of part.realnum to PartitionedImage
Moved the code that generates real partition numbers from DirectPlugin to PartitionedImage. The idea is to have all code that works with partitions in PartitionedImage class. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 9c4109e6b8..c517904ed1 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -74,19 +74,6 @@ class DirectPlugin(ImagerPlugin):
self.ptable_format = self.ks.bootloader.ptable
self.parts = self.ks.partitions
- # calculate the real partition number, accounting for partitions not
- # in the partition table and logical partitions
- realnum = 0
- for part in self.parts:
- if part.no_table:
- part.realnum = 0
- else:
- realnum += 1
- if self.ptable_format == 'msdos' and realnum > 3:
- part.realnum = realnum + 1
- continue
- part.realnum = realnum
-
# as a convenience, set source to the boot partition source
# instead of forcing it to be set via bootloader --source
for part in self.parts:
@@ -317,6 +304,19 @@ class PartitionedImage():
self.sector_size = SECTOR_SIZE
self.native_sysroot = native_sysroot
+ # calculate the real partition number, accounting for partitions not
+ # in the partition table and logical partitions
+ realnum = 0
+ for part in self.partitions:
+ if part.no_table:
+ part.realnum = 0
+ else:
+ realnum += 1
+ if self.ptable_format == 'msdos' and realnum > 3:
+ part.realnum = realnum + 1
+ continue
+ part.realnum = realnum
+
# generate parition UUIDs
for part in self.partitions:
if not part.uuid and part.use_uuid: