3 # udev external PROGRAM script
4 # return devfs-names for ide-devices
5 # BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%1c %2c"
10 if [ -z "${HOST#[13579]}" ]; then
11 HOST=`expr ${HOST} - 1`
21 local DRIVE="${1%[0-9]*}"
23 for x in /proc/ide/*/media; do
24 if [ -e "${x}" ]; then
26 if [ "${MEDIA}" = "$2" ]; then
29 if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then
35 echo `expr ${num} - 1`
39 MEDIA=`cat /proc/ide/${1}/media`
40 if [ "${MEDIA}" = "cdrom" ]; then
41 echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom`
42 elif [ "${MEDIA}" = "disk" ]; then
43 echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc discs/disc`get_dev_number $1 disk`/disc
46 echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/part$3 discs/disc`get_dev_number $1 disk`/part$3