#!/bin/bash
#handy utility for creating most reasonable floppy formats

three_point_five_inch_dd_hd=/dev/sda
five_point_two_five_inch_dd_hd=/dev/fd1
mydefaults='--verbosity 3 --dosverify --verify_later'

usage='1>&2 echo "usage: $0 1680K|1440K|1200K|720K|360K|320K|180K|160K"'

if [ $# -ne 1 ]
then
	eval $usage
fi

case "$1" in
	1680[Kk]|1680|1.68[Mm]|1.68|[Dd][Mm][Ff])
		#http://www.byte.com/column/trevor/BYT19991103S0010
		echo superformat $mydefaults "$three_point_five_inch_dd_hd" sect=21
		superformat $mydefaults "$three_point_five_inch_dd_hd" sect=21
	;;
	1440[Kk]|1440|1.44[Mm]|1.44)
		echo superformat $mydefaults "$three_point_five_inch_dd_hd" hd
		superformat $mydefaults "$three_point_five_inch_dd_hd" hd
	;;
	#1200[Kk]|1200|1.2[Mm]|1.2)
	#	echo superformat $mydefaults "$five_point_two_five_inch_dd_hd" hd
	#	superformat $mydefaults "$five_point_two_five_inch_dd_hd" hd
	#;;
	720[Kk]|720)
		echo superformat $mydefaults "$three_point_five_inch_dd_hd" dd
		superformat $mydefaults "$three_point_five_inch_dd_hd" dd
	;;
	#360[Kk]|360)
	#	echo superformat $mydefaults "$five_point_two_five_inch_dd_hd" dd
	#	superformat $mydefaults "$five_point_two_five_inch_dd_hd" dd
	#;;
	#320[Kk]|320)
	#	echo superformat $mydefaults "$five_point_two_five_inch_dd_hd" dd sect=8
	#	superformat $mydefaults "$five_point_two_five_inch_dd_hd" dd sect=8
	#;;
	#180[Kk]|180)
	#	echo superformat $mydefaults "$five_point_two_five_inch_dd_hd" ss dd
	#	superformat $mydefaults "$five_point_two_five_inch_dd_hd" ss dd
	#;;
	#160[Kk]|160)
	#	echo superformat $mydefaults "$five_point_two_five_inch_dd_hd" ss dd sect=8
	#	superformat $mydefaults "$five_point_two_five_inch_dd_hd" ss dd sect=8
	#;;
	*)
		eval $usage
		exit 1
	;;
esac
