#!/bin/sh
WORKDIR=/root/abng
BLOCKS=16000
SOURCE=/biscuits/piccolo
rm -f linimage linpico.gz
dd if=/dev/zero of=${WORKDIR}/linimage bs=1k count=${BLOCKS}
echo "yes" | /sbin/mkfs.ext2 ${WORKDIR}/linimage
echo "Mounting loopback filesystem ..."
mount -o loop ${WORKDIR}/linimage /mnt/test
echo "Copying $1 ..."
cp -aR ${SOURCE}/* /mnt/test
echo "Unmounting loopback filesystem"
umount ${WORKDIR}/linimage
echo "Compressing filesystem ..."
gzip linimage
mv linimage.gz linpico.gz