Skip to content

Instantly share code, notes, and snippets.

@FedericoCeratto
Last active July 25, 2020 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FedericoCeratto/30d4f942b8956c23d5c49de65cd2ec4f to your computer and use it in GitHub Desktop.
Save FedericoCeratto/30d4f942b8956c23d5c49de65cd2ec4f to your computer and use it in GitHub Desktop.
Reproducible filesystem creation - trivial test
#!/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