blob: 934591ff1c8444aa5452f9a91e5d6ff325a4e2a4 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Linux kernel"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002SECTION = "kernel"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00003LICENSE = "GPL-2.0-only"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06004HOMEPAGE = "https://www.yoctoproject.org/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
9
Andrew Geissler5a43b432020-06-13 10:46:56 -050010RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process"
11
Patrick Williamsc0f7c042017-02-23 20:41:17 -060012# 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 () {
Brad Bishop316dfdd2018-06-25 12:45:53 -040016 if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"):
Patrick Williamsc0f7c042017-02-23 20:41:17 -060017 d.delVar("BB_DONT_CACHE")
Brad Bishop316dfdd2018-06-25 12:45:53 -040018 raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN")))
Patrick Williamsc0f7c042017-02-23 20:41:17 -060019}
20
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021DEPENDS += "xz-native bc-native"
Patrick Williams213cb262021-08-07 19:21:33 -050022DEPENDS:append:aarch64 = " libgcc"
23KERNEL_CC:append:aarch64 = " ${TOOLCHAIN_OPTIONS}"
24KERNEL_LD:append:aarch64 = " ${TOOLCHAIN_OPTIONS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025
Patrick Williams213cb262021-08-07 19:21:33 -050026DEPENDS:append:nios2 = " libgcc"
27KERNEL_CC:append:nios2 = " ${TOOLCHAIN_OPTIONS}"
28KERNEL_LD:append:nios2 = " ${TOOLCHAIN_OPTIONS}"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050029
Patrick Williams213cb262021-08-07 19:21:33 -050030DEPENDS:append:arc = " libgcc"
31KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}"
32KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}"
Brad Bishop19323692019-04-05 15:28:33 -040033
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060034KERNEL_FEATURES:append:qemuall=" features/debug/printk.scc features/taskstats/taskstats.scc"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060035
Patrick Williams2390b1b2022-11-03 13:47:49 -050036KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/efi.scc', '', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -050037KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
38KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040# A KMACHINE is the mapping of a yocto $MACHINE to what is built
41# by the kernel. This is typically the branch that should be built,
42# and it can be specific to the machine or shared
43# KMACHINE = "UNDEFINED"
44
Brad Bishopd7bf8c12018-02-25 22:55:05 -050045LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
47# Pick up shared functions
48inherit kernel
49inherit kernel-yocto
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
51B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
52
Patrick Williams213cb262021-08-07 19:21:33 -050053do_install:append(){
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 if [ -n "${KMETA}" ]; then
55 rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
56 fi
57}
58
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059# enable kernel-sample for oeqa/runtime/cases's ksample.py test
Patrick Williams213cb262021-08-07 19:21:33 -050060KERNEL_FEATURES:append:qemuall=" features/kernel-sample/kernel-sample.scc"
Andrew Geissler595f6302022-01-24 19:11:47 +000061
62KERNEL_DEBUG_OPTIONS ?= "stack"
Patrick Williams92b42cb2022-09-03 06:53:57 -050063KERNEL_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)}"
Andrew Geissler595f6302022-01-24 19:11:47 +000064
65do_devshell:prepend() {
66 # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
67 d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
68 d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
69 d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
70 d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
71 d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
72}