diff options
Diffstat (limited to 'recipes-bsp')
-rw-r--r-- | recipes-bsp/multitech/mtac-eth_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac-gpiob_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac-lora_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac-mfser_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac-pulse_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac-xdot_1.0.0.bb | 45 | ||||
-rw-r--r-- | recipes-bsp/multitech/mtac_1.0.0.bb | 73 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io.inc | 48 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io/mts-io.init | 57 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io_3.0.2.bb (renamed from recipes-bsp/multitech/mts-io_2.2.1.bb) | 0 |
10 files changed, 435 insertions, 13 deletions
diff --git a/recipes-bsp/multitech/mtac-eth_1.0.0.bb b/recipes-bsp/multitech/mtac-eth_1.0.0.bb new file mode 100644 index 0000000..77a36f9 --- /dev/null +++ b/recipes-bsp/multitech/mtac-eth_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC ETH (Ethernet) Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-eth/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-eth.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_eth.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_eth.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac-gpiob_1.0.0.bb b/recipes-bsp/multitech/mtac-gpiob_1.0.0.bb new file mode 100644 index 0000000..4fc404d --- /dev/null +++ b/recipes-bsp/multitech/mtac-gpiob_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC GPIOB Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-gpiob/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-gpiob.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_gpiob.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_gpiob.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac-lora_1.0.0.bb b/recipes-bsp/multitech/mtac-lora_1.0.0.bb new file mode 100644 index 0000000..c068b58 --- /dev/null +++ b/recipes-bsp/multitech/mtac-lora_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC LoRa Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-lora/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-lora.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_lora.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_lora.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac-mfser_1.0.0.bb b/recipes-bsp/multitech/mtac-mfser_1.0.0.bb new file mode 100644 index 0000000..fe09af2 --- /dev/null +++ b/recipes-bsp/multitech/mtac-mfser_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC Multi-Function Serial Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-mfser/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-mfser.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_mfser.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_mfser.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac-pulse_1.0.0.bb b/recipes-bsp/multitech/mtac-pulse_1.0.0.bb new file mode 100644 index 0000000..98f13ab --- /dev/null +++ b/recipes-bsp/multitech/mtac-pulse_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC PULSE Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-pulse/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-pulse.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_pulse.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_pulse.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac-xdot_1.0.0.bb b/recipes-bsp/multitech/mtac-xdot_1.0.0.bb new file mode 100644 index 0000000..8fc75d6 --- /dev/null +++ b/recipes-bsp/multitech/mtac-xdot_1.0.0.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "MTAC XDOT (LoRa) Card" +HOMEPAGE = "http://www.multitech.net/developer/products/multiconnect-conduit-platform/accessory-cards/mtac-xdot/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mtac mts-io" +RDEPENDS_${PN} = "kernel-module-mtac" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac-xdot.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +PACKAGES = "kernel-module-${PN}" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac_xdot.ko" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac_xdot.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra +} diff --git a/recipes-bsp/multitech/mtac_1.0.0.bb b/recipes-bsp/multitech/mtac_1.0.0.bb new file mode 100644 index 0000000..e6038a9 --- /dev/null +++ b/recipes-bsp/multitech/mtac_1.0.0.bb @@ -0,0 +1,73 @@ +DESCRIPTION = "mtac drivers" +HOMEPAGE = "http://www.multitech.net/" +SECTION = "base" +PRIORITY = "optional" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" +DEPENDS = "virtual/kernel mts-io" +INC_PR = "r0" + +SRCREV = "${PV}" + +PR = "${INC_PR}.0-${MLINUX_KERNEL_VERSION}${MLINUX_KERNEL_EXTRA_VERSION}" + +SRC_URI = " \ + git://git.multitech.net/mtac.git;protocol=git \ +" +S = "${WORKDIR}/git" + +inherit module + +EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \ + KBUILD_VERBOSE=1 \ + M=${S} \ + modules \ + " + +do_compile () { + bbnote make "$@" + make "$@" + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + oe_runmake +} + +L1 = "${STAGING_KERNEL_DIR}/include/linux/" + +# Bitbake/Yocto automatically installs in to L2. +L2 = "${STAGING_INCDIR}/linux/" + +L3 = "${D}/usr/include/linux/" + +PACKAGES = "kernel-module-${PN} ${PN}-dev" + +FILES_kernel-module-${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mtac.ko" + +FILES_${PN}-dev += "/usr/include/linux/mtac.h" + +PARALLEL_MAKE = "" + +fakeroot do_install () { + install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + install -d ${D}/usr/include/linux/ + # use cp instead of install so the driver doesn't get stripped + cp ${S}/mtac.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra + install -m 0644 ${S}/mtac.h ${L1} + install -m 0644 ${S}/mtac.h ${L3} +} + +# Yocto seems to insist on Python for this function +# This function is to make debugging easier, so the package +# can be built a 2nd time. +fakeroot do_cleansstate_prepend() { + L1 = d.getVar("L1",True) + L2 = d.getVar("L2",True) + bb.note("L1 is " + L1) + bb.note("L2 is " + L2) + + F1 = L1 + "/mtac.h" + F2 = L2 + "/mtac.h" + if os.path.exists(F1): + os.remove(F1) + if os.path.exists(F2): + os.remove(F2) +} diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index 3ac5201..93ae253 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19 file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ " DEPENDS = "virtual/kernel" -INC_PR = "r0" +INC_PR = "r1" SRCREV = "${PV}" @@ -59,24 +59,37 @@ FILES_${PN}-noarch += "${sbindir}/mts-io-sysfs" 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}-dev += "/usr/include/linux/mts_eeprom.h /usr/include/linux/mts_io.h" INITSCRIPT_NAME = "mts-io" INITSCRIPT_PARAMS = "start 39 S ." PARALLEL_MAKE = "" +L1 = "${STAGING_KERNEL_DIR}/include/linux/" + +# Bitbake/Yocto automatically installs in to L2. +L2 = "${STAGING_INCDIR}/linux/" + +L3 = "${D}/usr/include/linux/" fakeroot do_install () { make DESTDIR=${D} install install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra # use cp instead of install so the driver doesn't get stripped cp ${S}/io-module/mts_io.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra - cp ${S}/io-module/mts_io.h ${STAGING_KERNEL_DIR}/include/linux/ - cp ${S}/io-module/mts_io.h ${STAGING_INCDIR}/linux/ - install -m0644 ${S}/io-module/mts_eeprom.h ${STAGING_KERNEL_DIR}/include/linux/ - install -d ${D}/usr/include/linux/ - install -m 0644 ${S}/io-module/mts_eeprom.h ${D}/usr/include/linux/ + install -d ${L3} + + echo "STAGING_KERNEL_DIR is ${STAGING_KERNEL_DIR}" + echo "STAGING_INCDIR is ${STAGING_INCDIR}" + echo "D/usr/include/linux/ is ${D}/usr/include/linux/" + + install -m 0644 ${S}/io-module/mts_io.h ${L1} + # install -m 0644 ${S}/io-module/mts_io.h ${L2} + install -m 0644 ${S}/io-module/mts_io.h ${L3} + + install -m 0644 ${S}/io-module/mts_eeprom.h ${L1} + # install -m 0644 ${S}/io-module/mts_eeprom.h ${L2} + install -m 0644 ${S}/io-module/mts_eeprom.h ${L3} install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/mts-io.init ${D}${sysconfdir}/init.d/mts-io @@ -99,3 +112,22 @@ 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 } + +# Yocto seems to insist on Python for this function +# This function is to make debugging easier, so the package +# can be built a 2nd time. +fakeroot do_cleansstate_prepend() { + L1 = d.getVar("L1",True) + L2 = d.getVar("L2",True) + bb.note("L1 is " + L1) + bb.note("L2 is " + L2) + + F1 = L1 + "/mts_io.h" + F2 = L2 + "/mts_io.h" + F3 = L1 + "/mts_eeprom.h" + F4 = L2 + "/mts_eeprom.h" + + for f in [F1, F2, F3, F4]: + if os.path.exists(f): + os.remove(f) +} diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init index ee127a5..03a4590 100644 --- a/recipes-bsp/multitech/mts-io/mts-io.init +++ b/recipes-bsp/multitech/mts-io/mts-io.init @@ -19,6 +19,31 @@ else LOGDBG=":" fi +hw="" +hw_name="" +MTAC_MODULES="" +((HASAP=0)) + +sethwtype() { + # mts-io must be loaded before trying this + hw=$(${SYSFS} show hw-version) + hw_name=(${hw//-/ }) + + # Only MTCDT and MTCDTIP have accessory cards, and + # MTCDTIPHP does not have accessory cards. + ((HASAP==0)) + case $hw_name in + MTCDTIPHP) + ;; + MTCDT|MTCDTIP) + ((HASAP = 1)) + ;; + *) + ;; + esac + MTAC_MODULES=$(cd /lib/modules/$(uname -r)/extra/;ls mtac_* 2>/dev/null) +} + SYSFS="/usr/sbin/mts-io-sysfs" LRST="/usr/sbin/mts-util-lora2-reset" @@ -183,10 +208,8 @@ mfser_init() { } set_gpslink() { - hw=$(${SYSFS} show hw-version) - hw_name=(${hw//-/ }) gpscap=$(cat ${sysdir}/capability/gps) - + if ((gpscap == 0)) ; then return fi @@ -220,6 +243,17 @@ case $1 in if ! modprobe mts_io ; then ((fail++)) fi + + sethwtype + + if ((HASAP == 1)) ; then + # install mtac explicitly or any unused modules will cause + # junk to the log as mtac is loaded and unloaded each time. + modprobe mtac + for f in ${MTAC_MODULES} ; do + modprobe ${f//.ko} 2>&1 | grep -v 'No such device or address' + done + fi set_gpslink # Set GPS symlink. /usr/bin/logger -t "mts-io" -p daemon.info -s "Resetting system modules" read_card_info @@ -252,8 +286,21 @@ case $1 in ;; stop) - /usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mts-io module" - modprobe -r mts_io + /usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mtac modules and mts-io module" + MTAC_MODULES=$(lsmod | grep '^mtac_' | sed -e 's/_/-/' -e 's/ .*//') + + for f in ${MTAC_MODULES} ; do + if ! modprobe -r "$f" ; then + rmmod "$f" + fi + done + if ! modprobe -r mtac ; then + rmmod mtac + fi + + if ! modprobe -r mts-io ; then + rmmod mtsio + fi RETVAL=$? if ((RETVAL == 0)) ; then echo "OK" diff --git a/recipes-bsp/multitech/mts-io_2.2.1.bb b/recipes-bsp/multitech/mts-io_3.0.2.bb index 92937cd..92937cd 100644 --- a/recipes-bsp/multitech/mts-io_2.2.1.bb +++ b/recipes-bsp/multitech/mts-io_3.0.2.bb |