summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPlaton Ryzhikov2018-12-24 16:34:02 +0300
committerPlaton Ryzhikov2018-12-24 16:34:02 +0300
commit88d5d60e5e8a59266265f854de49076bcfb15d50 (patch)
treee9fa6551cfacb929dedbb437c71fb2a0bc9512a3
downloadaur-88d5d60e5e8a59266265f854de49076bcfb15d50.tar.gz
Add smdev script for platform devices
-rw-r--r--.SRCINFO11
-rw-r--r--20-platform8
-rw-r--r--PKGBUILD16
3 files changed, 35 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6ee20751caf9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,11 @@
+pkgbase = smdev-platform
+ pkgver = 20181204
+ pkgrel = 1
+ arch = any
+ groups = smdev-scripts
+ depends = smdev
+ source = 20-platform
+ sha256sums = 4e78ef0bc3b42d276bda1ca18783e95c700fa3918e9ceb1e36fff8a8241bd4ff
+
+pkgname = smdev-platform
+
diff --git a/20-platform b/20-platform
new file mode 100644
index 000000000000..175dde4a3a6a
--- /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
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1e5c64a13ada
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,16 @@
+# Maintainer: Platon Ryzhikov <ihummer63@yandex.ru>
+
+pkgname=smdev-platform
+pkgver=20181204
+pkgrel=1
+pkgdesk="Add links to platform devices in /dev with smdev"
+arch=('any')
+licence=('MIT')
+groups=('smdev-scripts')
+depends=('smdev')
+source=("20-platform")
+sha256sums=('4e78ef0bc3b42d276bda1ca18783e95c700fa3918e9ceb1e36fff8a8241bd4ff')
+
+package() {
+ install -m644 -D 20-platform ${pkgdir}/etc/smdev/add/20-platform
+}