Bug 12235 - image.bbclass: Consider adding --apparent-size to du -ks for get_rootfs_size
Summary: image.bbclass: Consider adding --apparent-size to du -ks for get_rootfs_size
Status: RESOLVED DUPLICATE of bug 8430
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 5.99
Hardware: All Multiple
: Medium+ normal
Target Milestone: 2.5 M1
Assignee: Maxin B. John
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-10-18 12:43 UTC by Jonathan Liu
Modified: 2018-01-11 15:54 UTC (History)
2 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 Jonathan Liu 2017-10-18 12:43:16 UTC
Consider changing du -ks to du --apparent-size -ks for more reproducible builds. I get slightly different results running du -ks on a btrfs filesystem with compress-force=lzo compared to an ext4 filesystem.

btrfs:
$ wget http://www.tpg.com.au/test3.iso
$ du --apparent-size -ks test3.iso
51102   test3.iso
$ du -ks test3.iso
51104   test3.iso

ext4:
$ wget http://www.tpg.com.au/test3.iso
$ du --apparent-size -ks test3.iso
51102   test3.iso
$ du -ks test3.iso
51108   test3.iso
Comment 1 Ross Burton 2017-10-19 14:44:55 UTC
As we're getting the size of a single file, we could just use stat() right?
Comment 2 Jonathan Liu 2017-10-19 22:14:53 UTC
(In reply to comment #1)
> As we're getting the size of a single file, we could just use stat() right?

It is calculating size for a directory not a single file.
Comment 3 Ross Burton 2017-10-20 07:50:45 UTC
Yes, sorry, I was thinking of the wrong variable.

Note that you'll still get differences with --apparent-size thanks to the directory inodes being of variable size.
Comment 5 Ross Burton 2018-01-11 15:54:40 UTC
Duplicate so marking as such.

*** This bug has been marked as a duplicate of bug 8430 ***