diff options
Diffstat (limited to 'meta/recipes-kernel/linux/linux-yocto.inc')
-rw-r--r-- | meta/recipes-kernel/linux/linux-yocto.inc | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc index a85280990b..4d0a726bb6 100644 --- a/meta/recipes-kernel/linux/linux-yocto.inc +++ b/meta/recipes-kernel/linux/linux-yocto.inc | |||
@@ -1,6 +1,6 @@ | |||
1 | SUMMARY = "Linux kernel" | 1 | SUMMARY = "Linux kernel" |
2 | SECTION = "kernel" | 2 | SECTION = "kernel" |
3 | LICENSE = "GPLv2" | 3 | LICENSE = "GPL-2.0-with-Linux-syscall-note" |
4 | HOMEPAGE = "https://www.yoctoproject.org/" | 4 | HOMEPAGE = "https://www.yoctoproject.org/" |
5 | 5 | ||
6 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" | 6 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
@@ -19,21 +19,39 @@ python () { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | DEPENDS += "xz-native bc-native" | 21 | DEPENDS += "xz-native bc-native" |
22 | DEPENDS_append_aarch64 = " libgcc" | 22 | DEPENDS:append:aarch64 = " libgcc" |
23 | KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" | 23 | KERNEL_CC:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" |
24 | KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" | 24 | KERNEL_LD:append:aarch64 = " ${TOOLCHAIN_OPTIONS}" |
25 | 25 | ||
26 | DEPENDS_append_nios2 = " libgcc" | 26 | DEPENDS:append:nios2 = " libgcc" |
27 | KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}" | 27 | KERNEL_CC:append:nios2 = " ${TOOLCHAIN_OPTIONS}" |
28 | KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}" | 28 | KERNEL_LD:append:nios2 = " ${TOOLCHAIN_OPTIONS}" |
29 | 29 | ||
30 | DEPENDS_append_arc = " libgcc" | 30 | DEPENDS:append:arc = " libgcc" |
31 | KERNEL_CC_append_arc = " ${TOOLCHAIN_OPTIONS}" | 31 | KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}" |
32 | KERNEL_LD_append_arc = " ${TOOLCHAIN_OPTIONS}" | 32 | KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}" |
33 | 33 | ||
34 | KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc" | 34 | KERNEL_FEATURES:append:qemuall = " features/debug/printk.scc features/taskstats/taskstats.scc" |
35 | 35 | ||
36 | KERNEL_FEATURES_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}" | 36 | KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/efi.scc', '', d)}" |
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)}" | ||
39 | |||
40 | KERNEL_FEATURES_RISCV = "\ | ||
41 | arch/riscv/tunes/riscv-isa-clear.scc \ | ||
42 | ${@bb.utils.contains( 'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc', '', d)} \ | ||
43 | ${@bb.utils.contains( 'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc', '', d)} \ | ||
44 | ${@bb.utils.contains( 'TUNE_FEATURES', 'f d', 'arch/riscv/tunes/riscv-isa-fpu.scc', '', d)} \ | ||
45 | ${@bb.utils.contains( 'TUNE_FEATURES', 'c', 'arch/riscv/tunes/riscv-isa-c.scc', '', d)} \ | ||
46 | ${@bb.utils.contains( 'TUNE_FEATURES', 'v', 'arch/riscv/tunes/riscv-isa-v.scc', '', d)} \ | ||
47 | ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba', 'arch/riscv/tunes/riscv-isa-zba.scc', '', d)} \ | ||
48 | ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb', 'arch/riscv/tunes/riscv-isa-zbb.scc', '', d)} \ | ||
49 | ${@bb.utils.contains( 'TUNE_FEATURES', 'zbc', 'arch/riscv/tunes/riscv-isa-zbc.scc', '', d)} \ | ||
50 | ${@bb.utils.contains( 'TUNE_FEATURES', 'zicbom', 'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \ | ||
51 | " | ||
52 | |||
53 | KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}" | ||
54 | KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}" | ||
37 | 55 | ||
38 | # A KMACHINE is the mapping of a yocto $MACHINE to what is built | 56 | # A KMACHINE is the mapping of a yocto $MACHINE to what is built |
39 | # by the kernel. This is typically the branch that should be built, | 57 | # by the kernel. This is typically the branch that should be built, |
@@ -48,11 +66,32 @@ inherit kernel-yocto | |||
48 | 66 | ||
49 | B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build" | 67 | B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build" |
50 | 68 | ||
51 | do_install_append(){ | 69 | do_install:append(){ |
52 | if [ -n "${KMETA}" ]; then | 70 | if [ -n "${KMETA}" ]; then |
53 | rm -rf ${STAGING_KERNEL_DIR}/${KMETA} | 71 | rm -rf ${STAGING_KERNEL_DIR}/${KMETA} |
54 | fi | 72 | fi |
55 | } | 73 | } |
56 | 74 | ||
57 | # enable kernel-sample for oeqa/runtime/cases's ksample.py test | 75 | # enable kernel-sample for oeqa/runtime/cases's ksample.py test |
58 | KERNEL_FEATURES_append_qemuall=" features/kernel-sample/kernel-sample.scc" | 76 | KERNEL_FEATURES:append:qemuall = " features/kernel-sample/kernel-sample.scc" |
77 | |||
78 | KERNEL_DEBUG ?= "" | ||
79 | # These used to be version specific, but are now common dependencies. New | ||
80 | # tools / dependencies will continue to be added in version specific recipes. | ||
81 | DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}' | ||
82 | DEPENDS += "openssl-native util-linux-native" | ||
83 | DEPENDS += "gmp-native libmpc-native" | ||
84 | |||
85 | # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme | ||
86 | do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}' | ||
87 | |||
88 | EXTRA_OEMAKE += '${@bb.utils.contains("KERNEL_DEBUG", "True", "", "PAHOLE=false", d)}' | ||
89 | |||
90 | do_devshell:prepend() { | ||
91 | # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native) | ||
92 | d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig") | ||
93 | d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig") | ||
94 | d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}") | ||
95 | d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1") | ||
96 | d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR") | ||
97 | } | ||