]> code.ossystems Code Review - openembedded-core.git/commitdiff
image.py: Ensure base image size is an integer
authorPatrick Williams <patrick@stwcx.xyz>
Wed, 16 Sep 2015 16:48:44 +0000 (11:48 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Sep 2015 21:15:06 +0000 (22:15 +0100)
There is a floating point multiplication done of a base image size
and an "overhead factor", which is currently rounded up to the next
integer.  If the multiplication results in a whole number, the value
will still be a float.  When this float is used to generate a shell
script, a buggy script is generated.

Fix this by always forcing to an integer.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/image.py

index 2361955971bf3fb7956923df0272281c846cdee6..f9e9bfd5873bb7968e1a8777f9aa6282d61db5fa 100644 (file)
@@ -172,6 +172,8 @@ class Image(ImageDepGraph):
 
         if base_size != int(base_size):
             base_size = int(base_size + 1)
+        else:
+            base_size = int(base_size)
 
         base_size += rootfs_alignment - 1
         base_size -= base_size % rootfs_alignment