Bug 2273

Summary: Evaluate current image space settings
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Ed Bartosh <eduard.bartosh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Low CC: bluelightning, meta.mr.watcher, meta.watcher, richard.purdie, sgw
Version: 1.2   
Target Milestone: 2.5   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Paul Eggleton 2012-04-10 08:40:12 UTC
For 1.3, we should look at the amount of extra space we currently allow for images; in particular it might be nice when an image has package_management enabled to give it some additional space to allow for additional packages to be installed.
Comment 1 Saul Wold 2013-06-07 00:50:10 UTC
This is really up to the downstream distros, there was a brief time before the postinstalls were run on the host, a minimal/systemd build was not large enough, but that is now solved.  I we really wanted we could check form package-management in the image creation and increase the IMAGE_OVERHEAD_FACTOR from 1.3 to say 1.5.

Assigning it to Laurentiu since he is about to look at the code also.

Thoughts?
Comment 2 Laurentiu Palcu 2013-07-08 15:07:14 UTC
I've been looking on this and, apparently, for rpm we already add a 50MB extra space if we use package management (http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7061af381277a20e4df455daac9754b73fcbe467).

Also, I've seen a logic error in image size computation. Right now, it is done like that:

base_size = COMPUTED_SIZE * ${IMAGE_OVERHEAD_FACTOR}
base_size = ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE})

The problem I spotted is when COMPUTED_SIZE * ${IMAGE_OVERHEAD_FACTOR} is less than but very close to ${IMAGE_ROOTFS_SIZE}, in which case the resulting image size will be always ${IMAGE_ROOTFS_SIZE} and there will be no free space on the image. So, in this case, IMAGE_OVERHEAD_FACTOR is useless. Even delayed postinstalls might fail in this case. Unless IMAGE_ROOTFS_EXTRA_SPACE is set...
Comment 3 Ed Bartosh 2017-08-07 09:43:24 UTC
wic uses ROOTFS_SIZE variable to set partition size. This variable is calculated in image.bbclass get_rootfs_size function using IMAGE_ROOTFS_ALIGNMENT, IMAGE_OVERHEAD_FACTOR, IMAGE_ROOTFS_EXTRA_SPACE, IMAGE_ROOTFS_MAXSIZE and the actual size of rootfs directory returned by 'du -ks <path to rootfs directory>'. This should be enough to handle size-related variables correctly.