Used bootloader.timeout instead of kickstart.get_timeout getter.
Accessing attributes instead of getting them with getters is
more pythonic, shorter and readable. It also more consistent as
most of partition and bootloader attributes are used this way.
This change also takes care of appendLine bootloader attribute:
it's renamed to bootloader.append attribute provided by new parser.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
grubefi_conf = ""
grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
grubefi_conf += "default=boot\n"
- timeout = kickstart.get_timeout(creator.ks)
- if not timeout:
- timeout = 0
- grubefi_conf += "timeout=%s\n" % timeout
+ grubefi_conf += "timeout=%s\n" % bootloader.timeout
grubefi_conf += "menuentry 'boot'{\n"
kernel = "/bzImage"
grubefi_conf += "linux %s root=%s rootwait %s\n" \
- % (kernel, creator.rootdev, options)
+ % (kernel, creator.rootdev, bootloader.append)
grubefi_conf += "}\n"
msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \
install_cmd = "install -d %s/loader/entries" % hdddir
exec_cmd(install_cmd)
- options = creator.ks.handler.bootloader.appendLine
-
- timeout = kickstart.get_timeout(creator.ks)
- if not timeout:
- timeout = 0
+ bootloader = creator.ks.bootloader
loader_conf = ""
loader_conf += "default boot\n"
- loader_conf += "timeout %d\n" % timeout
+ loader_conf += "timeout %d\n" % bootloader.timeout
msger.debug("Writing gummiboot config %s/hdd/boot/loader/loader.conf" \
% cr_workdir)
boot_conf = ""
boot_conf += "title boot\n"
boot_conf += "linux %s\n" % kernel
- boot_conf += "options LABEL=Boot root=%s %s\n" % (creator.rootdev, options)
+ boot_conf += "options LABEL=Boot root=%s %s\n" % \
+ (creator.rootdev, bootloader.append)
msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \
% cr_workdir)
else:
splashline = ""
- options = creator.ks.handler.bootloader.appendLine
-
syslinux_conf = ""
syslinux_conf += "PROMPT 0\n"
- timeout = kickstart.get_timeout(creator.ks)
- if not timeout:
- timeout = 0
- syslinux_conf += "TIMEOUT " + str(timeout) + "\n"
+ syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
syslinux_conf += "\n"
syslinux_conf += "ALLOWOPTIONS 1\n"
syslinux_conf += "SERIAL 0 115200\n"
syslinux_conf += "KERNEL " + kernel + "\n"
syslinux_conf += "APPEND label=boot root=%s %s\n" % \
- (creator.rootdev, options)
+ (creator.rootdev, bootloader.append)
msger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg" \
% cr_workdir)
else:
splashline = ""
- options = creator.ks.handler.bootloader.appendLine
-
- timeout = kickstart.get_timeout(creator.ks, 10)
+ bootloader = creator.ks.bootloader
syslinux_conf = ""
syslinux_conf += "PROMPT 0\n"
- syslinux_conf += "TIMEOUT %s \n" % timeout
+ syslinux_conf += "TIMEOUT %s \n" % (bootloader.timeout or 10)
syslinux_conf += "\n"
syslinux_conf += "ALLOWOPTIONS 1\n"
syslinux_conf += "SERIAL 0 115200\n"
kernel = "/bzImage"
syslinux_conf += "KERNEL " + kernel + "\n"
- syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" % options
+ syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" \
+ % bootloader.append
msger.debug("Writing syslinux config %s/ISO/isolinux/isolinux.cfg" \
% cr_workdir)
else:
splashline = ""
- options = creator.ks.handler.bootloader.appendLine
+ bootloader = creator.ks.bootloader
grubefi_conf = ""
grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
grubefi_conf += "--parity=no --stop=1\n"
grubefi_conf += "default=boot\n"
- timeout = kickstart.get_timeout(creator.ks, 10)
- grubefi_conf += "timeout=%s\n" % timeout
+ grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
grubefi_conf += "\n"
grubefi_conf += "search --set=root --label %s " % part.label
grubefi_conf += "\n"
kernel = "/bzImage"
grubefi_conf += "linux %s rootwait %s\n" \
- % (kernel, options)
+ % (kernel, bootloader.append)
grubefi_conf += "initrd /initrd \n"
grubefi_conf += "}\n"
syslinux_conf = ""
syslinux_conf += "PROMPT 0\n"
- timeout = kickstart.get_timeout(image_creator.ks)
- if not timeout:
- timeout = 0
- syslinux_conf += "TIMEOUT " + str(timeout) + "\n"
+ syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
syslinux_conf += "ALLOWOPTIONS 1\n"
# Derive SERIAL... line from from kernel boot parameters