
#
#	init_disks - 	replace smd devices with scsi devices if disk 
#			controller 0 is a SCSI EDT. To be run during 
#			system installation.
#
#			This program will not modify anything UNLESS 
#			disk controller zero is scsi AND the correct 
#			devices for disks 0 and 1 are incorrect.
#
SCSI_0_BDEV=6			# block device for scsi controller 0
SCSI_0_CDEV=40			# character dev for scsi controller 0

/etc/icb -l |
if /bin/sed -n '/EDT/p
/HSDT/p
/SCSI/p' | /bin/sed 1q | /bin/grep SCSI >/dev/null 2>&1
then 
	for d in 0 1
	do
		for s in 0 1 2 3 4 5 6 7
		do
			minor=`expr 16 \* $d + $s`
			#
			# remove existing block device 
			# create scsi device.
			#
			bdev=/dev/dsk/c0d$d\s$s
			rm -f $bdev
			mknod $bdev b $SCSI_0_BDEV $minor
			chmod 0400 $bdev
			chown root $bdev
			chgrp sys  $bdev
			#
			# ditto for character device.
			#
			cdev=/dev/rdsk/c0d$d\s$s
			rm -f $cdev
			mknod $cdev c $SCSI_0_CDEV $minor
			chmod 0400 $cdev
			chown root $cdev
			chgrp sys  $cdev
		done
	done	
fi
