summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2016-10-28 09:38:45 -0500
committerJason Reiss <jreiss@multitech.com>2016-10-28 09:38:45 -0500
commit5362bf1fc4b8da40f1c7a6b00996f6a24adb4a62 (patch)
treeb844092bbb460a876eabac3b22f44528765dead6
parent2554947afa92748abf36140797aac90b78552cd0 (diff)
downloadmeta-mlinux-5362bf1fc4b8da40f1c7a6b00996f6a24adb4a62.tar.gz
meta-mlinux-5362bf1fc4b8da40f1c7a6b00996f6a24adb4a62.tar.bz2
meta-mlinux-5362bf1fc4b8da40f1c7a6b00996f6a24adb4a62.zip
lora-gateway: add script to link spidev0.0 to installed card
-rw-r--r--recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh12
-rw-r--r--recipes-connectivity/lora/lora-gateway_4.0.1.bb13
2 files changed, 21 insertions, 4 deletions
diff --git a/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh b/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh
new file mode 100644
index 0000000..c350fff
--- /dev/null
+++ b/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+port1=/sys/devices/platform/mts-io/ap1
+port2=/sys/devices/platform/mts-io/ap2
+
+lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null)
+
+if [ -d $port1 ] && [[ $(cat $port1/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32766.2 /dev/spidev0.0
+elif [ -d $port2 ] && [[ $(cat $port2/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32765.2 /dev/spidev0.0
+fi
diff --git a/recipes-connectivity/lora/lora-gateway_4.0.1.bb b/recipes-connectivity/lora/lora-gateway_4.0.1.bb
index e353670..7eac73e 100644
--- a/recipes-connectivity/lora/lora-gateway_4.0.1.bb
+++ b/recipes-connectivity/lora/lora-gateway_4.0.1.bb
@@ -6,13 +6,14 @@ SECTION = "console/utils"
LICENSE = "SEMTECH"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a2bdef95625509f821ba00460e3ae0eb"
DEPENDS = ""
-PR = "r5"
+PR = "r6"
SRCREV = "v${PV}"
SRC_URI = "git://github.com/Lora-net/lora_gateway.git;protocol=git \
file://lora-gateway-add-fpga-version-28.patch \
file://library_4.0.cfg \
file://lora-gateway-add-spi-path-function.patch \
+ file://ln-lora-spi-dev.sh \
"
SRC_URI[md5sum] = "9e06a3733a9fea39a3d61f77b412badf"
@@ -37,7 +38,10 @@ do_install() {
install -m 0644 libloragw/libloragw.a ${D}${libdir}/lora
install -m 0644 libloragw/library.cfg ${D}${libdir}/lora
install -m 0644 libloragw/inc/* ${D}${includedir}/lora
- install -m 0644 libloragw/readme.md ${D}${libdir}/lora
+ install -m 0644 libloragw/readme.md ${D}${libdir}/lora/lora-gw-readme.md
+
+ install -d ${D}/opt/lora/
+ install -m 0755 ${WORKDIR}/ln-lora-spi-dev.sh ${D}/opt/lora/
install -d ${D}/opt/lora/gateway-utils
install -m 0755 libloragw/test_* ${D}/opt/lora/gateway-utils/
@@ -50,8 +54,9 @@ do_install() {
PACKAGES += "${PN}-utils ${PN}-utils-dbg"
-FILES_${PN}-utils = "/opt/lora/gateway-utils/*"
-FILES_${PN}-utils-dbg = "/opt/lora/gateway-utils/.debug"
+FILES_${PN} = "${libdir}/lora/lora-gw-readme.md"
+FILES_${PN}-utils = "/opt/lora/gateway-utils/* /opt/lora/ln-lora-spi-dev.sh"
+FILES_${PN}-utils-dbg = "/opt/lora/gateway-utils/.debug /opt/lora/ln-lora-spi-dev.sh"
FILES_${PN}-dev = "${includedir}/lora ${libdir}/lora/library.cfg"
FILES_${PN}-staticdev = "${libdir}/lora/libloragw.a"