mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2024-12-05 04:06:14 +02:00
add test-memory-card.sh
Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
parent
677a5aba22
commit
6214615608
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"
|
Loading…
Reference in New Issue
Block a user