summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/kickstart/custom_commands/partition.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-02 13:58:16 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-02 23:46:52 +0100
commit872cb0d5d79b26f34e6b35d7be8870d245021be4 (patch)
tree37cc334e9769e40e1df60e777e934ee7a404282f /scripts/lib/wic/kickstart/custom_commands/partition.py
parentaf0a6d547a5a3efefdd4900f7079dfd10b85342d (diff)
downloadopenembedded-core-872cb0d5d79b26f34e6b35d7be8870d245021be4.tar.gz
wic: fix short variable names
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". 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.py72
1 files changed, 36 insertions, 36 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index bac2067a5a..eee25a493d 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -154,7 +154,7 @@ class Wic_PartData(FC4_PartData):
else:
return 0
- def prepare(self, cr, cr_workdir, oe_builddir, rootfs_dir, bootimg_dir,
+ def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir, bootimg_dir,
kernel_dir, native_sysroot):
"""
Prepare content for individual partitions, depending on
@@ -199,18 +199,18 @@ class Wic_PartData(FC4_PartData):
self._source_methods = pluginmgr.get_source_plugin_methods(\
self.source, partition_methods)
self._source_methods["do_configure_partition"](self, self.sourceparams_dict,
- cr, cr_workdir,
+ creator, cr_workdir,
oe_builddir,
bootimg_dir,
kernel_dir,
native_sysroot)
self._source_methods["do_stage_partition"](self, self.sourceparams_dict,
- cr, cr_workdir,
+ creator, cr_workdir,
oe_builddir,
bootimg_dir, kernel_dir,
native_sysroot)
self._source_methods["do_prepare_partition"](self, self.sourceparams_dict,
- cr, cr_workdir,
+ creator, cr_workdir,
oe_builddir,
bootimg_dir, kernel_dir, rootfs_dir,
native_sysroot)
@@ -441,21 +441,21 @@ class Wic_PartData(FC4_PartData):
msger.warning("Creating of an empty squashfs %s partition was attempted. " \
"Proceeding as requested." % self.mountpoint)
- fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
- os.path.isfile(fs) and os.remove(fs)
+ path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.path.isfile(path) and os.remove(path)
# it is not possible to create a squashfs without source data,
# thus prepare an empty temp dir that is used as source
tmpdir = tempfile.mkdtemp()
squashfs_cmd = "mksquashfs %s %s -noappend" % \
- (tmpdir, fs)
+ (tmpdir, path)
exec_native_cmd(squashfs_cmd, native_sysroot)
os.rmdir(tmpdir)
# get the rootfs size in the right units for kickstart (kB)
- du_cmd = "du -Lbks %s" % fs
+ du_cmd = "du -Lbks %s" % path
out = exec_cmd(du_cmd)
fs_size = out.split()[0]
@@ -465,17 +465,17 @@ class Wic_PartData(FC4_PartData):
"""
Prepare a swap partition.
"""
- fs = "%s/fs.%s" % (cr_workdir, self.fstype)
+ path = "%s/fs.%s" % (cr_workdir, self.fstype)
dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
- (fs, self.size)
+ (path, self.size)
exec_cmd(dd_cmd)
import uuid
label_str = ""
if self.label:
label_str = "-L %s" % self.label
- mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), fs)
+ mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path)
exec_native_cmd(mkswap_cmd, native_sysroot)
@@ -490,37 +490,37 @@ class Wic_Partition(FC4_Partition):
(option, value))
setattr(parser.values, option.dest, value)
- op = FC4_Partition._getParser(self)
+ parser = FC4_Partition._getParser(self)
# The alignment value is given in kBytes. e.g., value 8 means that
# the partition is aligned to start from 8096 byte boundary.
- op.add_option("--align", type="int", action="store", dest="align",
- default=None)
- op.add_option("--extoptions", type="string", action="store", dest="extopts",
- default=None)
- op.add_option("--part-type", type="string", action="store", dest="part_type",
- default=None)
+ parser.add_option("--align", type="int", action="store", dest="align",
+ default=None)
+ parser.add_option("--extoptions", type="string", action="store", dest="extopts",
+ default=None)
+ parser.add_option("--part-type", type="string", action="store", dest="part_type",
+ default=None)
# use specified source file to fill the partition
# and calculate partition size
- op.add_option("--source", type="string", action="store",
- dest="source", default=None)
+ parser.add_option("--source", type="string", action="store",
+ dest="source", default=None)
# comma-separated list of param=value pairs
- op.add_option("--sourceparams", type="string", action="store",
- dest="sourceparams", default=None)
+ parser.add_option("--sourceparams", type="string", action="store",
+ dest="sourceparams", default=None)
# use specified rootfs path to fill the partition
- op.add_option("--rootfs-dir", type="string", action="store",
- dest="rootfs", default=None)
+ parser.add_option("--rootfs-dir", type="string", action="store",
+ dest="rootfs", default=None)
# wether to add the partition in the partition table
- op.add_option("--no-table", dest="no_table", action="store_true",
- default=False)
+ parser.add_option("--no-table", dest="no_table", action="store_true",
+ default=False)
# extra space beyond the partition size
- op.add_option("--extra-space", dest="extra_space", action="store",
- type="size", nargs=1, default="10M")
- op.add_option("--overhead-factor", dest="overhead_factor",
- action="callback", callback=overhead_cb, type="float",
- nargs=1, default=1.3)
- op.add_option("--use-uuid", dest="use_uuid", action="store_true",
- default=False)
- op.add_option("--uuid")
-
- return op
+ parser.add_option("--extra-space", dest="extra_space", action="store",
+ type="size", nargs=1, default="10M")
+ parser.add_option("--overhead-factor", dest="overhead_factor",
+ action="callback", callback=overhead_cb, type="float",
+ nargs=1, default=1.3)
+ parser.add_option("--use-uuid", dest="use_uuid", action="store_true",
+ default=False)
+ parser.add_option("--uuid")
+
+ return parser