The du-k-works test seems to assume that du -k on a directory with two files totaling 80 kilobytes should report either 80k or 88k. In ext4 filesystm however, both busybox' du -k and coreutils' du -k reports a size of 84k which causes the test to fail. =>du-k-works FAIL: du-k-works + mkdir du.testdir + cd du.testdir + dd if=/dev/zero of=file1 bs=1k count=64 + dd if=/dev/zero of=file2 bs=1k count=16 ++ busybox du -k . ++ busybox du -k . + test 'x84 .' = 'x80 .' -o 'x84 .' = 'x88 .'
https://github.com/openembedded/oe-core/commit/a022fb6b69388f28f3130e71125b64e4c154d504
I have built the ext3 and ext4 images for the Qemux86 machine, core-image-minimal. Followed the steps presented below and got the following output: EXT4: file1 = 64k file2 = 16k busybox du -k . command returns 81 EXT3: file1 = 64k file2 = 16k busybox du -k . command returns 83
This is problem of the test case itself. It expect a directory occupies 0 or 8 kb which is the "block size" of file system. But when create a ext3/4 file system, mke2fs will use heuristics to determine the appropriate block size if '-b' is not provided. When the size of partition less than 512MB, the "block size" is 1024. That why the result of "busybox du -k ." is 81. We can 1 run mkfs.ext3/4 with "-b 4096" or "-b 8192", or 2 run this case on a partition which larger than 512M to make test case pass after the patch merged(and the patch is merged to busybox git repo).
Patch merged by busybox upstream, then backport it.
no error with git master branch commit 7e9cb437b1b720e656f4a33f73c07c5dc7356a2c.