diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-03-08 00:34:36 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-03-08 00:34:36 +0100 |
commit | cdce0be8956a26a4a2a4f9fb338508ffd75672b9 (patch) | |
tree | 09dc651e31bf77d136224404bf2ce297cb62a3eb | |
parent | 79102489260da9f577d7c1fb3665dd95d1596bea (diff) |
remove devfs rules and scripts
-rw-r--r-- | etc/udev/udev-devfs.rules | 112 | ||||
-rw-r--r-- | extras/ide-devfs.sh | 47 | ||||
-rw-r--r-- | extras/raid-devfs.sh | 50 | ||||
-rw-r--r-- | extras/scsi-devfs.sh | 88 |
4 files changed, 0 insertions, 297 deletions
diff --git a/etc/udev/udev-devfs.rules b/etc/udev/udev-devfs.rules deleted file mode 100644 index ec44692d68..0000000000 --- a/etc/udev/udev-devfs.rules +++ /dev/null @@ -1,112 +0,0 @@ -# The use of these rules is not recommended or supported. This file -# is just kept around to proof that udev is able to emulate the devfs scheme. -# -# In a world where devices can come and go at any time, the devfs device -# naming scheme of simple grouping and enumeration DOES NOT HELP ANYTHING. -# -# Use custom rules to name your device or look at the persistent device -# naming scheme, which is implemented for disks and extend it in a -# similar way for the subsystem you want a sane node layout for. - -# ide block devices -BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}" - -# md block devices -KERNEL="md[0-9]*", NAME="md/%n" - -# floppy devices -KERNEL="fd[0-9]*", NAME="floppy/%n" - -# tty devices -KERNEL="tty[0-9]*", NAME="vc/%n" -KERNEL="ttyS[0-9]*", NAME="tts/%n" -KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n" - -# vc devices -KERNEL="vcs", NAME="vcc/0" -KERNEL="vcs[0-9]*", NAME="vcc/%n" -KERNEL="vcsa", NAME="vcc/a0" -KERNEL="vcsa[0-9]*", NAME="vcc/a%n" - -# v4l devices -KERNEL="video[0-9]*", NAME="v4l/video%n" -KERNEL="radio[0-9]*", NAME="v4l/radio%n" -KERNEL="vbi[0-9]*", NAME="v4l/vbi%n" -KERNEL="vtx[0-9]*", NAME="v4l/vtx%n" - -# dm devices (ignore them) -KERNEL="dm-[0-9]*", NAME="" - -# i2c devices -KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k" - -# loop devices -KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k" - -# ramdisks -KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k" - -# framebuffer devices -KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k" - -# misc -KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" -KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" -KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k" -KERNEL="rtc", NAME="misc/%k", SYMLINK="%k" -KERNEL="psaux", NAME="misc/%k", SYMLINK="%k" -KERNEL="uinput", NAME="misc/%k", SYMLINK="%k" - -# alsa devices -KERNEL="controlC[0-9]*", NAME="snd/%k" -KERNEL="hw[CD0-9]*", NAME="snd/%k" -KERNEL="pcm[CD0-9cp]*", NAME="snd/%k" -KERNEL="midi[CD0-9]*", NAME="snd/%k" -KERNEL="timer", NAME="snd/%k" -KERNEL="seq", NAME="snd/%k" - -# oss devices -KERNEL="audio*", NAME="sound/%k", SYMLINK="%k" -KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k" -KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k" -KERNEL="midi*", NAME="sound/%k", SYMLINK="%k" -KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k" -KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k" - -# input devices -KERNEL="mice", NAME="input/%k" -KERNEL="mouse*", NAME="input/%k" -KERNEL="event*", NAME="input/%k" -KERNEL="js*", NAME="input/%k" -KERNEL="ts*", NAME="input/%k" - -# USB devices -KERNEL="hiddev*", NAME="usb/%k" -KERNEL="auer*", NAME="usb/%k" -KERNEL="legousbtower*", NAME="usb/%k" -KERNEL="dabusb*", NAME="usb/%k" -BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k" - -# netlink devices -KERNEL="route", NAME="netlink/%k" -KERNEL="skip", NAME="netlink/%k" -KERNEL="usersock", NAME="netlink/%k" -KERNEL="fwmonitor", NAME="netlink/%k" -KERNEL="tcpdiag", NAME="netlink/%k" -KERNEL="nflog", NAME="netlink/%k" -KERNEL="xfrm", NAME="netlink/%k" -KERNEL="arpd", NAME="netlink/%k" -KERNEL="route6", NAME="netlink/%k" -KERNEL="ip6_fw", NAME="netlink/%k" -KERNEL="dnrtmsg", NAME="netlink/%k" -KERNEL="tap*", NAME="netlink/%k" - -# CAPI devices -KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20" -KERNEL="capi*", NAME="capi/%n" - -# Network devices -KERNEL="tun", NAME="net/%k" - -# raw devices -KERNEL="raw[0-9]*", NAME="raw/%k" diff --git a/extras/ide-devfs.sh b/extras/ide-devfs.sh deleted file mode 100644 index d4c05b5342..0000000000 --- a/extras/ide-devfs.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -# udev external PROGRAM script -# return devfs-names for ide-devices -# BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}", GROUP="%c{3}" - -HOST="${2%\.[0-9]}" -TARGET="${2#[0-9]\.}" - -if [ -z "${HOST#[13579]}" ]; then - HOST=$((${HOST} - 1)) - BUS="1" -else - BUS="0" -fi - -get_dev_number() { - num=0 - DRIVE="${1%%[0-9]*}" - - for x in /proc/ide/*/media; do - if [ -e "${x}" ]; then - lMEDIA=`cat ${x}` - if [ "${lMEDIA}" = "$2" ]; then - num=$((${num} + 1)) - fi - if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then - break - fi - fi - done - - echo $((${num} - 1)) -} - -if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then - MEDIA=`cat /proc/ide/${1}/media` - if [ "${MEDIA}" = "cdrom" ]; then - echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` ${MEDIA} - elif [ "${MEDIA}" = "floppy" ]; then - echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc ${MEDIA} - elif [ "${MEDIA}" = "disk" ]; then - echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc ${MEDIA} - fi -else - echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3 -fi diff --git a/extras/raid-devfs.sh b/extras/raid-devfs.sh deleted file mode 100644 index ca279d45c0..0000000000 --- a/extras/raid-devfs.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -e -# -# Copyright (c) 2004 Marco d'Itri <md@linux.it> -# Copyright (c) 2004 Piotr Roszatycki <dexter@debian.org> -# -# Usage: -# KERNEL=="cciss!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k" -# KERNEL=="ida!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k" -# KERNEL=="rd!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k" - -get_dev_number_cciss() { - grep '^cciss/' /proc/driver/cciss/* | cat -n | \ - sed -n "/cciss\/$1:/s/cciss.*//p" -} - -get_dev_number_ida() { - grep '^ida/' /proc/driver/cpqarray/* | cat -n | \ - sed -n "/ida\/$1:/s/ida.*//p" -} - -get_dev_number_rd() { - grep '^ */dev/rd/' /proc/rd/*/initial_status | cat -n | \ - sed -n "/rd\/$1:/s/\/dev\/rd.*//p" -} - -get_dev_number() { - dev=$1 - num=$(eval $(echo get_dev_number_$TYPE $dev)) - [ "$num" ] || exit 1 - echo $(($num - 1)) -} - -TYPE=${1%%/*} -NAME=${1#*/} - -# abort if there was no match -[ "$TYPE" != "$1" ] || exit 1 - -case "$NAME" in - *p*) - LONG_NAME=disc$(get_dev_number ${NAME%%p*})/part${NAME##*p} - ;; - *) - LONG_NAME=disc$(get_dev_number $NAME)/disc - ;; -esac - -echo "$TYPE/$LONG_NAME" -exit 0 - diff --git a/extras/scsi-devfs.sh b/extras/scsi-devfs.sh deleted file mode 100644 index b1a17cb21e..0000000000 --- a/extras/scsi-devfs.sh +++ /dev/null @@ -1,88 +0,0 @@ -#! /bin/sh -# -# scsi-devfs.sh: udev external PROGRAM script -# -# Copyright 2004 Richard Gooch <rgooch@atnf.csiro.au> -# Copyright 2004 Fujitsu Ltd. -# Distributed under the GNU Copyleft version 2.0. -# -# return devfs-names for scsi-devices -# Usage in udev.rules: -# BUS="scsi", KERNEL="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}" -# BUS="scsi", KERNEL="sr*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}" -# BUS="scsi", KERNEL="st*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}" -# BUS="scsi", KERNEL="sg*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}" - -# Find out where sysfs is mounted. Exit if not available -sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'` -if [ "$sysfs" = "" ]; then - echo "sysfs is required" - exit 1 -fi -cd $sysfs/bus/scsi/devices - -case "$1" in - sd) - # Extract partition component - if [ "$3" = "" ]; then - lpart="disc" - spart="" - else - lpart="part$3" - spart="p$3" - fi - ;; - sr) - lpart="cdrom" - spart="" - ;; - st) - # Not supported yet - exit 1 - ;; - sg) - lpart="generic" - spart="" - ;; - *) - exit 1 - ;; -esac - -# Extract SCSI logical address components -scsi_host=`echo $2 | cut -f 1 -d:` -scsi_bus=`echo $2 | cut -f 2 -d:` -scsi_target=`echo $2 | cut -f 3 -d:` -scsi_lun=`echo $2 | cut -f 4 -d:` - -# Generate long and short common name parts -l_com="bus$scsi_bus/target$scsi_target/lun$scsi_lun/$lpart" -s_com="b${scsi_bus}t${scsi_target}u${scsi_lun}$spart" - -# Generate long and short logical names -l_log="scsi/host$scsi_host/$l_com" -s_log="$1/c${scsi_host}${s_com}" - -readlink $2 | grep -F -q pci -if [ "$?" != "0" ]; then - # Not a PCI controller, show logical locations only - echo $l_log $s_log - exit 0 -fi - -# Extract PCI address -tmp=`readlink $2 | sed -e 's@/host.*/.*@@'` -pci_addr=`basename "$tmp"` -pci_domain=`echo $pci_addr | cut -f 1 -d:` -pci_bus=`echo $pci_addr | cut -f 2 -d:` -pci_slot=`echo $pci_addr | tr . : | cut -f 3 -d:` -pci_function=`echo $pci_addr | cut -f 2 -d.` - -# Generate long and short physical names -l_pci="domain$pci_domain/bus$pci_bus/slot$pci_slot/function$pci_function" -l_phy="bus/pci/$l_pci/scsi/$l_com" -s_phy="$1/pci/$pci_addr/$s_com" - -echo $l_phy $s_phy $l_log $s_log - - |