linux-yocto.inc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. SUMMARY = "Linux kernel"
  2. SECTION = "kernel"
  3. LICENSE = "GPL-2.0-with-Linux-syscall-note"
  4. HOMEPAGE = "https://www.yoctoproject.org/"
  5. LIC_FILES_CHKSUM ?= "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
  6. UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
  7. RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process"
  8. # Skip processing of this recipe if it is not explicitly specified as the
  9. # PREFERRED_PROVIDER for virtual/kernel. This avoids network access required
  10. # by the use of AUTOREV SRCREVs, which are the default for this recipe.
  11. python () {
  12. if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"):
  13. d.delVar("BB_DONT_CACHE")
  14. raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN")))
  15. }
  16. DEPENDS += "xz-native bc-native"
  17. DEPENDS:append:aarch64 = " libgcc"
  18. KERNEL_CC:append:aarch64 = " ${TOOLCHAIN_OPTIONS}"
  19. KERNEL_LD:append:aarch64 = " ${TOOLCHAIN_OPTIONS}"
  20. DEPENDS:append:nios2 = " libgcc"
  21. KERNEL_CC:append:nios2 = " ${TOOLCHAIN_OPTIONS}"
  22. KERNEL_LD:append:nios2 = " ${TOOLCHAIN_OPTIONS}"
  23. DEPENDS:append:arc = " libgcc"
  24. KERNEL_CC:append:arc = " ${TOOLCHAIN_OPTIONS}"
  25. KERNEL_LD:append:arc = " ${TOOLCHAIN_OPTIONS}"
  26. KERNEL_FEATURES:append:qemuall = " features/debug/printk.scc features/taskstats/taskstats.scc"
  27. KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/efi.scc', '', d)}"
  28. KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
  29. KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
  30. # A KMACHINE is the mapping of a yocto $MACHINE to what is built
  31. # by the kernel. This is typically the branch that should be built,
  32. # and it can be specific to the machine or shared
  33. # KMACHINE = "UNDEFINED"
  34. LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}"
  35. # Pick up shared functions
  36. inherit kernel
  37. inherit kernel-yocto
  38. B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
  39. do_install:append(){
  40. if [ -n "${KMETA}" ]; then
  41. rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
  42. fi
  43. }
  44. # enable kernel-sample for oeqa/runtime/cases's ksample.py test
  45. KERNEL_FEATURES:append:qemuall = " features/kernel-sample/kernel-sample.scc"
  46. KERNEL_DEBUG ?= ""
  47. # These used to be version specific, but are now common dependencies. New
  48. # tools / dependencies will continue to be added in version specific recipes.
  49. DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
  50. DEPENDS += "openssl-native util-linux-native"
  51. DEPENDS += "gmp-native libmpc-native"
  52. # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
  53. do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
  54. EXTRA_OEMAKE += '${@bb.utils.contains("KERNEL_DEBUG", "True", "", "PAHOLE=false", d)}'
  55. do_devshell:prepend() {
  56. # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native)
  57. d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig")
  58. d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig")
  59. d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}")
  60. d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1")
  61. d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR")
  62. }