summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/imager
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-07 13:01:13 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-09 14:27:45 +0100
commit4031de53f4dd2887862ac259b666206e20ab0812 (patch)
tree6781972b412ece3c922f35459afcf1c0b1eebc7b /scripts/lib/wic/imager
parenta0590d1adaaca40d69a795a889887ccff6941779 (diff)
downloadpoky-4031de53f4dd2887862ac259b666206e20ab0812.tar.gz
wic: round variable before converting to int
Wic uses bitbake variable ROOTFS_SIZE to set correspondent partition size. This variable is a literal representing float value. Wic crashes trying to convert it to int with the error: invalid literal for int() with base 10: '10166.0' Fixed this by converting variable to float and rounding result. This should work for int and float literals. (From OE-Core rev: 3479e299b5f11dfcd3f5f97c4ad3e0449f6c6d6a) 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/imager')
-rw-r--r--scripts/lib/wic/imager/direct.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 31c0edc7d3..146a0d1535 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -242,7 +242,7 @@ class DirectImageCreator(BaseImageCreator):
242 rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name) 242 rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
243 if rsize_bb: 243 if rsize_bb:
244 # convert from Kb to Mb 244 # convert from Kb to Mb
245 part.size = int(rsize_bb) / 1024 245 part.size = int(round(float(rsize_bb) / 1024.))
246 # need to create the filesystems in order to get their 246 # need to create the filesystems in order to get their
247 # sizes before we can add them and do the layout. 247 # sizes before we can add them and do the layout.
248 # Image.create() actually calls __format_disks() to create 248 # Image.create() actually calls __format_disks() to create