#!/system/bin/sh
#
# Set mtdblocks as non-rotational (i.e. flash)

BB="/system/xbin/busybox";
logI="log -p i -t nonrot";
logE="log -p e -t nonrot";

for devpath in /sys/block/mtdblock*; do
    echo 0 > $devpath/queue/rotational;
    if [ $? -ne 0 ]; then
        device=`$BB basename $devpath`;
        $logE "Unable to set $device as non-rotational";
    fi
done

$logI "Finished"
