]>
git.ipfire.org Git - thirdparty/systemd.git/blob - extras/ide-devfs.sh
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="%c{1} %c{2}"
10 if [ -z "${HOST#[13579]}" ]; then
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
38 if [ -z "$3" -a -f /proc
/ide
/${1}/media
]; then
39 MEDIA
=`cat /proc/ide/${1}/media`
40 if [ "${MEDIA}" = "cdrom" ]; then
41 echo ide
/host${HOST}/bus${BUS}/target${TARGET}/lun
0/cd cdroms
/cdrom
`get_dev_number $1 cdrom`
42 elif [ "${MEDIA}" = "floppy" ]; then
43 echo ide
/host${HOST}/bus${BUS}/target${TARGET}/lun
0/disc floppies
/floppy
`get_dev_number $1 floppy`/disc
44 elif [ "${MEDIA}" = "disk" ]; then
45 echo ide
/host${HOST}/bus${BUS}/target${TARGET}/lun
0/disc discs
/disc
`get_dev_number $1 disk`/disc
48 echo ide
/host${HOST}/bus${BUS}/target${TARGET}/lun
0/part
$3 discs
/disc
`get_dev_number $1 disk`/part
$3