• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# This is the script that was used to create the image.gz in this directory.
4
5set -e -u
6
7mkdir -p mnt
8umount mnt &> /dev/null || true
9
10dd if=/dev/zero of=image bs=4096 count=128
11mke2fs -O 'verity,extents' -b 4096 -N 128 image
12mount 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.
16for i in {1..80}; do
17	head -c 4096 /dev/zero > mnt/tmp_$i
18done
19for i in {1..80..2}; do
20	rm mnt/tmp_$i
21done
22head -c $((40 * 4096)) /dev/zero > mnt/file
23fsverity enable mnt/file
24rm mnt/tmp_*
25
26umount mnt
27rmdir mnt
28gzip -9 -f image
29