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:38:35 +0100 |
commit | 1cb9f7b00b5ede62a9546c39d798c876775b08c0 (patch) | |
tree | 1126f320f5b8d4c8f3419556347b048031b1bace /meta/lib/oe/image.py | |
parent | d8364371b2987d1396cfb85658565096ff72a2cd (diff) | |
download | poky-1cb9f7b00b5ede62a9546c39d798c876775b08c0.tar.gz |
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]
(From OE-Core rev: 6acd4fc8d5e642b5c6c75fcc40dd8f37caf7ddcf)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/image.py')
-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): | |||
144 | overhead_factor = float(self.d.getVar('IMAGE_OVERHEAD_FACTOR', True)) | 144 | overhead_factor = float(self.d.getVar('IMAGE_OVERHEAD_FACTOR', True)) |
145 | rootfs_req_size = int(self.d.getVar('IMAGE_ROOTFS_SIZE', True)) | 145 | rootfs_req_size = int(self.d.getVar('IMAGE_ROOTFS_SIZE', True)) |
146 | rootfs_extra_space = eval(self.d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True)) | 146 | rootfs_extra_space = eval(self.d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True)) |
147 | rootfs_maxsize = self.d.getVar('IMAGE_ROOTFS_MAXSIZE', True) | ||
147 | 148 | ||
148 | output = subprocess.check_output(['du', '-ks', | 149 | output = subprocess.check_output(['du', '-ks', |
149 | self.d.getVar('IMAGE_ROOTFS', True)]) | 150 | self.d.getVar('IMAGE_ROOTFS', True)]) |
@@ -158,6 +159,13 @@ class Image(ImageDepGraph): | |||
158 | base_size += rootfs_alignment - 1 | 159 | base_size += rootfs_alignment - 1 |
159 | base_size -= base_size % rootfs_alignment | 160 | base_size -= base_size % rootfs_alignment |
160 | 161 | ||
162 | # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set) | ||
163 | if rootfs_maxsize: | ||
164 | rootfs_maxsize_int = int(rootfs_maxsize) | ||
165 | if base_size > rootfs_maxsize_int: | ||
166 | bb.fatal("The rootfs size %d(K) overrides the max size %d(K)" % \ | ||
167 | (base_size, rootfs_maxsize_int)) | ||
168 | |||
161 | return base_size | 169 | return base_size |
162 | 170 | ||
163 | def _create_symlinks(self, subimages): | 171 | def _create_symlinks(self, subimages): |