#!/bin/sh -x
#M make virtuell disk image for qemu
echo "Copy directory to a virtuell disc image"
echo "filename of image ?"
read file
echo "Image size in k sample 1024 = 1M ?"
read size
echo "mountpoint sample /mnt/temp of the image ?"
read mpoint
rm $file.img
dd if=/dev/zero of=$file.img bs=1024 count=$size
mkfs.ext4 -F $file.img
mkdir $mpoint
sudo mount -t ext4 -o loop $file.img $mpoint
