1SUMMARY = "Linux kernel" 2SECTION = "kernel" 3LICENSE = "GPL-2.0-only" 4HOMEPAGE = "https://www.yoctoproject.org/" 5 6LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 7 8UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" 9 10RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process" 11 12# Skip processing of this recipe if it is not explicitly specified as the 13# PREFERRED_PROVIDER for virtual/kernel. This avoids network access required 14# by the use of AUTOREV SRCREVs, which are the default for this recipe. 15python () { 16 if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"): 17 d.delVar("BB_DONT_CACHE") 18 raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN"))) 19} 20 21DEPENDS += "xz-native bc-native" 22DEPENDS:append:aarch64 = " libgcc" 23KERNEL_CC:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" 24KERNEL_LD:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" 25 26DEPENDS:append:nios2 = " libgcc" 27KERNEL_CC:append:nios2 = " ${TOOLCHAIN_OPTIONS}" 28KERNEL_LD:append:nios2 = " ${TOOLCHAIN_OPTIONS}" 29 30DEPENDS:append:arc = " libgcc" 31KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}" 32KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}" 33 34KERNEL_FEATURES:append:qemuall=" features/debug/printk.scc" 35 36KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}" 37KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}" 38 39# A KMACHINE is the mapping of a yocto $MACHINE to what is built 40# by the kernel. This is typically the branch that should be built, 41# and it can be specific to the machine or shared 42# KMACHINE = "UNDEFINED" 43 44LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}" 45 46# Pick up shared functions 47inherit kernel 48inherit kernel-yocto 49 50B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build" 51 52do_install:append(){ 53 if [ -n "${KMETA}" ]; then 54 rm -rf ${STAGING_KERNEL_DIR}/${KMETA} 55 fi 56} 57 58# enable kernel-sample for oeqa/runtime/cases's ksample.py test 59KERNEL_FEATURES:append:qemuall=" features/kernel-sample/kernel-sample.scc" 60 61KERNEL_DEBUG_OPTIONS ?= "stack" 62KERNEL_EXTRA_ARGS:append:x86-64 = " ${@bb.utils.contains('KERNEL_DEBUG_OPTIONS', 'stack', 'HOST_LIBELF_LIBS="-L${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig/../../../usr/lib/ -lelf"', '', d)}" 63 64do_devshell:prepend() { 65 # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native) 66 d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig") 67 d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig") 68 d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}") 69 d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1") 70 d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR") 71} 72