#! /bin/sh

DRIVES=`cd /sys/block && ls -d sd*`

for d in $DRIVES; do
	if [ `cat /sys/block/$d/device/type` = 14 ]; then
		/sbin/other-os-flash-util -s /dev/$d >/dev/null 2>&1
		keep=$?
		if [ "$keep" = 2 ]; then
			echo "Error reading /dev/$d" 1>&2
		elif [ "$keep" = 0 ]; then
			echo /dev/$d;
			exit 0;
		fi
	fi
done

exit 1;

