24 lines
608 B
Bash
Executable File
24 lines
608 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Please read http://wiki.laptop.org/go/SDCard_Testing before using.
|
|
|
|
DEVFPATH=$1
|
|
DEV=`basename ${DEVFPATH}`
|
|
|
|
ERASESIZE=`cat /sys/block/${DEV}/device/preferred_erase_size 2>/dev/null`
|
|
|
|
if mount | rg "^${DEVFPATH}.* / " ; then
|
|
echo Refusing to run on root filesystem
|
|
exit 1
|
|
fi
|
|
echo Making sure the device has no mounted partitions
|
|
umount ${DEVFPATH}p*
|
|
|
|
for F in name oemid manfid hwrev fwrev; do
|
|
echo $F `cat /sys/block/${DEV}/device/${F}`
|
|
done
|
|
echo Running flashbench
|
|
flashbench --open-au --open-au-nr=5 --random --blocksize=4096 \
|
|
--erasesize=${ERASESIZE:-4194304} ${DEVFPATH}
|
|
|