diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2014-07-07 02:33:58 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-10 17:37:41 +0100 |
commit | 6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf (patch) | |
tree | 7709e4c7554af3b11c70a5888706022190db0a2f /meta/lib | |
parent | 3c820db4624a062644a26de1866123a10a78a006 (diff) | |
download | openembedded-core-6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf.tar.gz openembedded-core-6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf.tar.bz2 openembedded-core-6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf.zip |
lib/oe/image.py: check the rootfs size against IMAGE_ROOTFS_MAXSIZE
* Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
* Add comments for IMAGE_ROOTFS_SIZE to not confuse with IMAGE_ROOTFS_MAXSIZE
[YOCTO #2610]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/image.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py index c9b9033132..354a676f42 100644 --- a/meta/lib/oe/image.py +++ b/meta/lib/oe/image.py @@ -144,6 +144,7 @@ class Image(ImageDepGraph): overhead_factor = float(self.d.getVar('IMAGE_OVERHEAD_FACTOR', True)) rootfs_req_size = int(self.d.getVar('IMAGE_ROOTFS_SIZE', True)) rootfs_extra_space = eval(self.d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True)) + rootfs_maxsize = self.d.getVar('IMAGE_ROOTFS_MAXSIZE', True) output = subprocess.check_output(['du', '-ks', self.d.getVar('IMAGE_ROOTFS', True)]) @@ -158,6 +159,13 @@ class Image(ImageDepGraph): base_size += rootfs_alignment - 1 base_size -= base_size % rootfs_alignment + # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set) + if rootfs_maxsize: + rootfs_maxsize_int = int(rootfs_maxsize) + if base_size > rootfs_maxsize_int: + bb.fatal("The rootfs size %d(K) overrides the max size %d(K)" % \ + (base_size, rootfs_maxsize_int)) + return base_size def _create_symlinks(self, subimages): |