From ce6f3bfde34f9cbb44ab2d08a458019eb44768c6 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 7 Feb 2018 10:29:43 -0600 Subject: get-eeprom-device-config must be invoked after mts-io driver is loaded. --- .../multitech/get-eeprom-device-config/init | 50 ++++++++++++++++++++++ .../multitech/get-eeprom-device-config_1.0.0.bb | 23 ---------- .../multitech/get-eeprom-device-config_1.1.0.bb | 31 ++++++++++++++ 3 files changed, 81 insertions(+), 23 deletions(-) create mode 100755 recipes-bsp/multitech/get-eeprom-device-config/init delete mode 100644 recipes-bsp/multitech/get-eeprom-device-config_1.0.0.bb create mode 100644 recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb 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.0.0.bb deleted file mode 100644 index 821f560..0000000 --- a/recipes-bsp/multitech/get-eeprom-device-config_1.0.0.bb +++ /dev/null @@ -1,23 +0,0 @@ -# Script to copy the EEPROM to /run/config -PR = "r1" -DESCRIPTION = "EEPROM copyting tool" -HOMEPAGE = "http://www.multitech.net/" -SECTION = "console/utils" -PRIORITY = "optional" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" -RDEPENDS_${PN} =+ "bash" - -SRCREV = "${PV}" - -SRC_URI = "file://${PN}.sh" - -PARALLEL_MAKE = "" - - -fakeroot do_install_append() { - # install MTCAP mts-io init script - install -d 0755 ${D}${base_sbindir} - install -m 0755 ${WORKDIR}/${PN}.sh ${D}${base_sbindir}/${PN} -} - diff --git a/recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb b/recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb new file mode 100644 index 0000000..5f2573e --- /dev/null +++ b/recipes-bsp/multitech/get-eeprom-device-config_1.1.0.bb @@ -0,0 +1,31 @@ +# 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/" +SECTION = "console/utils" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" +RDEPENDS_${PN} =+ "bash" + +SRCREV = "${PV}" + +SRC_URI = "file://${PN}.sh \ + file://init" + +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 ." -- cgit v1.2.3