summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/kickstart/custom_commands/partition.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/kickstart/custom_commands/partition.py')
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py41
1 files changed, 30 insertions, 11 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 045b290ed3..dd6edd2f10 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -28,7 +28,7 @@ import os
28import tempfile 28import tempfile
29import uuid 29import uuid
30 30
31from pykickstart.commands.partition import * 31from pykickstart.commands.partition import FC4_PartData, FC4_Partition
32from wic.utils.oe.misc import * 32from wic.utils.oe.misc import *
33from wic.kickstart.custom_commands import * 33from wic.kickstart.custom_commands import *
34from wic.plugin import pluginmgr 34from wic.plugin import pluginmgr
@@ -39,13 +39,16 @@ partition_methods = {
39 "do_configure_partition":None, 39 "do_configure_partition":None,
40} 40}
41 41
42class Wic_PartData(Mic_PartData): 42class Wic_PartData(FC4_PartData):
43 removedKeywords = Mic_PartData.removedKeywords 43 removedKeywords = FC4_PartData.removedKeywords
44 removedAttrs = Mic_PartData.removedAttrs 44 removedAttrs = FC4_PartData.removedAttrs
45 45
46 def __init__(self, *args, **kwargs): 46 def __init__(self, *args, **kwargs):
47 Mic_PartData.__init__(self, *args, **kwargs) 47 FC4_PartData.__init__(self, *args, **kwargs)
48 self.deleteRemovedAttrs() 48 self.deleteRemovedAttrs()
49 self.align = kwargs.get("align", None)
50 self.extopts = kwargs.get("extopts", None)
51 self.part_type = kwargs.get("part_type", None)
49 self.source = kwargs.get("source", None) 52 self.source = kwargs.get("source", None)
50 self.sourceparams = kwargs.get("sourceparams", None) 53 self.sourceparams = kwargs.get("sourceparams", None)
51 self.rootfs = kwargs.get("rootfs-dir", None) 54 self.rootfs = kwargs.get("rootfs-dir", None)
@@ -59,8 +62,14 @@ class Wic_PartData(Mic_PartData):
59 self.size = 0 62 self.size = 0
60 63
61 def _getArgsAsStr(self): 64 def _getArgsAsStr(self):
62 retval = Mic_PartData._getArgsAsStr(self) 65 retval = FC4_PartData._getArgsAsStr(self)
63 66
67 if self.align:
68 retval += " --align=%d" % self.align
69 if self.extopts:
70 retval += " --extoptions=%s" % self.extopts
71 if self.part_type:
72 retval += " --part-type=%s" % self.part_type
64 if self.source: 73 if self.source:
65 retval += " --source=%s" % self.source 74 retval += " --source=%s" % self.source
66 if self.sourceparams: 75 if self.sourceparams:
@@ -468,9 +477,10 @@ class Wic_PartData(Mic_PartData):
468 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), fs) 477 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), fs)
469 exec_native_cmd(mkswap_cmd, native_sysroot) 478 exec_native_cmd(mkswap_cmd, native_sysroot)
470 479
471class Wic_Partition(Mic_Partition): 480
472 removedKeywords = Mic_Partition.removedKeywords 481class Wic_Partition(FC4_Partition):
473 removedAttrs = Mic_Partition.removedAttrs 482 removedKeywords = FC4_Partition.removedKeywords
483 removedAttrs = FC4_Partition.removedAttrs
474 484
475 def _getParser(self): 485 def _getParser(self):
476 def overhead_cb(option, opt_str, value, parser): 486 def overhead_cb(option, opt_str, value, parser):
@@ -479,7 +489,16 @@ class Wic_Partition(Mic_Partition):
479 (option, value)) 489 (option, value))
480 setattr(parser.values, option.dest, value) 490 setattr(parser.values, option.dest, value)
481 491
482 op = Mic_Partition._getParser(self) 492 op = FC4_Partition._getParser(self)
493
494 # The alignment value is given in kBytes. e.g., value 8 means that
495 # the partition is aligned to start from 8096 byte boundary.
496 op.add_option("--align", type="int", action="store", dest="align",
497 default=None)
498 op.add_option("--extoptions", type="string", action="store", dest="extopts",
499 default=None)
500 op.add_option("--part-type", type="string", action="store", dest="part_type",
501 default=None)
483 # use specified source file to fill the partition 502 # use specified source file to fill the partition
484 # and calculate partition size 503 # and calculate partition size
485 op.add_option("--source", type="string", action="store", 504 op.add_option("--source", type="string", action="store",