#!/bin/dash
# Puppy-compatibility script: list disks

for p in $(echo /sys/block/*); do
	p=${p#/sys/block/}
	case $p in ram*|nbd*|loop*|dm-*|zram*) continue;; esac

	vendor="" model="" type="drive"
	read vendor < /sys/block/$p/device/vendor
	read model  < /sys/block/$p/device/model
	case $p in
		fd*)  type=floppy  ;;
		sr*)  type=optical ;;
		mmc*) type=card ;;
	esac
	readlink /sys/block/$p | grep -q usb && type=usbdrv
	echo "/dev/$p|$type|$vendor $model"
done
