Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | SUMMARY = "Linux kernel" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | SECTION = "kernel" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 3 | LICENSE = "GPL-2.0-only" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 4 | HOMEPAGE = "https://www.yoctoproject.org/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 6 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" |
| 9 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 10 | RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process" |
| 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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. |
| 15 | python () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 16 | if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"): |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 17 | d.delVar("BB_DONT_CACHE") |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN"))) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | } |
| 20 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | DEPENDS += "xz-native bc-native" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 22 | DEPENDS:append:aarch64 = " libgcc" |
| 23 | KERNEL_CC:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" |
| 24 | KERNEL_LD:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | DEPENDS:append:nios2 = " libgcc" |
| 27 | KERNEL_CC:append:nios2 = " ${TOOLCHAIN_OPTIONS}" |
| 28 | KERNEL_LD:append:nios2 = " ${TOOLCHAIN_OPTIONS}" |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 29 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 30 | DEPENDS:append:arc = " libgcc" |
| 31 | KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}" |
| 32 | KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 34 | KERNEL_FEATURES:append:qemuall=" features/debug/printk.scc features/taskstats/taskstats.scc" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 35 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 36 | KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/efi.scc', '', d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}" |
| 38 | KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | # 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 45 | LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | |
| 47 | # Pick up shared functions |
| 48 | inherit kernel |
| 49 | inherit kernel-yocto |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | |
| 51 | B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build" |
| 52 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 53 | do_install:append(){ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | if [ -n "${KMETA}" ]; then |
| 55 | rm -rf ${STAGING_KERNEL_DIR}/${KMETA} |
| 56 | fi |
| 57 | } |
| 58 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 59 | # enable kernel-sample for oeqa/runtime/cases's ksample.py test |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | KERNEL_FEATURES:append:qemuall=" features/kernel-sample/kernel-sample.scc" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 61 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 62 | KERNEL_DEBUG ?= "" |
| 63 | # These used to be version specific, but are now common dependencies. New |
| 64 | # tools / dependencies will continue to be added in version specific recipes. |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 65 | DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}' |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 66 | DEPENDS += "openssl-native util-linux-native" |
| 67 | DEPENDS += "gmp-native libmpc-native" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 68 | |
| 69 | # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme |
| 70 | do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}' |
| 71 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 72 | EXTRA_OEMAKE += '${@bb.utils.contains("KERNEL_DEBUG", "True", "", "PAHOLE=false", d)}' |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 73 | |
| 74 | do_devshell:prepend() { |
| 75 | # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native) |
| 76 | d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig") |
| 77 | d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig") |
| 78 | d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}") |
| 79 | d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1") |
| 80 | d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR") |
| 81 | } |