summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-03-08 00:34:36 +0100
committerKay Sievers <kay.sievers@suse.de>2006-03-08 00:34:36 +0100
commitcdce0be8956a26a4a2a4f9fb338508ffd75672b9 (patch)
tree09dc651e31bf77d136224404bf2ce297cb62a3eb /extras
parent79102489260da9f577d7c1fb3665dd95d1596bea (diff)
remove devfs rules and scripts
Diffstat (limited to 'extras')
-rw-r--r--extras/ide-devfs.sh47
-rw-r--r--extras/raid-devfs.sh50
-rw-r--r--extras/scsi-devfs.sh88
3 files changed, 0 insertions, 185 deletions
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
-
-