summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-11-11 16:55:18 -0600
committerJohn Klug <john.klug@multitech.com>2020-11-11 16:55:18 -0600
commitb818862c46452131eee6ac1591c5dd322cb39a85 (patch)
tree5949e908fa4b528496aeb99523f997b17759fd77
parent0d28a984a75a1e803cf2fbb830375fbd5f7b134f (diff)
downloadmeta-multitech-b818862c46452131eee6ac1591c5dd322cb39a85.tar.gz
meta-multitech-b818862c46452131eee6ac1591c5dd322cb39a85.tar.bz2
meta-multitech-b818862c46452131eee6ac1591c5dd322cb39a85.zip
Add mts-io-sysfs from arch/common branch multiarch5-thud
-rwxr-xr-xrecipes-bsp/multitech/mts-io-sysfs/mts-io-sysfs.init50
-rw-r--r--recipes-bsp/multitech/mts-io-sysfs_0.1.7.bb49
2 files changed, 99 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io-sysfs/mts-io-sysfs.init b/recipes-bsp/multitech/mts-io-sysfs/mts-io-sysfs.init
new file mode 100755
index 0000000..3af4f71
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io-sysfs/mts-io-sysfs.init
@@ -0,0 +1,50 @@
+#! /bin/bash
+
+### BEGIN INIT INFO
+# Provides: eeprom-config
+# Required-Start: mts-io
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Create /run/config with eeprom configuration
+### END INIT INFO
+
+GETCONFIG=/usr/sbin/mts-io-sysfs
+JSONFILE=/run/config/device_info.json
+
+case "$1" in
+ start)
+ if ! [[ -f ${JSONFILE} ]] ; then
+ [[ -d /run/config ]] || mkdir -m 755 -p /run/config
+ if [[ -x ${GETCONFIG} ]] ; then
+ ${GETCONFIG} init -t1 # Radio might not be found yet.
+ fi
+ fi
+ ;;
+ stop)
+ ;;
+ force-reload)
+ rm -rf /run/config/*
+ ${GETCONFIG} init
+ ;;
+ restart)
+ ${GETCONFIG} init
+ ;;
+ reload)
+ ${GETCONFIG} init
+ ;;
+ status)
+ if [[ -f ${JSONFILE} ]] ; then
+ echo EEPROM Config is populated
+ exit 0
+ else
+ echo EEPROM Config is not populated
+ exit 3
+ fi
+ ;;
+ *)
+ echo "Usage: ntpd { start | stop | status | restart | reload | force-reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes-bsp/multitech/mts-io-sysfs_0.1.7.bb b/recipes-bsp/multitech/mts-io-sysfs_0.1.7.bb
new file mode 100644
index 0000000..4a74b21
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io-sysfs_0.1.7.bb
@@ -0,0 +1,49 @@
+DESCRIPTION = "mts-io sysfs wrapper"
+HOMEPAGE = "http://www.multitech.net/"
+SECTION = "base"
+PRIORITY = "optional"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+inherit update-rc.d
+
+DEPENDS = "libmts"
+RDEPENDS_${PN} = "bash"
+PR = "r0"
+
+SRCREV = "${PV}"
+
+SRC_URI = "git://git.multitech.net/mts-io-sysfs.git;protocol=ssh;branch=master \
+ file://mts-io-sysfs.init"
+
+S = "${WORKDIR}/git"
+
+do_configure_append() {
+}
+
+do_compile() {
+ oe_runmake
+}
+
+
+fakeroot do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/build/mts-io-sysfs ${D}${sbindir}/mts-io-sysfs
+ install -d 0755 ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/mts-io-sysfs.init ${D}${sysconfdir}/init.d/eeprom-config
+}
+
+
+INITSCRIPT_NAME = "eeprom-config"
+# Must start after MTS-IO to read the accessory cards.
+INITSCRIPT_PARAMS = "start 40 S ."
+
+
+PACKAGES = "${PN}"
+
+FILES_${PN} += "${libdir}/mts-io-sysfs*"
+FILES_${PN} += "${sbindir}/mts-io-sysfs"
+
+# disable this on purpose for dev purposes
+do_rm_work() {
+ echo "skipping"
+}