blob: 6fe77c01b7edbeba10664e7a16612a63a6361474 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001inherit kernel-arch
2
3# This is instead of DEPENDS = "virtual/kernel"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05004do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
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
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022# be called before do_compile. See module.bbclass for an example.
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023do_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}