diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-09-02 13:58:06 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-03 12:43:26 +0100 |
commit | 282fb044d47521ba130c6767a8f6b0001c2043a3 (patch) | |
tree | b726b73899bf78dee817bc5ffa37cef260f68853 /scripts/lib/wic/kickstart/custom_commands/partition.py | |
parent | 2e2ac0cb7a456eb2e8395ef658ac397dcdb236e2 (diff) | |
download | poky-282fb044d47521ba130c6767a8f6b0001c2043a3.tar.gz |
wic: remove micpartition.py
Moved functionality of Mic_Partition and Mic_PartData classes
from micpartition.py to Wic_Partition and Wic_PartData classes
of partition.py module.
Reduced level of inheritance.
Removed confusing mic legacy names.
(From OE-Core rev: eae139af81262b457cfb8ddf45a99523cc8a41cc)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/kickstart/custom_commands/partition.py')
-rw-r--r-- | scripts/lib/wic/kickstart/custom_commands/partition.py | 41 |
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 | |||
28 | import tempfile | 28 | import tempfile |
29 | import uuid | 29 | import uuid |
30 | 30 | ||
31 | from pykickstart.commands.partition import * | 31 | from pykickstart.commands.partition import FC4_PartData, FC4_Partition |
32 | from wic.utils.oe.misc import * | 32 | from wic.utils.oe.misc import * |
33 | from wic.kickstart.custom_commands import * | 33 | from wic.kickstart.custom_commands import * |
34 | from wic.plugin import pluginmgr | 34 | from wic.plugin import pluginmgr |
@@ -39,13 +39,16 @@ partition_methods = { | |||
39 | "do_configure_partition":None, | 39 | "do_configure_partition":None, |
40 | } | 40 | } |
41 | 41 | ||
42 | class Wic_PartData(Mic_PartData): | 42 | class 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 | ||
471 | class Wic_Partition(Mic_Partition): | 480 | |
472 | removedKeywords = Mic_Partition.removedKeywords | 481 | class 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", |