blob: a3e1852be2102b0eb4588f1969bde09101dc8293 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# 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#
26from pykickstart.commands.bootloader import F8_Bootloader
27
28class Wic_Bootloader(F8_Bootloader):
29 def __init__(self, writePriority=10, appendLine="", driveorder=None,
30 forceLBA=False, location="", md5pass="", password="",
31 upgrade=False, menus=""):
32 F8_Bootloader.__init__(self, writePriority, appendLine, driveorder,
33 forceLBA, location, md5pass, password, upgrade)
34
35 self.menus = ""
36 self.ptable = "msdos"
37 self.source = ""
38
39 def _getArgsAsStr(self):
40 retval = F8_Bootloader._getArgsAsStr(self)
41
42 if self.menus == "":
43 retval += " --menus=%s" %(self.menus,)
44 if self.ptable:
45 retval += " --ptable=\"%s\"" %(self.ptable,)
46 if self.source:
47 retval += " --source=%s" % self.source
48
49 return retval
50
51 def _getParser(self):
52 parser = F8_Bootloader._getParser(self)
53 parser.add_option("--menus", dest="menus")
54 parser.add_option("--ptable", dest="ptable", choices=("msdos", "gpt"),
55 default="msdos")
56 # use specified source plugin to implement bootloader-specific methods
57 parser.add_option("--source", type="string", action="store",
58 dest="source", default=None)
59 return parser
60