summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/partition.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r--scripts/lib/wic/partition.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 31a03506ca..69b369ce32 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -182,7 +182,7 @@ class Partition():
182 182
183 # further processing required Partition.size to be an integer, make 183 # further processing required Partition.size to be an integer, make
184 # sure that it is one 184 # sure that it is one
185 if type(self.size) is not int: 185 if not isinstance(self.size, int):
186 msger.error("Partition %s internal size is not an integer. " \ 186 msger.error("Partition %s internal size is not an integer. " \
187 "This a bug in source plugin %s and needs to be fixed." \ 187 "This a bug in source plugin %s and needs to be fixed." \
188 % (self.mountpoint, self.source)) 188 % (self.mountpoint, self.source))
@@ -242,7 +242,10 @@ class Partition():
242 # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE 242 # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
243 rsize_bb = get_bitbake_var('ROOTFS_SIZE') 243 rsize_bb = get_bitbake_var('ROOTFS_SIZE')
244 if rsize_bb: 244 if rsize_bb:
245 msger.warning('overhead-factor was specified, but size was not, so bitbake variables will be used for the size. In this case both IMAGE_OVERHEAD_FACTOR and --overhead-factor will be applied') 245 msger.warning('overhead-factor was specified, but size was not,'
246 ' so bitbake variables will be used for the size.'
247 ' In this case both IMAGE_OVERHEAD_FACTOR and '
248 '--overhead-factor will be applied')
246 self.size = int(round(float(rsize_bb))) 249 self.size = int(round(float(rsize_bb)))
247 250
248 for prefix in ("ext", "btrfs", "vfat", "squashfs"): 251 for prefix in ("ext", "btrfs", "vfat", "squashfs"):
@@ -402,7 +405,8 @@ class Partition():
402 "Proceeding as requested." % self.mountpoint) 405 "Proceeding as requested." % self.mountpoint)
403 406
404 path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 407 path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
405 os.path.isfile(path) and os.remove(path) 408 if os.path.isfile(path):
409 os.remove(path)
406 410
407 # it is not possible to create a squashfs without source data, 411 # it is not possible to create a squashfs without source data,
408 # thus prepare an empty temp dir that is used as source 412 # thus prepare an empty temp dir that is used as source
@@ -436,4 +440,3 @@ class Partition():
436 label_str = "-L %s" % self.label 440 label_str = "-L %s" % self.label
437 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path) 441 mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path)
438 exec_native_cmd(mkswap_cmd, native_sysroot) 442 exec_native_cmd(mkswap_cmd, native_sysroot)
439