summarylogtreecommitdiffstats
path: root/20-platform
diff options
context:
space:
mode:
authorPlaton Ryzhikov2021-06-03 12:32:50 +0300
committerPlaton Ryzhikov2021-06-03 12:32:50 +0300
commit16a795f85c56fe8d370357f1eea60ee78497be86 (patch)
treecdfe5bc6a9f3bce8a56970d050c99f069768e19d /20-platform
parent471fbeacba8d0023e90da1ab373b293d5dc92140 (diff)
downloadaur-smdev-platform.tar.gz
make script POSIX-compliant
Diffstat (limited to '20-platform')
-rw-r--r--20-platform11
1 files changed, 6 insertions, 5 deletions
diff --git a/20-platform b/20-platform
index 175dde4a3a6a..18bec2000b76 100644
--- a/20-platform
+++ b/20-platform
@@ -1,8 +1,9 @@
-if [[ $DEVNAME && $(echo $DEVPATH | grep /platform) ]]; then # add links for platform devices
+[ "$DEVNAME" -a "$(echo $DEVPATH | grep /platform)" ] && /bin/sh -c '# 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')
+ 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')
+ 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")
fi
-fi
+'
+#fi