wic: Prepare wicboot to allow custom bootloader config

Currently wic does the bootloader configuration file on the fly.
This change introduce a configfile variable for the bootloader;
this is to have a user defined configuration file for the
bootloaders (grub, syslinux, and gummiboot). This is particular
useful when having a multiboot system or scripts embedded in the
configuration file.

[YOCTO #8728]

(From OE-Core rev: 8347aee95ea271921c15ea8e580f0ff62325aa26)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mariano Lopez 2015-11-18 07:39:07 +00:00 committed by Richard Purdie
parent 4515186bc4
commit 9773faadfe
2 changed files with 12 additions and 0 deletions

View File

@ -97,6 +97,13 @@ def get_timeout(kickstart, default=None):
return default
return int(kickstart.handler.bootloader.timeout)
def get_bootloader_file(kickstart, default=None):
if not hasattr(kickstart.handler.bootloader, "configfile"):
return default
if kickstart.handler.bootloader.configfile is None:
return default
return kickstart.handler.bootloader.configfile
def get_kernel_args(kickstart, default="ro rd.live.image"):
if not hasattr(kickstart.handler.bootloader, "appendLine"):
return default

View File

@ -35,6 +35,7 @@ class Wic_Bootloader(F8_Bootloader):
self.menus = ""
self.ptable = "msdos"
self.source = ""
self.configfile = ""
def _getArgsAsStr(self):
retval = F8_Bootloader._getArgsAsStr(self)
@ -45,6 +46,8 @@ class Wic_Bootloader(F8_Bootloader):
retval += " --ptable=\"%s\"" %(self.ptable,)
if self.source:
retval += " --source=%s" % self.source
if self.configfile:
retval += " --configfile=%s" % self.configfile
return retval
@ -56,5 +59,7 @@ class Wic_Bootloader(F8_Bootloader):
# use specified source plugin to implement bootloader-specific methods
parser.add_option("--source", type="string", action="store",
dest="source", default=None)
parser.add_option("--configfile", type="string", action="store",
dest="configfile", default=None)
return parser