diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-02-03 19:16:56 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-04 12:57:35 +0000 |
commit | 363488fc9a045ef7415f0d07777c934a2c452714 (patch) | |
tree | 0381136053606aa9584369241154e66a6fdc2dff | |
parent | 3cb93017e64b409e887e37f255ae49bb4e274465 (diff) | |
download | poky-363488fc9a045ef7415f0d07777c934a2c452714.tar.gz |
wic: Add wic-specific bootloader subclass
Add a new wic-specific bootloader subclass so we can add a --source
param to hang non-partition plugin off of.
By default, the bootloader gets the /boot partition source plugin, but
this can be overridden by the --source bootloader param if needed.
(From OE-Core rev: f90e4097c4e69d4f61c69923cb5d1ebb6b74d2ff)
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/mic/imager/direct.py | 6 | ||||
-rw-r--r-- | scripts/lib/mic/kickstart/__init__.py | 4 | ||||
-rw-r--r-- | scripts/lib/mic/kickstart/custom_commands/wicboot.py | 57 |
3 files changed, 65 insertions, 2 deletions
diff --git a/scripts/lib/mic/imager/direct.py b/scripts/lib/mic/imager/direct.py index d24bc684fe..3827eb8e94 100644 --- a/scripts/lib/mic/imager/direct.py +++ b/scripts/lib/mic/imager/direct.py | |||
@@ -225,6 +225,12 @@ class DirectImageCreator(BaseImageCreator): | |||
225 | 225 | ||
226 | fstab = self.__write_fstab() | 226 | fstab = self.__write_fstab() |
227 | 227 | ||
228 | for p in parts: | ||
229 | # as a convenience, set source to the boot partition source | ||
230 | # instead of forcing it to be set via bootloader --source | ||
231 | if not self.ks.handler.bootloader.source and p.mountpoint == "/boot": | ||
232 | self.ks.handler.bootloader.source = p.source | ||
233 | |||
228 | self.boot_type = self.get_boot_type() | 234 | self.boot_type = self.get_boot_type() |
229 | 235 | ||
230 | if not self.bootimg_dir: | 236 | if not self.bootimg_dir: |
diff --git a/scripts/lib/mic/kickstart/__init__.py b/scripts/lib/mic/kickstart/__init__.py index 7e645caa11..72f3ca6849 100644 --- a/scripts/lib/mic/kickstart/__init__.py +++ b/scripts/lib/mic/kickstart/__init__.py | |||
@@ -32,7 +32,7 @@ from pykickstart.handlers.control import dataMap | |||
32 | 32 | ||
33 | from mic import msger | 33 | from mic import msger |
34 | from mic.utils import errors, misc, runner, fs_related as fs | 34 | from mic.utils import errors, misc, runner, fs_related as fs |
35 | from custom_commands import desktop, micrepo, micboot, partition, installerfw | 35 | from custom_commands import desktop, micrepo, wicboot, partition, installerfw |
36 | 36 | ||
37 | 37 | ||
38 | AUTH_URL_PTN = r"(?P<scheme>.*)://(?P<username>.*)(:?P<password>.*)?@(?P<url>.*)" | 38 | AUTH_URL_PTN = r"(?P<scheme>.*)://(?P<username>.*)(:?P<password>.*)?@(?P<url>.*)" |
@@ -98,7 +98,7 @@ def read_kickstart(path): | |||
98 | using_version = ksversion.DEVEL | 98 | using_version = ksversion.DEVEL |
99 | commandMap[using_version]["desktop"] = desktop.Mic_Desktop | 99 | commandMap[using_version]["desktop"] = desktop.Mic_Desktop |
100 | commandMap[using_version]["repo"] = micrepo.Mic_Repo | 100 | commandMap[using_version]["repo"] = micrepo.Mic_Repo |
101 | commandMap[using_version]["bootloader"] = micboot.Mic_Bootloader | 101 | commandMap[using_version]["bootloader"] = wicboot.Wic_Bootloader |
102 | commandMap[using_version]["part"] = partition.Wic_Partition | 102 | commandMap[using_version]["part"] = partition.Wic_Partition |
103 | commandMap[using_version]["partition"] = partition.Wic_Partition | 103 | commandMap[using_version]["partition"] = partition.Wic_Partition |
104 | commandMap[using_version]["installerfw"] = installerfw.Mic_installerfw | 104 | commandMap[using_version]["installerfw"] = installerfw.Mic_installerfw |
diff --git a/scripts/lib/mic/kickstart/custom_commands/wicboot.py b/scripts/lib/mic/kickstart/custom_commands/wicboot.py new file mode 100644 index 0000000000..ab8871de4e --- /dev/null +++ b/scripts/lib/mic/kickstart/custom_commands/wicboot.py | |||
@@ -0,0 +1,57 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Copyright (c) 2014, Intel Corporation. | ||
5 | # All rights reserved. | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | # | ||
20 | # DESCRIPTION | ||
21 | # This module provides the OpenEmbedded bootloader object definitions. | ||
22 | # | ||
23 | # AUTHORS | ||
24 | # Tom Zanussi <tom.zanussi (at] linux.intel.com> | ||
25 | # | ||
26 | |||
27 | from pykickstart.base import * | ||
28 | from pykickstart.errors import * | ||
29 | from pykickstart.options import * | ||
30 | from pykickstart.commands.bootloader import * | ||
31 | |||
32 | from mic.kickstart.custom_commands.micboot import * | ||
33 | |||
34 | class Wic_Bootloader(Mic_Bootloader): | ||
35 | def __init__(self, writePriority=10, appendLine="", driveorder=None, | ||
36 | forceLBA=False, location="", md5pass="", password="", | ||
37 | upgrade=False, menus=""): | ||
38 | Mic_Bootloader.__init__(self, writePriority, appendLine, driveorder, | ||
39 | forceLBA, location, md5pass, password, upgrade) | ||
40 | |||
41 | self.source = "" | ||
42 | |||
43 | def _getArgsAsStr(self): | ||
44 | retval = Mic_Bootloader._getArgsAsStr(self) | ||
45 | |||
46 | if self.source: | ||
47 | retval += " --source=%s" % self.source | ||
48 | |||
49 | return retval | ||
50 | |||
51 | def _getParser(self): | ||
52 | op = Mic_Bootloader._getParser(self) | ||
53 | # use specified source plugin to implement bootloader-specific methods | ||
54 | op.add_option("--source", type="string", action="store", | ||
55 | dest="source", default=None) | ||
56 | return op | ||
57 | |||