diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2021-10-02 16:29:27 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-12-16 19:20:43 +0100 |
commit | 268c0582b879c8c0e7e57c8a5719524b678ff9f3 (patch) | |
tree | f1f566e9967fe4142e9e1aace800527d07a203a5 /recipes-kernel/linux/linux-toradex-mainline_git.bb | |
parent | d049426c8c76c92716aedec75e008157707c4ac3 (diff) |
linux-toradex-mainline: switch to use kernel.org
Currently this builds kernel 5.16.0-RC5 from kernel.org.
With the override `use-head-next` set, the HEAD of the master branch is
built instead.
For the rt patches a git repository from kernel.org with a maintained
branch which regularly merges in the stable/master git trees is used.
This changes from using defconfigs provided from the kernel sources
to use defconfigs which the recipe provides.
Get the initial defconfig from the kernel sources as of commit
2585cf9dfaad Linux 5.16-rc5.
"imx_v6_v7_defconfig" for i.MX 32 bit SoC
"tegra_defconfig" for TK1
"defconfig" for i.MX 64 bit SoC
Run them through 'make *defconfig; make savedefconfig' first.
Kernel 5.16 introduced that the device tree files are validated if
built in the way OE builds them.
Port the solution to make this from the linux-yocto-dev.bb recipe, commit
c12a91827e88 ("linux-yocto-dev: introduce dt-validation PACKAGECONFIG")
which is cleaner than reverting the commit that introduced the validation.
Related-to: ELB-4094
Related-to: ELB-4095
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-kernel/linux/linux-toradex-mainline_git.bb')
-rw-r--r-- | recipes-kernel/linux/linux-toradex-mainline_git.bb | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-toradex-mainline_git.bb b/recipes-kernel/linux/linux-toradex-mainline_git.bb new file mode 100644 index 0000000..923c2b8 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline_git.bb @@ -0,0 +1,75 @@ +SUMMARY = "Toradex mainline Linux kernel" +SUMMARY:preempt-rt = "Toradex mainline real-Time Linux kernel" +SECTION = "kernel" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-git:" + +DEPENDS += "coreutils-native lzop-native" + +# yaml and dtschema are required for 5.16+ device tree validation, libyaml is checked +# via pkgconfig, so must always be present, but we can wrap the others to make them +# conditional +DEPENDS += "libyaml-native" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native" +# we need the wrappers if validation isn't in the packageconfig +DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git" +SRC_URI = " \ + ${LINUX_REPO};protocol=https;branch=${KBRANCH};name=machine \ + file://defconfig \ +" + +LINUX_VERSION ?= "5.16" +KBRANCH = "master" +KERNEL_VERSION_SANITY_SKIP = "1" +SRCREV_machine = "2585cf9dfaaddf00b069673f27bb3f8530e2039c" +SRCREV_machine:use-head-next = "${AUTOREV}" + +S = "${WORKDIR}/git" + +KCONFIG_MODE="--alldefconfig" + +# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS) +KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}" + +inherit kernel-yocto kernel pkgconfig toradex-kernel-localversion + +# Additional file deployed by recent mainline kernels +FILES:${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" + +KERNEL_CONFIG_NAME ?= "${KERNEL_PACKAGE_NAME}-config-${KERNEL_ARTIFACT_NAME}" +KERNEL_CONFIG_LINK_NAME ?= "${KERNEL_PACKAGE_NAME}-config" + +export DTC_FLAGS = "-@" + +# kconfiglib.KconfigError: init/Kconfig:70: error: couldn't parse 'default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))': macro expanded to blank string +do_kernel_configcheck[noexec] = "1" + +do_deploy:append() { + cp -a ${B}/.config ${DEPLOYDIR}/${KERNEL_CONFIG_NAME} + ln -sf ${KERNEL_CONFIG_NAME} ${DEPLOYDIR}/${KERNEL_CONFIG_LINK_NAME} +} + +####################################################################### + +LINUX_REPO:preempt-rt = "git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git" +LINUX_VERSION:preempt-rt ?= "5.15.3-rt21" +KBRANCH:preempt-rt = "linux-5.15.y-rt" +SRCREV_machine:preempt-rt = "2534ec53a47a4b1ee5985534c24652b5c62abe62" +LINUX_VERSION:use-head-next:preempt-rt ?= "5.16.0-rt" +KBRANCH:use-head-next:preempt-rt = "linux-5.16.y-rt" +SRCREV_machine:preempt-rt:use-head-next = "${AUTOREV}" + +SRC_URI:append:preempt-rt = " \ + file://preempt-rt.scc \ + file://preempt-rt-less-latency.scc \ +" + +####################################################################### |