aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/engine.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-08-25 23:12:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-27 22:29:46 +0100
commit5c0926d8efa468177b7cb43a5f06b35058255644 (patch)
treee91ee40466c0db532404e8ffca422fb780f19626 /scripts/lib/wic/engine.py
parentd1a831a9870bc31e936eb480485b28f1ffc13080 (diff)
downloadopenembedded-core-contrib-5c0926d8efa468177b7cb43a5f06b35058255644.tar.gz
wic: get more info from the 'parted print' output
Got partition type and sector sizes from the output of 'parted print'. This info may be used in the implementation of 'wic write' command. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/engine.py')
-rw-r--r--scripts/lib/wic/engine.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index b23dd65de2..a965b8b901 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -237,6 +237,9 @@ class Disk:
self.native_sysroot = native_sysroot
self._partitions = None
self._partimages = {}
+ self._lsector_size = None
+ self._psector_size = None
+ self._ptable_format = None
# find parted
self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
@@ -258,7 +261,11 @@ class Disk:
self._partitions = OrderedDict()
out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath))
parttype = namedtuple("Part", "pnum start end size fstype")
- for line in out.splitlines()[2:]:
+ splitted = out.splitlines()
+ lsector_size, psector_size, self._ptable_format = splitted[1].split(":")[3:6]
+ self._lsector_size = int(lsector_size)
+ self._psector_size = int(psector_size)
+ for line in splitted[2:]:
pnum, start, end, size, fstype = line.split(':')[:5]
partition = parttype(pnum, int(start[:-1]), int(end[:-1]),
int(size[:-1]), fstype)