Current du parameters used in wic scripts are conflicting: -b implies
--block-size=1 while -k implies --block-size=1K. When both parameters
are used, coreutils du and uutils du do not react similarly, leading to
failures on Ubuntu 25.10.
As we do want to use the 1K block size, remove -b and add
--apparent-size that was implied by it, so we have a predictable
behaviour.
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
self.source_file = rootfs
# get the rootfs size in the right units for kickstart (kB)
- du_cmd = "du -Lbks %s" % rootfs
+ du_cmd = "du --apparent-size -Lks %s" % rootfs
out = exec_cmd(du_cmd)
self.size = int(out.split()[0])
chmod_cmd = "chmod 644 %s" % bootimg
exec_cmd(chmod_cmd)
- du_cmd = "du -Lbks %s" % bootimg
+ du_cmd = "du --apparent-size -Lks %s" % bootimg
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]
chmod_cmd = "chmod 644 %s" % bootimg
exec_cmd(chmod_cmd)
- du_cmd = "du -Lbks %s" % bootimg
+ du_cmd = "du --apparent-size -Lks %s" % bootimg
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]
shutil.rmtree(isodir)
- du_cmd = "du -Lbks %s" % iso_img
+ du_cmd = "du --apparent-size -Lks %s" % iso_img
out = exec_cmd(du_cmd)
isoimg_size = int(out.split()[0])
sparse_copy(src, dst)
# get the size in the right units for kickstart (kB)
- du_cmd = "du -Lbks %s" % dst
+ du_cmd = "du --apparent-size -Lks %s" % dst
out = exec_cmd(du_cmd)
filesize = int(out.split()[0])