summaryrefslogtreecommitdiffstats
path: root/tests/f_verity/mkimage.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
commit464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/f_verity/mkimage.sh
parentInitial commit. (diff)
downloade2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.tar.xz
e2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.zip
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/f_verity/mkimage.sh')
-rwxr-xr-xtests/f_verity/mkimage.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/f_verity/mkimage.sh b/tests/f_verity/mkimage.sh
new file mode 100755
index 0000000..565083e
--- /dev/null
+++ b/tests/f_verity/mkimage.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# This is the script that was used to create the image.gz in this directory.
+
+set -e -u
+
+mkdir -p mnt
+umount mnt &> /dev/null || true
+
+dd if=/dev/zero of=image bs=4096 count=128
+mke2fs -O 'verity,extents' -b 4096 -N 128 image
+mount image mnt
+
+# Create a verity file, but make it fragmented so that it needs at least one
+# extent tree index node, in order to cover the scan_extent_node() case.
+for i in {1..80}; do
+ head -c 4096 /dev/zero > mnt/tmp_$i
+done
+for i in {1..80..2}; do
+ rm mnt/tmp_$i
+done
+head -c $((40 * 4096)) /dev/zero > mnt/file
+fsverity enable mnt/file
+rm mnt/tmp_*
+
+umount mnt
+rmdir mnt
+gzip -9 -f image