diff options
-rw-r--r-- | meta/conf/bitbake.conf | 4 | ||||
-rw-r--r-- | meta/lib/oe/image.py | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 311e9a04c4..f4870d52a9 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -688,6 +688,10 @@ IMAGE_FSTYPES ?= "tar.gz" | |||
688 | INITRAMFS_FSTYPES ?= "cpio.gz" | 688 | INITRAMFS_FSTYPES ?= "cpio.gz" |
689 | DEFAULT_TASK_PROVIDER ?= "packagegroup-base" | 689 | DEFAULT_TASK_PROVIDER ?= "packagegroup-base" |
690 | MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}" | 690 | MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}" |
691 | |||
692 | # The size in Kbytes for the generated image if it is larger than | ||
693 | # the required size (du -ks IMAGE_ROOTFS * IMAGE_OVERHEAD_FACTOR), | ||
694 | # and no effect if less than it. | ||
691 | IMAGE_ROOTFS_SIZE ?= "65536" | 695 | IMAGE_ROOTFS_SIZE ?= "65536" |
692 | 696 | ||
693 | # Forcefully set CACHE now so future changes to things like | 697 | # Forcefully set CACHE now so future changes to things like |
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): |