msger.info(msg)
- def _get_boot_config(self):
+ @property
+ def rootdev(self):
"""
- Return the rootdev/root_part_uuid (if specified by
- --part-type)
+ Get root device name to use as a 'root' parameter
+ in kernel command line.
Assume partition order same as in wks
"""
- rootdev = None
- root_part_uuid = None
parts = self._get_parts()
- for num, p in enumerate(parts, 1):
- if p.mountpoint == "/":
- part = ''
- if p.disk.startswith('mmcblk'):
- part = 'p'
-
- pnum = self.__get_part_num(num, parts)
- rootdev = "/dev/%s%s%-d" % (p.disk, part, pnum)
- root_part_uuid = p.part_type
-
- return (rootdev, root_part_uuid)
+ for num, part in enumerate(parts, 1):
+ if part.mountpoint == "/":
+ if part.uuid:
+ return "PARTUUID=%s" % part.uuid
+ else:
+ suffix = 'p' if part.disk.startswith('mmcblk') else ''
+ pnum = self.__get_part_num(num, parts)
+ return "/dev/%s%s%-d" % (part.disk, suffix, pnum)
def _cleanup(self):
if not self.__image is None:
else:
splashline = ""
- (rootdev, root_part_uuid) = cr._get_boot_config()
options = cr.ks.handler.bootloader.appendLine
grubefi_conf = ""
kernel = "/bzImage"
if cr.ptable_format in ('msdos', 'gpt'):
- rootstr = rootdev
+ rootstr = cr.rootdev
else:
raise ImageError("Unsupported partition table format found")
install_cmd = "install -d %s/loader/entries" % hdddir
exec_cmd(install_cmd)
- (rootdev, root_part_uuid) = cr._get_boot_config()
options = cr.ks.handler.bootloader.appendLine
timeout = kickstart.get_timeout(cr.ks)
kernel = "/bzImage"
if cr.ptable_format in ('msdos', 'gpt'):
- rootstr = rootdev
+ rootstr = cr.rootdev
else:
raise ImageError("Unsupported partition table format found")
else:
splashline = ""
- (rootdev, root_part_uuid) = cr._get_boot_config()
options = cr.ks.handler.bootloader.appendLine
syslinux_conf = ""
syslinux_conf += "KERNEL " + kernel + "\n"
if cr.ptable_format in ('msdos', 'gpt'):
- rootstr = rootdev
+ rootstr = cr.rootdev
else:
raise ImageError("Unsupported partition table format found")
Called before do_prepare_partition()
"""
- rootdev = image_creator._get_boot_config()[0]
options = image_creator.ks.handler.bootloader.appendLine
syslinux_conf = ""
syslinux_conf += " KERNEL /boot/bzImage\n"
if image_creator.ptable_format in ('msdos', 'gpt'):
- rootstr = rootdev
+ rootstr = image_creator.rootdev
else:
raise ImageError("Unsupported partition table format found")