summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/engine.py
diff options
context:
space:
mode:
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:
237 self.native_sysroot = native_sysroot 237 self.native_sysroot = native_sysroot
238 self._partitions = None 238 self._partitions = None
239 self._partimages = {} 239 self._partimages = {}
240 self._lsector_size = None
241 self._psector_size = None
242 self._ptable_format = None
240 243
241 # find parted 244 # find parted
242 self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/" 245 self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
@@ -258,7 +261,11 @@ class Disk:
258 self._partitions = OrderedDict() 261 self._partitions = OrderedDict()
259 out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath)) 262 out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath))
260 parttype = namedtuple("Part", "pnum start end size fstype") 263 parttype = namedtuple("Part", "pnum start end size fstype")
261 for line in out.splitlines()[2:]: 264 splitted = out.splitlines()
265 lsector_size, psector_size, self._ptable_format = splitted[1].split(":")[3:6]
266 self._lsector_size = int(lsector_size)
267 self._psector_size = int(psector_size)
268 for line in splitted[2:]:
262 pnum, start, end, size, fstype = line.split(':')[:5] 269 pnum, start, end, size, fstype = line.split(':')[:5]
263 partition = parttype(pnum, int(start[:-1]), int(end[:-1]), 270 partition = parttype(pnum, int(start[:-1]), int(end[:-1]),
264 int(size[:-1]), fstype) 271 int(size[:-1]), fstype)