Whamcloud - gitweb
LU-14710 e2fsck: fix ".." more gracefully if possible
[tools/e2fsprogs.git] / tests / f_verity / mkimage.sh
1 #!/bin/bash
2
3 # This is the script that was used to create the image.gz in this directory.
4
5 set -e -u
6
7 mkdir -p mnt
8 umount mnt &> /dev/null || true
9
10 dd if=/dev/zero of=image bs=4096 count=128
11 mke2fs -O 'verity,extents' -b 4096 -N 128 image
12 mount image mnt
13
14 # Create a verity file, but make it fragmented so that it needs at least one
15 # extent tree index node, in order to cover the scan_extent_node() case.
16 for i in {1..80}; do
17         head -c 4096 /dev/zero > mnt/tmp_$i
18 done
19 for i in {1..80..2}; do
20         rm mnt/tmp_$i
21 done
22 head -c $((40 * 4096)) /dev/zero > mnt/file
23 fsverity enable mnt/file
24 rm mnt/tmp_*
25
26 umount mnt
27 rmdir mnt
28 gzip -9 -f image