ucblinks.awk revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# CDDL HEADER START
#
# 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.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#ident "%Z%%M% %I% %E% SMI"
#
# This awk-script is the rule-base used in previous release for creating
# compatibility-mode names.
#
# WARNING: these rules are no longer used by default. ucblinks
# is now a binary, not a script. This rule-base can still
# be used, however, by running ucblinks with the option
# "-e /usr/ucblib/ucblinks.awk". See the ucblinks(1B) man
# page for more information.
#
# The idea is to create the names as symbolic links to their SunOS5
# counterparts by preference. If no counterpart exists a direct link to the
# devfs "/devices" directory is made.
#
# It does this base on input of the existing devices in the system.
# The format of the input file is:
#
# driver-name \t minor number \t [b|c] \t /devices-name \t first-minor-component
#
# That is,
#
# $1 driver-name
# $2 minor number
# $3 b(lock) or c(haracter) device
# $5 first minor component name (string between ':' and nextr ','
# in last path-component of the /devices-name)
#
# and these are referred to throughout the script.
#
# The output of the script-rules are lines of the form:
#
# devname["device-link-fullname"] = "compatname";
# devdir["device-link-fullname"] = "compatdir";
#
# The device-link-fullname should be relative to the directory in which the
# SunOS5 link is expected to be found. 'compatdir' is that directory name,
# FOLLOWED BY A SLASH. 'compatname' is the compatability name that should be
# generated.
#
#---------------------------------------------------------------------------
# DATABASE: Only modify below this line!
#
#
#
# are the same:
#
# console tty mem kmem null zero drum mouse klog kbd dump tcp udp
# mbmem mbio
#
# nit vd eeprom openprom des pp* vp* vpc*
$3 == "b" && $1 == "fd" {
if ($5 == "c")
else
}
$3 == "c" && $1 == "fd" {
if ($5 == "c")
else
}
#
# Standard disks (all bar IPI)
#
# Note special 'cddev' array test to make sure device is not a CD device
# in the case of a SCSI disk
#
if ($2 < 8)
else if ($2 >= 24 && $2 < 32)
else
}
if ($2 < 8)
else if ($2 >= 24 && $2 < 32)
else
}
#
# SCSI CD drive
#
}
#
# Next assumes IPI unit number entirely within minor
# (that is, 5.0 numbering rather than 4.1 numbering)
#
$3 == "b" && $1 == "id" {
}
$3 == "c" && $1 == "id" {
}
#
# Tape drives
#
# SCSI and XT Tape Drives
#
if (($2 % 128) < 64) break; # Not BSD-flavour
if ($1 == "xt") $1 == "mt"; # xt drives appear as mt devices
}
}
#
# Obsolete drive entries
#
$1 == "mt" {
if (($2 % 8) >= 4) {
}
}
else {
}
}
}
#
# Wierd Archive tape stuff
#
}
}
}
}
#
# Screen-buffers are easy
#
$1 == "bwtwo" || $1 == "cgthree" || $1 == "cgsix" || $1 == "cgfour" || $1 == "cgfourteen" || $1 == "cgeight" || $1 == "cgnine" || $1 == "cgtwelve" {
}
#
# This catches the on-board ports, the 1st and second SCSI-board uarts,
# as well as the newer fast-serial "se" ports.
# Depends on the driver creating the right names.
#
ttbeenhere = 1;
}
#
# XXX Bus device support yet to go in, so the following are TBD:
#
# sbus vme16d16 vme24d16 vme32d16 vme32d32
#
#
# XXX Other device support to be added as drivers are added:
#
# mcp oct mti
#