xref: /onnv-gate/usr/src/cmd/devfsadm/devlink.tab.sh (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#
2*0Sstevel@tonic-gate# CDDL HEADER START
3*0Sstevel@tonic-gate#
4*0Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate# with the License.
8*0Sstevel@tonic-gate#
9*0Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate# See the License for the specific language governing permissions
12*0Sstevel@tonic-gate# and limitations under the License.
13*0Sstevel@tonic-gate#
14*0Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate#
20*0Sstevel@tonic-gate# CDDL HEADER END
21*0Sstevel@tonic-gate#
22*0Sstevel@tonic-gate#
23*0Sstevel@tonic-gate# Copyright (c) 1998, 2000 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate# All rights reserved.
25*0Sstevel@tonic-gate#
26*0Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
27*0Sstevel@tonic-gate#
28*0Sstevel@tonic-gate# This is the script that generates the devlink.tab file. It is
29*0Sstevel@tonic-gate# architecture-aware, and dumps different stuff for x86 and sparc.
30*0Sstevel@tonic-gate# There is a lot of common entries, which are dumped first.
31*0Sstevel@tonic-gate#
32*0Sstevel@tonic-gate# the SID of this script, and the SID of the dumped script are
33*0Sstevel@tonic-gate# always the same.
34*0Sstevel@tonic-gate#
35*0Sstevel@tonic-gate
36*0Sstevel@tonic-gatecat <<EOM
37*0Sstevel@tonic-gate#ident   "%Z%%M% %I%     %E% SMI"
38*0Sstevel@tonic-gate#
39*0Sstevel@tonic-gate# Copyright (c) 1998 by Sun Microsystems, Inc.
40*0Sstevel@tonic-gate#
41*0Sstevel@tonic-gate#
42*0Sstevel@tonic-gate# This is the table used by devlinks
43*0Sstevel@tonic-gate#
44*0Sstevel@tonic-gate# Each entry should have 2 fields; but may have 3.  Fields are separated
45*0Sstevel@tonic-gate# by single tab ('\t') characters.
46*0Sstevel@tonic-gate#
47*0Sstevel@tonic-gate# The fields are:
48*0Sstevel@tonic-gate#
49*0Sstevel@tonic-gate# devfs-spec: a keyword-value set of devfs specifications, describing the set
50*0Sstevel@tonic-gate#	of devfs node entries to be linked.
51*0Sstevel@tonic-gate#
52*0Sstevel@tonic-gate#	The keywords are:
53*0Sstevel@tonic-gate#
54*0Sstevel@tonic-gate#	type - The devinfo node type (see <sys/sunddi.h> for possible values)
55*0Sstevel@tonic-gate#
56*0Sstevel@tonic-gate#	name - the devinfo node name (the part of a /devices entry that appears
57*0Sstevel@tonic-gate#		before the '@' or ':').
58*0Sstevel@tonic-gate#
59*0Sstevel@tonic-gate#	addr - the devinfo node address part (the portion of the name between
60*0Sstevel@tonic-gate#		the '@' and the ':').
61*0Sstevel@tonic-gate#
62*0Sstevel@tonic-gate#	minor - the minor-attributes (the portion of a /devices name after the
63*0Sstevel@tonic-gate#		':').
64*0Sstevel@tonic-gate#
65*0Sstevel@tonic-gate#	The keywords are separated from their valuse by an equals ('=') sign;
66*0Sstevel@tonic-gate#	keyword-value pairs are separated from each other by semicolons (';').
67*0Sstevel@tonic-gate#
68*0Sstevel@tonic-gate# dev name - the /dev name corresponding to the devfs node described by
69*0Sstevel@tonic-gate#	the devfs-spec field.  This specification is assume to start rooted at
70*0Sstevel@tonic-gate#	/dev; THE INITIAL /dev/ SHOULD NOT BE SPECIFIED!
71*0Sstevel@tonic-gate#	The name can contain a number of escape-sequences to include parts of
72*0Sstevel@tonic-gate#	the devfs-name in the /dev/-name.  These escape-sequences all start with
73*0Sstevel@tonic-gate#	a backslash ('\') character.  The current sequences are:
74*0Sstevel@tonic-gate#
75*0Sstevel@tonic-gate#	\D - the devfs 'name' field
76*0Sstevel@tonic-gate#
77*0Sstevel@tonic-gate#	\An - the 'n'th component of the address field (n=0 means the whole
78*0Sstevel@tonic-gate#		address field)
79*0Sstevel@tonic-gate#
80*0Sstevel@tonic-gate#	\Mn - the 'n'th component of the minor field (n=0 means the entire
81*0Sstevel@tonic-gate#		minor field).
82*0Sstevel@tonic-gate#
83*0Sstevel@tonic-gate#	\Nn - a sequential counter, starting at n (a *single* digit, giving
84*0Sstevel@tonic-gate#		a starting range of 0 through 9).
85*0Sstevel@tonic-gate#
86*0Sstevel@tonic-gate# extra dev link - a few devices need a second link; that is, a second link
87*0Sstevel@tonic-gate#	pointing to the first link.  This optional field specifies the /dev
88*0Sstevel@tonic-gate#	format of this second link.  This entry can also use the above-described
89*0Sstevel@tonic-gate#	escape-sequences.
90*0Sstevel@tonic-gate#
91*0Sstevel@tonic-gate# Fields can be blank; seperated by single tab characters,
92*0Sstevel@tonic-gate# Spaces are significant, and are considered part of a field. IN GENERAL THIS
93*0Sstevel@tonic-gate# MEANS THERE SHOULD BE NO SPACE CHARACTERS IN THIS FILE!
94*0Sstevel@tonic-gate# All fields must be present (even if blank)
95*0Sstevel@tonic-gate#
96*0Sstevel@tonic-gate#
97*0Sstevel@tonic-gate# devfs-spec	Dev-Namespec	Extra-Link
98*0Sstevel@tonic-gate#
99*0Sstevel@tonic-gateEOM
100*0Sstevel@tonic-gate
101*0Sstevel@tonic-gatecase "$MACH" in
102*0Sstevel@tonic-gate  "i386" )
103*0Sstevel@tonic-gate	#
104*0Sstevel@tonic-gate	# These are the x86 specific entries
105*0Sstevel@tonic-gate	# It depends on the build machine being an x86
106*0Sstevel@tonic-gate	#
107*0Sstevel@tonic-gate	cat <<-EOM
108*0Sstevel@tonic-gate	EOM
109*0Sstevel@tonic-gate	;;
110*0Sstevel@tonic-gate  "sparc" )
111*0Sstevel@tonic-gate	#
112*0Sstevel@tonic-gate	# These are the sparc specific entries
113*0Sstevel@tonic-gate	# It depends on the build machine being an sparc
114*0Sstevel@tonic-gate	#
115*0Sstevel@tonic-gate	cat <<-EOM
116*0Sstevel@tonic-gate	EOM
117*0Sstevel@tonic-gate	;;
118*0Sstevel@tonic-gate  * )
119*0Sstevel@tonic-gate	echo "Unknown Architecture"
120*0Sstevel@tonic-gate	exit 1
121*0Sstevel@tonic-gate	;;
122*0Sstevel@tonic-gateesac
123