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" |
| 3 | LICENSE = "GPLv2" |
| 4 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" |
| 8 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | INC_PR = "r4" |
| 10 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 11 | # Skip processing of this recipe if it is not explicitly specified as the |
| 12 | # PREFERRED_PROVIDER for virtual/kernel. This avoids network access required |
| 13 | # by the use of AUTOREV SRCREVs, which are the default for this recipe. |
| 14 | python () { |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | 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] | 16 | d.delVar("BB_DONT_CACHE") |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | 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] | 18 | } |
| 19 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | DEPENDS += "xz-native bc-native" |
| 21 | DEPENDS_append_aarch64 = " libgcc" |
| 22 | KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" |
| 23 | KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" |
| 24 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 25 | DEPENDS_append_nios2 = " libgcc" |
| 26 | KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}" |
| 27 | KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}" |
| 28 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 29 | DEPENDS_append_arc = " libgcc" |
| 30 | KERNEL_CC_append_arc = " ${TOOLCHAIN_OPTIONS}" |
| 31 | KERNEL_LD_append_arc = " ${TOOLCHAIN_OPTIONS}" |
| 32 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc" |
| 34 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}" |
| 36 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | # A KMACHINE is the mapping of a yocto $MACHINE to what is built |
| 38 | # by the kernel. This is typically the branch that should be built, |
| 39 | # and it can be specific to the machine or shared |
| 40 | # KMACHINE = "UNDEFINED" |
| 41 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | # The distro or local.conf should set this, but if nobody cares... |
| 43 | LINUX_KERNEL_TYPE ??= "standard" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | |
| 45 | # KMETA ?= "" |
| 46 | KBRANCH ?= "master" |
| 47 | KMACHINE ?= "${MACHINE}" |
| 48 | SRCREV_FORMAT ?= "meta_machine" |
| 49 | |
| 50 | # LEVELS: |
| 51 | # 0: no reporting |
| 52 | # 1: report options that are specified, but not in the final config |
| 53 | # 2: report options that are not hardware related, but set by a BSP |
| 54 | KCONF_AUDIT_LEVEL ?= "1" |
| 55 | KCONF_BSP_AUDIT_LEVEL ?= "0" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 56 | KMETA_AUDIT ?= "yes" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 58 | LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | |
| 60 | # Pick up shared functions |
| 61 | inherit kernel |
| 62 | inherit kernel-yocto |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | |
| 64 | B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build" |
| 65 | |
| 66 | do_install_append(){ |
| 67 | if [ -n "${KMETA}" ]; then |
| 68 | rm -rf ${STAGING_KERNEL_DIR}/${KMETA} |
| 69 | fi |
| 70 | } |
| 71 | |
| 72 | # extra tasks |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 73 | addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | addtask validate_branches before do_patch after do_kernel_checkout |
| 75 | addtask kernel_configcheck after do_configure before do_compile |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 76 | |
| 77 | # enable kernel-sample for oeqa/runtime/cases's ksample.py test |
| 78 | KERNEL_FEATURES_append_qemuall=" features/kernel-sample/kernel-sample.scc" |