summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-11-18 07:39:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-09 08:47:27 +0000
commit8347aee95ea271921c15ea8e580f0ff62325aa26 (patch)
treea8a94a84abffdd74f8c3e58b8f865d6cce068bea /scripts/lib
parent0be4c30aaf03de58d8037a89e342ca0b379a0881 (diff)
downloadopenembedded-core-8347aee95ea271921c15ea8e580f0ff62325aa26.tar.gz
openembedded-core-8347aee95ea271921c15ea8e580f0ff62325aa26.tar.bz2
openembedded-core-8347aee95ea271921c15ea8e580f0ff62325aa26.zip
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/kickstart/__init__.py7
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/wicboot.py5
2 files changed, 12 insertions, 0 deletions
diff --git a/scripts/lib/wic/kickstart/__init__.py b/scripts/lib/wic/kickstart/__init__.py
index c9b0e51f3c..79b39fbf3f 100644
--- a/scripts/lib/wic/kickstart/__init__.py
+++ b/scripts/lib/wic/kickstart/__init__.py
@@ -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
diff --git a/scripts/lib/wic/kickstart/custom_commands/wicboot.py b/scripts/lib/wic/kickstart/custom_commands/wicboot.py
index a3e1852be2..eb17dab6e1 100644
--- a/scripts/lib/wic/kickstart/custom_commands/wicboot.py
+++ b/scripts/lib/wic/kickstart/custom_commands/wicboot.py
@@ -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