mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
add test-memory-card.sh
Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
33
binaries/sie_rootfs_files/root/binaries/test-memory-card.sh
Executable file
33
binaries/sie_rootfs_files/root/binaries/test-memory-card.sh
Executable 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"
|
||||||
Reference in New Issue
Block a user