summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/imager/direct.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/imager/direct.py')
-rw-r--r--scripts/lib/wic/imager/direct.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 83f9688878..36150c9ad3 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -346,27 +346,23 @@ class DirectImageCreator(BaseImageCreator):
346 346
347 msger.info(msg) 347 msger.info(msg)
348 348
349 def _get_boot_config(self): 349 @property
350 def rootdev(self):
350 """ 351 """
351 Return the rootdev/root_part_uuid (if specified by 352 Get root device name to use as a 'root' parameter
352 --part-type) 353 in kernel command line.
353 354
354 Assume partition order same as in wks 355 Assume partition order same as in wks
355 """ 356 """
356 rootdev = None
357 root_part_uuid = None
358 parts = self._get_parts() 357 parts = self._get_parts()
359 for num, p in enumerate(parts, 1): 358 for num, part in enumerate(parts, 1):
360 if p.mountpoint == "/": 359 if part.mountpoint == "/":
361 part = '' 360 if part.uuid:
362 if p.disk.startswith('mmcblk'): 361 return "PARTUUID=%s" % part.uuid
363 part = 'p' 362 else:
364 363 suffix = 'p' if part.disk.startswith('mmcblk') else ''
365 pnum = self.__get_part_num(num, parts) 364 pnum = self.__get_part_num(num, parts)
366 rootdev = "/dev/%s%s%-d" % (p.disk, part, pnum) 365 return "/dev/%s%s%-d" % (part.disk, suffix, pnum)
367 root_part_uuid = p.part_type
368
369 return (rootdev, root_part_uuid)
370 366
371 def _cleanup(self): 367 def _cleanup(self):
372 if not self.__image is None: 368 if not self.__image is None: