#!/bin/rc

# desc: subdivide plan 9 disk partition
# prereq: partdisk

switch($1) {
case go
	echo
	echo 'This is disk/prep; use it to subdivide the Plan 9 partition.'
	echo 'A sensible layout will be suggested; you can probably just type ''w'' and then ''q''.'
	echo
	disk/prep -a /dev/$disk/plan9

case checkdone
	if(! test -f /dev/$disk/fs)
		disk/prep -p /dev/$disk/plan9 > /dev/$disk/ctl

	if(! test -f /dev/$disk/fs || ! test -f /dev/$disk/9fat) {
		prepdisk=notdone
		export prepdisk
	}
}
