From: Libor Klepac Date: Tue, 9 May 2006 16:23:20 +0000 (+0200) Subject: path_id: add platform and serio support X-Git-Tag: 174~2266 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=5ac7a25e85729cdac995fd28de48c55487be31c9 path_id: add platform and serio support --- diff --git a/extras/path_id/path_id b/extras/path_id/path_id index 7f0d53a18..913c4909f 100644 --- a/extras/path_id/path_id +++ b/extras/path_id/path_id @@ -96,6 +96,56 @@ handle_pci () { RESULT=0 } +handle_platform () { + local DEV=$1 + cd -P $1 + DEV=${PWD} + platform_id=${DEV##*/} + host_dev_path=$DEV + while [ ! -z "$host_dev_path" ] ; do + case "$host_dev_path" in + */platform*) + host_dev_path=${host_dev_path%/*} + ;; + *) + break + ;; + esac + done + if [ "$d" ]; then + d="platform-$platform_id-$d" + else + d="platform-$platform_id" + fi + D="$host_dev_path" + RESULT=0 +} + +handle_serio () { + local DEV=$1 + cd -P $1 + DEV=${PWD} + serio_id=${DEV##*/serio} + host_dev_path=$DEV + while [ ! -z "$host_dev_path" ] ; do + case "$host_dev_path" in + */serio*) + host_dev_path=${host_dev_path%/*} + ;; + *) + break + ;; + esac + done + if [ "$d" ]; then + d="serio-$serio_id-$d" + else + d="serio-$serio_id" + fi + D="$host_dev_path" + RESULT=0 +} + handle_ide () { : handle_ide $* local DEV=$1 @@ -372,6 +422,12 @@ handle_device () { */pci[0-9]*:[0-9]*) handle_pci "$D" ;; + */serio[0-9]*) + handle_serio "$D" + ;; + */platform/*) + handle_platform "$D" + ;; */devices) D= ;;