add test-memory-card.sh

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2010-08-19 21:54:33 +08:00
parent 677a5aba22
commit 6214615608
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#!/bin/sh
if [ -b "/dev/mmcblk0" ] ; then
echo "there is a memory card present"
else
echo "ERROR - there is no memory card inserted"
exit 1
fi
mkdir -p /tmp/card
echo "try to mount mmc card"
mount /dev/mmcblk0p1 /tmp/card/
if [ $? == 0 ] ; then
echo "mount ok"
else
echo "ERROR - can not mount memory card"
exit 1
fi
echo "testing ..."
dd if=/dev/zero of=/tmp/card/testfile bs=1024 count=3096
if [ $? == 0 ] ; then
echo "mount ok"
else
echo "ERROR - can not mount memory card"
exit 1
fi
rm -rf /tmp/card/testfile
umount /tmp/card
echo "test done"