blob: 8be26c4f5e79708088c2dca7cff07a630c274b9f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit kernel-arch
2
3# This is instead of DEPENDS = "virtual/kernel"
4do_configure[depends] += "virtual/kernel:do_shared_workdir"
5
6export OS = "${TARGET_OS}"
7export CROSS_COMPILE = "${TARGET_PREFIX}"
8
9# This points to the build artefacts from the main kernel build
10# such as .config and System.map
11# Confusingly it is not the module build output (which is ${B}) but
12# we didn't pick the name.
13export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}"
14
15export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
16KERNEL_OBJECT_SUFFIX = ".ko"
17
18# kernel modules are generally machine specific
19PACKAGE_ARCH = "${MACHINE_ARCH}"
20
21# Function to ensure the kernel scripts are created. Expected to
22# be called before do_compile. See module.bbclass for an exmaple.
23do_make_scripts() {
24 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
25 make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
26 -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts
27}