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