summarylogtreecommitdiffstats
path: root/20-platform
diff options
context:
space:
mode:
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