xref: /OK3568_Linux_fs/buildroot/support/testing/tests/package/sample_bmap_tools.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2# simple test which creates a dummy file system image, then use bmaptool create
3# and bmaptool copy to copy it to another file
4
5set -xeu
6
7# create the necessary test files
8dd if=/dev/zero of=disk.img bs=2M count=1
9mkfs.ext4 disk.img
10fallocate -d disk.img
11dd if=/dev/zero of=copy.img bs=2M count=1
12
13# do a test copy of the file system image
14bmaptool create -o disk.img.bmap disk.img
15bmaptool copy disk.img copy.img
16cmp disk.img copy.img
17