Bug 5334 - PKGSIZE is reported relative to host disk space
Summary: PKGSIZE is reported relative to host disk space
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-10-10 11:13 UTC by Alexandru Damian
Modified: 2013-12-03 17:55 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Damian 2013-10-10 11:13:50 UTC
== Situation ==
Getting the package size from package.bbclass yields an incorrect value.

== Current behaviour ==
PKGSIZE is a variable holding the size of a package build by package.bbclass.
Currently, the size is computed by counting the disk space taken by files on the host system, using a 'du' command. This size comes back as Kilobytes, and is a multiple of the host fs block allocation size.

== Expected output == 
When computing the size of a package, I would expect to see the size equal to sum of the files that are packaged in the said package, possibly plus space taken by metadata. The size should be in Bytes as to accurately reflect minimum space taken on target.
Comment 1 Saul Wold 2013-10-24 20:49:59 UTC
I think you are refering to IMAGESIZE which uses du -k, This could also invalid 
existing data contained in the history. PGKSIZE is using pyhton's os.lstat(), 
which is already bytes.
Comment 2 Alexandru Damian 2013-10-25 10:08:10 UTC
This is about PKGSIZE in package.bbclass, which uses 
def get_directory_size()

which executes `du -sk `.

Maybe this should be a more general bug for usage of `du` in host context ?
Comment 3 Paul Eggleton 2013-12-03 17:55:51 UTC
Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f4e91404f8722b4fb1700e4c9fe13f0dfd7ebda3
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f4e91404f8722b4fb1700e4c9fe13f0dfd7ebda3

The fix was to drop use of "du" and instead use the sum of lstat() on each file.