diff options
author | John Klug <john.klug@multitech.com> | 2018-10-15 18:52:09 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2018-10-15 18:52:09 -0500 |
commit | 93302bee4658d43747e953f3b77829f26fa85e61 (patch) | |
tree | aebbf458f4f41c548345d6168fa2b72e586ef68f /recipes-bsp/multitech/mts-io.inc | |
parent | 3212a35810c656e1db1350522f3f1277b1b88d06 (diff) | |
download | meta-multitech-93302bee4658d43747e953f3b77829f26fa85e61.tar.gz meta-multitech-93302bee4658d43747e953f3b77829f26fa85e61.tar.bz2 meta-multitech-93302bee4658d43747e953f3b77829f26fa85e61.zip |
Split mts-io driver module into separate modules.
Diffstat (limited to 'recipes-bsp/multitech/mts-io.inc')
-rw-r--r-- | recipes-bsp/multitech/mts-io.inc | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index 75544ad..93ae253 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -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) +} |