1#!/bin/bash 2set -e 3 4# Given a path, make an ext4 image out of it, store it in $2 5dd if=/dev/zero of=$2 bs=4k count=$((256 * 1024 * 2)) 6mkfs.ext4 $2 7 8OUT=`mktemp -d` 9mount -o loop $2 $OUT/ 10rsync -ra $1/ $OUT/ 11umount $OUT/ 12