diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2018-05-15 15:50:24 +0300 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2018-05-15 12:03:49 -0500 |
commit | 0ae578fd7955cae5c63cc6e80ee46aaad12a5279 (patch) | |
tree | 7e88d7635af39d190544570c23a45953c162ff01 /recipes-bsp | |
parent | d89ab03409d531d21a791108367ae68d0a1f22a0 (diff) | |
download | meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.gz meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.bz2 meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.zip |
Move radio-reset init scripts to a separate recipe.
Diffstat (limited to 'recipes-bsp')
-rw-r--r-- | recipes-bsp/multitech/mts-io.inc | 68 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io/radio-reset.default | 8 | ||||
-rw-r--r-- | recipes-bsp/multitech/radio-reset/radio-reset.default | 11 | ||||
-rw-r--r-- | recipes-bsp/multitech/radio-reset/radio-reset.init (renamed from recipes-bsp/multitech/mts-io/radio-reset.init) | 13 | ||||
-rw-r--r-- | recipes-bsp/multitech/radio-reset_0.1.bb | 49 |
5 files changed, 70 insertions, 79 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index d6384a4..3ac5201 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -17,8 +17,6 @@ SRC_URI = " \ file://lora-led-updater \ file://mts-io.init \ file://mts-io.mtcap.init \ - file://radio-reset.init \ - file://radio-reset.default \ file://mts-io.conf \ " S = "${WORKDIR}/git" @@ -46,9 +44,7 @@ do_compile () { } -# Note that the opkg post install does not work if the radio-reset package is -# named mts-io-radio-reset. It may be too long for the opkg name to handle. -PACKAGES = "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-dev ${PN}-radio" +PACKAGES = "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-dev" FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mts_io.ko" @@ -64,9 +60,6 @@ FILES_${PN}-noarch_append_mtcap += "${sbindir}/lora-led-updater" FILES_${PN}-util += "${sbindir}/mts-util-lora2-reset" FILES_${PN}-util-dbg += "/usr/src /usr/sbin/.debug" FILES_${PN}-dev += "/usr/include/linux/mts_eeprom.h" -FILES_${PN}-radio = "${sysconfdir}/init.d/radio-reset \ - ${sysconfdir}/default/radio-reset" -RRECOMMENDS_${PN}-radio = "update-rc.d" INITSCRIPT_NAME = "mts-io" @@ -87,7 +80,6 @@ fakeroot do_install () { install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/mts-io.init ${D}${sysconfdir}/init.d/mts-io - install -m 0755 ${WORKDIR}/radio-reset.init ${D}${sysconfdir}/init.d/radio-reset install -m 0755 ${WORKDIR}/led-status_heartbeat_trigger ${D}/${sysconfdir}/init.d/ install -d ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/mts-io.conf ${D}${sysconfdir}/default/mts-io @@ -100,9 +92,6 @@ fakeroot do_install () { install -d ${D}${libdir}/mts-io-sysfs install -m 0755 ${S}/io-tool/mts-io-sysfs-inc.sh ${D}${libdir}/mts-io-sysfs install -m 0755 ${S}/io-tool/mts-io-sysfs ${D}${sbindir}/mts-io-sysfs - - install -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/radio-reset.default ${D}${sysconfdir}/default/radio-reset } fakeroot do_install_append_mtcap() { @@ -110,58 +99,3 @@ fakeroot do_install_append_mtcap() { install -m 0755 ${WORKDIR}/mts-io.mtcap.init ${D}${sysconfdir}/init.d/mts-io install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater } - -# Radio-reset is on boot and shutdown for AEP/mlinux -fakeroot do_install_append_mtcdt() { - # install MTCAP mts-io init script - sed -i 's/STOP="no"/STOP="yes"/' ${D}${sysconfdir}/default/radio-reset -} - -# Install the radio reset. Not allowed two init script in one recipe. -pkg_postinst_${PN}-radio() { -#!/bin/sh -# Begin section update-rc.d -logger -t opkg.install.radio -p daemon.info 'radio preinstall' -if type update-rc.d >/dev/null 2>/dev/null; then - if [ -n "$D" ]; then - OPT="-r $D" - else - OPT="-s" - fi - update-rc.d $OPT radio-reset start 39 S . -fi -# End section update-rc.d -} - -pkg_preinst_${PN}-radio() { - #!/bin/bash - if type update-rc.d >/dev/null 2>/dev/null; then - if [ -n "$D" ]; then - OPT="-f -r $D" - else - OPT="-f" - fi - update-rc.d $OPT radio-reset remove - fi -} - -pkg_prerm_${PN}-radio() { - #!/bin/bash - if [ -z "$D" ] ; then - logger -t opkg.remove.radio -p daemon.info 'Removing radio-reset' - fi -} - - -pkg_postrm_${PN}-radio() { - #!/bin/bash - if type update-rc.d >/dev/null 2>/dev/null; then - if [ -n "$D" ]; then - OPT="-f -r $D" - else - OPT="-f" - fi - update-rc.d $OPT radio-reset remove - fi -} - diff --git a/recipes-bsp/multitech/mts-io/radio-reset.default b/recipes-bsp/multitech/mts-io/radio-reset.default deleted file mode 100644 index ae2e241..0000000 --- a/recipes-bsp/multitech/mts-io/radio-reset.default +++ /dev/null @@ -1,8 +0,0 @@ -# If Enabled, it is possible to reset the radio on boot or shutdown. -# It is always possible to reset the radio using -# /etc/init.d/reload manually. -ENABLED="yes" -# set to "no" to disable radio-reset on shutdown -STOP="no" -# set to "no" to disable radio-reset on boot -START="yes" diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.default b/recipes-bsp/multitech/radio-reset/radio-reset.default new file mode 100644 index 0000000..56b0ebc --- /dev/null +++ b/recipes-bsp/multitech/radio-reset/radio-reset.default @@ -0,0 +1,11 @@ +# If Enabled, it is possible to reset the radio on boot or shutdown. +# It is always possible to reset the radio using +# /etc/init.d/radio-reset reload manually. +ENABLED="yes" + +# set to "yes" to enable radio-reset on boot +ONSTART="no" + +# set to "no" to disable radio-reset on reboot +ONSTOP="yes" + diff --git a/recipes-bsp/multitech/mts-io/radio-reset.init b/recipes-bsp/multitech/radio-reset/radio-reset.init index f469df4..1326fee 100644 --- a/recipes-bsp/multitech/mts-io/radio-reset.init +++ b/recipes-bsp/multitech/radio-reset/radio-reset.init @@ -1,22 +1,27 @@ #!/bin/sh +# set default values ENABLED="yes" +ONSTART="no" +ONSTOP="yes" if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then exit 0 fi + +# load the values from /etc/default/radio-reset [ -r /etc/default/radio-reset ] && source /etc/default/radio-reset case $1 in start) - if [[ $ENABLED == "yes" ]] && [[ $START == "yes" ]] ; then - mts-io-sysfs store radio-reset 0 + if [[ $ENABLED == "yes" ]] && [[ $ONSTART == "yes" ]] ; then + mts-io-sysfs store radio-reset 0 echo "Resetting cellular radio" fi ;; stop) - if [[ $ENABLED == "yes" ]] && [[ $STOP == "yes" ]] ; then - mts-io-sysfs store radio-reset 0 + if [[ $ENABLED == "yes" ]] && [[ $ONSTOP == "yes" ]] ; then + mts-io-sysfs store radio-reset 0 echo "Resetting cellular radio" fi ;; diff --git a/recipes-bsp/multitech/radio-reset_0.1.bb b/recipes-bsp/multitech/radio-reset_0.1.bb new file mode 100644 index 0000000..65c6e09 --- /dev/null +++ b/recipes-bsp/multitech/radio-reset_0.1.bb @@ -0,0 +1,49 @@ +DESCRIPTION = "Cellular radio reset init scripts" +HOMEPAGE = "http://www.multitech.net/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = " \ + file://radio-reset.init \ + file://radio-reset.default \ +" + +inherit update-rc.d + +INITSCRIPT_NAME = "radio-reset" + +# The script starts with runlevel of 40 (right after mts-io) in initlevel S (Single-user mode on boot), +# and stops with runlevel of 99 in initlevel 6 (reboot) +INITSCRIPT_PARAMS = "start 40 S . stop 99 6 ." + +do_install() { + install -d ${D}/etc/init.d + install -m 0755 ${WORKDIR}/radio-reset.init ${D}/etc/init.d/radio-reset + + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/radio-reset.default ${D}${sysconfdir}/default/radio-reset +} + +fakeroot do_install_append_mtr() { + # enable radio-reset on start for the mtr hardware + sed -i 's/ONSTART="no"/ONSTART="yes"/g' ${D}${sysconfdir}/default/radio-reset + + # disable radio-reset on shutdown for the mtr hardware + sed -i 's/ONSTOP="yes"/ONSTOP="no"/g' ${D}${sysconfdir}/default/radio-reset +} + +fakeroot do_install_append_mtrv1() { + # enable radio-reset on start for the mtrv1 hardware + sed -i 's/ONSTART="no"/ONSTART="yes"/g' ${D}${sysconfdir}/default/radio-reset + + # disable radio-reset on shutdown for the mtrv1 hardware + sed -i 's/ONSTOP="yes"/ONSTOP="no"/g' ${D}${sysconfdir}/default/radio-reset +} + +fakeroot do_install_append_mtcap() { + # disable radio-reset both on start and on shutdown for the mtcap hardware + # mtcap issues the radio reset in /etc/init.d/mts-io init script + sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/radio-reset +} |