Jffs2
From Openmoko
(Difference between revisions)
(→Using mtdram) |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Using mtdram === | === Using mtdram === | ||
An alternative way is used in the following script: | An alternative way is used in the following script: | ||
Line 25: | Line 4: | ||
then echo "Must be root"; exit 2 | then echo "Must be root"; exit 2 | ||
fi | fi | ||
− | if test $# != 2 -o ! -d $2 | + | if test $# != 2 -o ! -d "$2" |
then echo Usage: $0 image.jffs2 directory; exit 2 | then echo Usage: $0 image.jffs2 directory; exit 2 | ||
fi | fi | ||
Line 33: | Line 12: | ||
modprobe mtdchar | modprobe mtdchar | ||
modprobe jffs2 | modprobe jffs2 | ||
− | s=$(ls -s $1) | + | s=$(ls -s "$1") |
s=${s% *} | s=${s% *} | ||
echo modprobe mtdram total_size=$s | echo modprobe mtdram total_size=$s | ||
modprobe mtdram total_size=$s | modprobe mtdram total_size=$s | ||
− | dd if=$1 of=/dev/mtd0 | + | dd if="$1" of=/dev/mtd0 |
− | mount -t jffs2 /dev/mtdblock0 $2 | + | mount -t jffs2 /dev/mtdblock0 "$2" |
[[Category:Advanced End User]] | [[Category:Advanced End User]] |
Revision as of 00:14, 11 January 2010
Using mtdram
An alternative way is used in the following script:
if test `id -u` != 0 then echo "Must be root"; exit 2 fi if test $# != 2 -o ! -d "$2" then echo Usage: $0 image.jffs2 directory; exit 2 fi rmmod mtdram modprobe mtdcore modprobe mtdblock modprobe mtdchar modprobe jffs2 s=$(ls -s "$1") s=${s% *} echo modprobe mtdram total_size=$s modprobe mtdram total_size=$s dd if="$1" of=/dev/mtd0 mount -t jffs2 /dev/mtdblock0 "$2"