Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Jonathan Liu <net147@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] image.py: make sure ROOTFS_SIZE is an integer
Date: Thu, 17 Sep 2015 13:55:31 +1000	[thread overview]
Message-ID: <1442462131-20150-1-git-send-email-net147@gmail.com> (raw)

_get_rootfs_size was returning a float in some cases (e.g. 12288.0).

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 meta/lib/oe/image.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 2361955..f8aa88b 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -1,6 +1,7 @@
 from oe.utils import execute_pre_post_process
 import os
 import subprocess
+import math
 import multiprocessing
 
 
@@ -169,10 +170,7 @@ class Image(ImageDepGraph):
         base_size = size_kb * overhead_factor
         base_size = (base_size, rootfs_req_size)[base_size < rootfs_req_size] + \
             rootfs_extra_space
-
-        if base_size != int(base_size):
-            base_size = int(base_size + 1)
-
+        base_size = int(math.ceil(base_size))
         base_size += rootfs_alignment - 1
         base_size -= base_size % rootfs_alignment
 
-- 
2.5.0



             reply	other threads:[~2015-09-17  3:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17  3:55 Jonathan Liu [this message]
2015-09-17  7:01 ` [PATCH] image.py: make sure ROOTFS_SIZE is an integer Mike Looijmans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442462131-20150-1-git-send-email-net147@gmail.com \
    --to=net147@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox