Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | inherit module-base kernel-module-split |
| 2 | |
| 3 | addtask make_scripts after do_patch before do_compile |
| 4 | do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock" |
| 5 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" |
| 6 | |
| 7 | EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}" |
| 8 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 9 | MODULES_INSTALL_TARGET ?= "modules_install" |
| 10 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 11 | python __anonymous () { |
| 12 | depends = d.getVar('DEPENDS', True) |
| 13 | extra_symbols = [] |
| 14 | for dep in depends.split(): |
| 15 | if dep.startswith("kernel-module-"): |
| 16 | extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers") |
| 17 | d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols)) |
| 18 | } |
| 19 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | module_do_compile() { |
| 21 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS |
| 22 | oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ |
| 23 | KERNEL_VERSION=${KERNEL_VERSION} \ |
| 24 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ |
| 25 | AR="${KERNEL_AR}" \ |
| 26 | O=${STAGING_KERNEL_BUILDDIR} \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | ${MAKE_TARGETS} |
| 29 | } |
| 30 | |
| 31 | module_do_install() { |
| 32 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS |
| 33 | oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \ |
| 34 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ |
| 35 | O=${STAGING_KERNEL_BUILDDIR} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 36 | ${MODULES_INSTALL_TARGET} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 37 | |
| 38 | install -d -m0755 ${D}${includedir}/${BPN} |
| 39 | cp -a --no-preserve=ownership ${B}/Module.symvers ${D}${includedir}/${BPN} |
| 40 | # it doesn't actually seem to matter which path is specified here |
| 41 | sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | EXPORT_FUNCTIONS do_compile do_install |
| 45 | |
| 46 | # add all splitted modules to PN RDEPENDS, PN can be empty now |
| 47 | KERNEL_MODULES_META_PACKAGE = "${PN}" |
| 48 | FILES_${PN} = "" |
| 49 | ALLOW_EMPTY_${PN} = "1" |