Bug 2273 - Evaluate current image space settings
Summary: Evaluate current image space settings
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.2
Hardware: All Multiple
: Low enhancement
Target Milestone: 2.5
Assignee: Ed Bartosh
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-04-10 08:40 UTC by Paul Eggleton
Modified: 2017-08-07 09:43 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.