summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/get-eeprom-device-config
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-02-16 16:05:15 -0600
commit20cb17dde5d1f8a34158b0c3f3b5e43a164bb81d (patch)
treef8c08c379dba140b19508598b54725aeb678e2f3 /recipes-bsp/multitech/get-eeprom-device-config
parent842ebc4e355a9f6636c5170f477f7f84f743456d (diff)
downloadmeta-multitech-atmel-20cb17dde5d1f8a34158b0c3f3b5e43a164bb81d.tar.gz
meta-multitech-atmel-20cb17dde5d1f8a34158b0c3f3b5e43a164bb81d.tar.bz2
meta-multitech-atmel-20cb17dde5d1f8a34158b0c3f3b5e43a164bb81d.zip
get-eeprom-device-config must be invoked after mts-io driver is loaded.
Diffstat (limited to 'recipes-bsp/multitech/get-eeprom-device-config')
-rwxr-xr-xrecipes-bsp/multitech/get-eeprom-device-config/init50
1 files changed, 50 insertions, 0 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