Last active
July 25, 2020 11:10
-
-
Save FedericoCeratto/30d4f942b8956c23d5c49de65cd2ec4f to your computer and use it in GitHub Desktop.
Reproducible filesystem creation - trivial test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
gen() { | |
img="fs-test-$2.img" | |
rm -f $img | |
fallocate -l 150M $img | |
sudo mkfs.$1 $img >/dev/null 2>&1 | |
} | |
for fs in btrfs jffs2 ext2 ext3 ext4 xfs fat vfat f2fs nilfs2; do | |
gen $fs 1 | |
gen $fs 2 | |
gen $fs 3 | |
gen $fs 4 | |
echo "$fs: " | |
cmp fs-test-1.img fs-test-2.img -l | wc -l | |
cmp fs-test-1.img fs-test-3.img -l | wc -l | |
cmp fs-test-1.img fs-test-4.img -l | wc -l | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment