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
As we're getting the size of a single file, we could just use stat() right?
(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.
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.
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/144538.html
Duplicate so marking as such. *** This bug has been marked as a duplicate of bug 8430 ***