#!/bin/sh
################################################################
# make SCSI device files according to: man scsi_ctl
#
# Copyright (c) 1997 J. Schilling
################################################################
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only.
# (the "License").  You may not use this file except in compliance
# with the License.
#
# See the file CDDL.Schily.txt in this distribution for details.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file CDDL.Schily.txt from this distribution.
################################################################

mknod="echo mknod"
mkdir="echo mkdir -p"
chmod="echo chmod"

mknod="/usr/sbin/mknod"
mkdir="mkdir -p"
chmod="chmod"

scsi=/dev/scsi
rscsi=/dev/rscsi

${mkdir}  ${scsi}
${mkdir} ${rscsi}

bus=0
target=0
lun=0

for bus in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
	for target in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
		for lun in 0 1 2 3 4 5 6 7; do
#
#	Newer HP-UX versions seem to have
#	/dev/rscsi/citxdy
#	but it uses the "non-raw" interface type
#			dev=c${bus}t${target}d${lun} 
#	We follow the HP-UX documentation and create
#	/dev/rscsi/citxty with the raw bit set

			dev=c${bus}t${target}l${lun} 

			$mknod  ${scsi}/${dev} c 203 0x${bus}${target}${lun}00
			$chmod 0600  ${scsi}/${dev}

			$mknod ${rscsi}/${dev} c 203 0x${bus}${target}${lun}02
			$chmod 0600  ${rscsi}/${dev}
		done
	done
done


syntax highlighted by Code2HTML, v. 0.9.1