patch: make *outfile extern
[platform/upstream/cdrkit.git] / misc / MKNOD.hpux
1 #!/bin/sh
2 ################################################################
3 # make SCSI device files according to: man scsi_ctl
4 #
5 # Copyright (c) 1997 J. Schilling
6 ################################################################
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2
9 # as published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # this program; see the file COPYING.  If not, write to the Free Software
18 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 ################################################################
20
21 mknod="echo mknod"
22 mkdir="echo mkdir -p"
23 chmod="echo chmod"
24
25 mknod="/usr/sbin/mknod"
26 mkdir="mkdir -p"
27 chmod="chmod"
28
29 scsi=/dev/scsi
30 rscsi=/dev/rscsi
31
32 ${mkdir}  ${scsi}
33 ${mkdir} ${rscsi}
34
35 bus=0
36 target=0
37 lun=0
38
39 for bus in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
40         for target in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
41                 for lun in 0 1 2 3 4 5 6 7; do
42 #
43 #       Newer HP-UX versions seem to have
44 #       /dev/rscsi/citxdy
45 #       but it uses the "non-raw" interface type
46 #                       dev=c${bus}t${target}d${lun} 
47 #       We follow the HP-UX documentation and create
48 #       /dev/rscsi/citxty with the raw bit set
49
50                         dev=c${bus}t${target}l${lun} 
51
52                         $mknod  ${scsi}/${dev} c 203 0x${bus}${target}${lun}00
53                         $chmod 0600  ${scsi}/${dev}
54
55                         $mknod ${rscsi}/${dev} c 203 0x${bus}${target}${lun}02
56                         $chmod 0600  ${rscsi}/${dev}
57                 done
58         done
59 done