3 # Marko Saukko <marko.saukko@cybercom.com>
5 # Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 # This copyrighted material is made available to anyone wishing to use, modify,
8 # copy, or redistribute it subject to the terms and conditions of the GNU
9 # General Public License v.2. This program is distributed in the hope that it
10 # will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
11 # implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 # See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 from pykickstart.commands.partition import *
20 class Mic_PartData(FC4_PartData):
21 removedKeywords = FC4_PartData.removedKeywords
22 removedAttrs = FC4_PartData.removedAttrs
24 def __init__(self, *args, **kwargs):
25 FC4_PartData.__init__(self, *args, **kwargs)
26 self.deleteRemovedAttrs()
27 self.align = kwargs.get("align", None)
28 self.extopts = kwargs.get("extopts", None)
29 self.part_type = kwargs.get("part_type", None)
30 self.uuid = kwargs.get("uuid", None)
31 self.exclude_image = kwargs.get("exclude_from_image", False)
32 self.vdfsopts = kwargs.get("vdfsopts", None)
33 self.squashfsopts = kwargs.get("squashfsopts", None)
35 def _getArgsAsStr(self):
36 retval = FC4_PartData._getArgsAsStr(self)
41 retval += " --extoptions=%s" % self.extopts
43 retval += " --part-type=%s" % self.part_type
45 retval += " --uuid=%s" % self.uuid
46 if self.exclude_image:
47 retval += " --exclude-from-image"
49 retval += " --vdfsoptions=%s" % self.vdfsopts
51 retval += " --squashfsoptions=%s" % self.squashfsopts
55 class Mic_Partition(FC4_Partition):
56 removedKeywords = FC4_Partition.removedKeywords
57 removedAttrs = FC4_Partition.removedAttrs
60 op = FC4_Partition._getParser(self)
61 # The alignment value is given in kBytes. e.g., value 8 means that
62 # the partition is aligned to start from 8096 byte boundary.
63 op.add_option("--align", type="int", action="store", dest="align",
65 op.add_option("--extoptions", type="string", action="store", dest="extopts",
67 op.add_option("--part-type", type="string", action="store", dest="part_type",
69 op.add_option("--uuid", dest="uuid", action="store", type="string")
70 op.add_option("--exclude-from-image", action="store_true", dest="exclude_image",
72 op.add_option("--vdfsoptions", type="string", action="store", dest="vdfsopts",
74 op.add_option("--squashfsoptions", type="string", action="store", dest="squashfsopts",