summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/engine.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 9ff4394757..018815b966 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -280,7 +280,7 @@ class Disk:
280 def __getattr__(self, name): 280 def __getattr__(self, name):
281 """Get path to the executable in a lazy way.""" 281 """Get path to the executable in a lazy way."""
282 if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck", 282 if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck",
283 "resize2fs", "mkswap", "mkdosfs", "debugfs"): 283 "resize2fs", "mkswap", "mkdosfs", "debugfs","blkid"):
284 aname = "_%s" % name 284 aname = "_%s" % name
285 if aname not in self.__dict__: 285 if aname not in self.__dict__:
286 setattr(self, aname, find_executable(name, self.paths)) 286 setattr(self, aname, find_executable(name, self.paths))
@@ -543,7 +543,8 @@ class Disk:
543 logger.info("creating swap partition {}".format(pnum)) 543 logger.info("creating swap partition {}".format(pnum))
544 label = part.get("name") 544 label = part.get("name")
545 label_str = "-L {}".format(label) if label else '' 545 label_str = "-L {}".format(label) if label else ''
546 uuid = part.get("uuid") 546 out = exec_cmd("{} --probe {}".format(self.blkid, self._get_part_image(pnum)))
547 uuid = out[out.index("UUID=\"")+6:out.index("UUID=\"")+42]
547 uuid_str = "-U {}".format(uuid) if uuid else '' 548 uuid_str = "-U {}".format(uuid) if uuid else ''
548 with open(partfname, 'w') as sparse: 549 with open(partfname, 'w') as sparse:
549 os.ftruncate(sparse.fileno(), part['size'] * self._lsector_size) 550 os.ftruncate(sparse.fileno(), part['size'] * self._lsector_size)