From: Daan De Meyer Date: Tue, 23 Apr 2024 21:16:29 +0000 (+0200) Subject: TEST-50-DISSECT: Use --apparent-size when calling du X-Git-Tag: v256-rc1~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c709499a4eb44511e225e63a722ef5b6a0319842;p=thirdparty%2Fsystemd.git TEST-50-DISSECT: Use --apparent-size when calling du Otherwise if the file is full of holes we get the wrong size and we'll fail later on. --- diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index ab65c86ba8b..8c4d2bfc3f9 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -134,8 +134,8 @@ fi # Make a GPT disk on the fly, with the squashfs as partition 1 and the verity hash tree as partition 2 # # du rounds up to block size, which is more helpful for partitioning -root_size="$(du -k "$MINIMAL_IMAGE.raw" | cut -f1)" -verity_size="$(du -k "$MINIMAL_IMAGE.verity" | cut -f1)" +root_size="$(du --apparent-size -k "$MINIMAL_IMAGE.raw" | cut -f1)" +verity_size="$(du --apparent-size -k "$MINIMAL_IMAGE.verity" | cut -f1)" signature_size=4 # 4MB seems to be the minimum size blkid will accept, below that probing fails dd if=/dev/zero of="$MINIMAL_IMAGE.gpt" bs=512 count=$((8192+root_size*2+verity_size*2+signature_size*2))