summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/partition.py
diff options
context:
space:
mode:
authorMaciej Borzecki <maciej.borzecki@rndity.com>2016-11-10 13:18:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-15 15:19:55 +0000
commitb92de9a6db042e821bd26d1a2ee23f733ffc9214 (patch)
tree6e679d7e2ed70c2dd0d7eefbd67f671555486e56 /scripts/lib/wic/partition.py
parentf0181e79eda9102e11ae1ec3e4939ac5fc02cb13 (diff)
downloadpoky-b92de9a6db042e821bd26d1a2ee23f733ffc9214.tar.gz
wic: use partition size when creating empty partition files
It seems that prepare_empty_partition_ext() and prepare_empty_partition_btrfs() got broken in commit c8669749e37fe865c197c98d5671d9de176ff4dd, thus one could observe the following backtrace: Backtrace: File "<snip>/poky/scripts/lib/wic/plugins/imager/direct_plugin.py", line 93, in do_create creator.create() File "<snip>/poky/scripts/lib/wic/imager/baseimager.py", line 159, in create self._create() File "<snip>/poky/scripts/lib/wic/imager/direct.py", line 290, in _create self.bootimg_dir, self.kernel_dir, self.native_sysroot) File "<snip>/poky/scripts/lib/wic/partition.py", line 146, in prepare method(rootfs, oe_builddir, native_sysroot) File "<snip>/poky/scripts/lib/wic/partition.py", line 325, in prepare_empty_partition_ext os.ftruncate(sparse.fileno(), rootfs_size * 1024) NameError: name 'rootfs_size' is not defined (From OE-Core rev: 0bf686739a5e8a1193f5be5aa60afbf2ea1e5074) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r--scripts/lib/wic/partition.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 959035a971..f3835339af 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -314,7 +314,7 @@ class Partition():
314 Prepare an empty ext2/3/4 partition. 314 Prepare an empty ext2/3/4 partition.
315 """ 315 """
316 with open(rootfs, 'w') as sparse: 316 with open(rootfs, 'w') as sparse:
317 os.ftruncate(sparse.fileno(), rootfs_size * 1024) 317 os.ftruncate(sparse.fileno(), self.size * 1024)
318 318
319 extra_imagecmd = "-i 8192" 319 extra_imagecmd = "-i 8192"
320 320
@@ -332,7 +332,7 @@ class Partition():
332 Prepare an empty btrfs partition. 332 Prepare an empty btrfs partition.
333 """ 333 """
334 with open(rootfs, 'w') as sparse: 334 with open(rootfs, 'w') as sparse:
335 os.ftruncate(sparse.fileno(), rootfs_size * 1024) 335 os.ftruncate(sparse.fileno(), self.size * 1024)
336 336
337 label_str = "" 337 label_str = ""
338 if self.label: 338 if self.label: