]> code.ossystems Code Review - openembedded-core.git/commit
lib/oe/utils: add directory size function
authorRoss Burton <ross.burton@intel.com>
Tue, 23 Mar 2021 16:37:21 +0000 (16:37 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Mar 2021 21:26:19 +0000 (22:26 +0100)
commit6ca53ad7b26ee2b4e6d2c121c6f6d6eed7f6b56f
tree9b286d7b19c3917622c282dcb61a0dbd7be53421
parentae9273f7e3b6bbf6cbdbdfbd32634cebe5c1b0ce
lib/oe/utils: add directory size function

For the purpose of image construction using du on a rootfs directory isn't
entirely satisfactory.  Bare "du" will report the actual disk usage so file
systems which can compress the data will report less than the actual space
required.  Using "du --apparent-size" will report the actual space used, but as
this simply sums the bytes used for content across an entire file system can
result in significant under-reporting due to block size overhead.

Attempt to solve these problems by implementing our own function to calculate
how large a rootfs will be.  This function handles hardlinks correctly but
rounds up all sizes to multiples of the block size (currently, 4KB is the
hard-coded block size).

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/utils.py