#!/bin/sh

if [ $# -ne 2 ]
then
	echo "usage: $(basename $0) <jffs2 file> <mount dir>"
	exit 1
fi

jf="$1"
mdir="$2"

#Module laden + Device-Node erstellen
modprobe mtdram total_size=32768 erase_size=256
modprobe mtdchar
modprobe mtdblock
mknod /dev/mtdblock0 b 31 0

dd if="$jf" of=/dev/mtdblock0
mount -t jffs2 /dev/mtdblock0 "$mdir"