[oe-commits] Patrick Williams : image.py: Ensure base image size is an integer

git at git.openembedded.org git at git.openembedded.org
Fri Sep 18 08:06:55 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: bf74a002b8fa18d94cec93f0341cbe74cc010ca7
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=bf74a002b8fa18d94cec93f0341cbe74cc010ca7

Author: Patrick Williams <patrick at stwcx.xyz>
Date:   Wed Sep 16 11:48:44 2015 -0500

image.py: Ensure base image size is an integer

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 at stwcx.xyz>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oe/image.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 2361955..f9e9bfd 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -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



More information about the Openembedded-commits mailing list