summaryrefslogtreecommitdiffstats
path: root/scripts
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:48:24 +0000
commit9773faadfeee0e64fc405e0192f32aa8eca95a76 (patch)
treec927a137b056131f11d1295f8b8573632d78e421 /scripts
parent4515186bc4427a67ee34b43c733ad593ea6837d9 (diff)
downloadpoky-9773faadfeee0e64fc405e0192f32aa8eca95a76.tar.gz
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>
Diffstat (limited to 'scripts')
-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):
97 return default 97 return default
98 return int(kickstart.handler.bootloader.timeout) 98 return int(kickstart.handler.bootloader.timeout)
99 99
100def get_bootloader_file(kickstart, default=None):
101 if not hasattr(kickstart.handler.bootloader, "configfile"):
102 return default
103 if kickstart.handler.bootloader.configfile is None:
104 return default
105 return kickstart.handler.bootloader.configfile
106
100def get_kernel_args(kickstart, default="ro rd.live.image"): 107def get_kernel_args(kickstart, default="ro rd.live.image"):
101 if not hasattr(kickstart.handler.bootloader, "appendLine"): 108 if not hasattr(kickstart.handler.bootloader, "appendLine"):
102 return default 109 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):
35 self.menus = "" 35 self.menus = ""
36 self.ptable = "msdos" 36 self.ptable = "msdos"
37 self.source = "" 37 self.source = ""
38 self.configfile = ""
38 39
39 def _getArgsAsStr(self): 40 def _getArgsAsStr(self):
40 retval = F8_Bootloader._getArgsAsStr(self) 41 retval = F8_Bootloader._getArgsAsStr(self)
@@ -45,6 +46,8 @@ class Wic_Bootloader(F8_Bootloader):
45 retval += " --ptable=\"%s\"" %(self.ptable,) 46 retval += " --ptable=\"%s\"" %(self.ptable,)
46 if self.source: 47 if self.source:
47 retval += " --source=%s" % self.source 48 retval += " --source=%s" % self.source
49 if self.configfile:
50 retval += " --configfile=%s" % self.configfile
48 51
49 return retval 52 return retval
50 53
@@ -56,5 +59,7 @@ class Wic_Bootloader(F8_Bootloader):
56 # use specified source plugin to implement bootloader-specific methods 59 # use specified source plugin to implement bootloader-specific methods
57 parser.add_option("--source", type="string", action="store", 60 parser.add_option("--source", type="string", action="store",
58 dest="source", default=None) 61 dest="source", default=None)
62 parser.add_option("--configfile", type="string", action="store",
63 dest="configfile", default=None)
59 return parser 64 return parser
60 65