summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-02-07 10:29:43 -0600
committerJohn Klug <john.klug@multitech.com>2018-03-01 12:36:27 -0600
commitce6f3bfde34f9cbb44ab2d08a458019eb44768c6 (patch)
tree83235a04b171dcb871095e572e828579972261f9
parent4d8a3b5b9380b7b79801396742a4cf52d879dd50 (diff)
downloadmeta-multitech-ce6f3bfde34f9cbb44ab2d08a458019eb44768c6.tar.gz
meta-multitech-ce6f3bfde34f9cbb44ab2d08a458019eb44768c6.tar.bz2
meta-multitech-ce6f3bfde34f9cbb44ab2d08a458019eb44768c6.zip
get-eeprom-device-config must be invoked after mts-io driver is loaded.
-rwxr-xr-xrecipes-bsp/multitech/get-eeprom-device-config/init50
-rw-r--r--recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb (renamed from recipes-bsp/multitech/get-eeprom-device-config_1.0.0.bb)12
2 files changed, 60 insertions, 2 deletions
diff --git a/recipes-bsp/multitech/get-eeprom-device-config/init b/recipes-bsp/multitech/get-eeprom-device-config/init
new file mode 100755
index 0000000..0ba5075
--- /dev/null
+++ b/recipes-bsp/multitech/get-eeprom-device-config/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=/sbin/get-eeprom-device-config
+JASONFILE=/run/config/device_info.json
+
+case "$1" in
+ start)
+ if ! [[ -f /run/config/device_info.json ]] ; then
+ [[ -d /run/config ]] || mkdir -m 755 -p /run/config
+ if [[ -x ${GETCONFIG} ]] ; then
+ ${GETCONFIG} -t1 # Radio might not be found yet.
+ fi
+ fi
+ ;;
+ stop)
+ ;;
+ force-reload)
+ rm -rf /run/config/*
+ ${GETCONFIG}
+ ;;
+ restart)
+ ${GETCONFIG}
+ ;;
+ reload)
+ ${GETCONFIG}
+ ;;
+ status)
+ if [[ -f ${JASONFILE} ]] ; 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/get-eeprom-device-config_1.0.0.bb b/recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb
index 821f560..5f2573e 100644
--- a/recipes-bsp/multitech/get-eeprom-device-config_1.0.0.bb
+++ b/recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb
@@ -1,4 +1,5 @@
-# Script to copy the EEPROM to /run/config
+# Script to copy the EEPROM to /run/config and
+# init script to populate /run/config
PR = "r1"
DESCRIPTION = "EEPROM copyting tool"
HOMEPAGE = "http://www.multitech.net/"
@@ -10,7 +11,8 @@ RDEPENDS_${PN} =+ "bash"
SRCREV = "${PV}"
-SRC_URI = "file://${PN}.sh"
+SRC_URI = "file://${PN}.sh \
+ file://init"
PARALLEL_MAKE = ""
@@ -18,6 +20,12 @@ PARALLEL_MAKE = ""
fakeroot do_install_append() {
# install MTCAP mts-io init script
install -d 0755 ${D}${base_sbindir}
+ install -d 0755 ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/${PN}.sh ${D}${base_sbindir}/${PN}
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/
}
+
+INITSCRIPT_NAME = "eeprom-config"
+# Must start after MTS-IO to read the accessory cards.
+INITSCRIPT_PARAMS = "start 40 S ."