summarylogtreecommitdiffstats
path: root/20-platform
diff options
context:
space:
mode:
authorPlaton Ryzhikov2018-12-24 16:34:02 +0300
committerPlaton Ryzhikov2018-12-24 16:34:02 +0300
commit88d5d60e5e8a59266265f854de49076bcfb15d50 (patch)
treee9fa6551cfacb929dedbb437c71fb2a0bc9512a3 /20-platform
downloadaur-88d5d60e5e8a59266265f854de49076bcfb15d50.tar.gz
Add smdev script for platform devices
Diffstat (limited to '20-platform')
-rw-r--r--20-platform8
1 files changed, 8 insertions, 0 deletions
diff --git a/20-platform b/20-platform
new file mode 100644
index 00000000000..175dde4a3a6
--- /dev/null
+++ b/20-platform
@@ -0,0 +1,8 @@
+if [[ $DEVNAME && $(echo $DEVPATH | grep /platform) ]]; then # add links for platform devices
+ test -d $(dirname /dev/$DEVNAME)/by-path || mkdir -p $(dirname /dev/$DEVNAME)/by-path
+ if [[ $(echo $DEVNAME | grep dri) ]]; then # for dri create -card and -render links
+ ln -sf /dev/$DEVNAME /dev/$(dirname $DEVNAME)/by-path/platform-$(echo $DEVPATH | sed -e 's/\//\n/g' | grep '[0-9]:[0-9]' | sed -n '2p')-$(echo $DEVNAME | awk -F / '{print $2}' | sed -e 's/[A-Z]//g' -e 's/[0-9]//g')
+ else # generic
+ ln -sf /dev/$DEVNAME /dev/$(dirname $DEVNAME)/by-path/pci-$(echo $DEVPATH | sed -e 's/\//\n/g' | grep '[0-9]:[0-9]' | sed -n '2p')
+ fi
+fi