From 93e392f8e6cd94a5dbea07525c189d4655bc7a21 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 9 Oct 2023 12:11:27 -0300 Subject: linux-toradex-mainline: split out common code into a inc file This makes the non-rt and rt recipe more independent and prepares for further refactoring. Related-to: ELB-5359 Signed-off-by: Max Krummenacher --- .../linux/linux-toradex-mainline-common.inc | 45 ++++++++++++++++++++ .../linux/linux-toradex-mainline-rt_git.bb | 21 ++++++---- recipes-kernel/linux/linux-toradex-mainline_git.bb | 48 ++-------------------- 3 files changed, 62 insertions(+), 52 deletions(-) create mode 100644 recipes-kernel/linux/linux-toradex-mainline-common.inc diff --git a/recipes-kernel/linux/linux-toradex-mainline-common.inc b/recipes-kernel/linux/linux-toradex-mainline-common.inc new file mode 100644 index 0000000..572c733 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline-common.inc @@ -0,0 +1,45 @@ +SUMMARY = "Toradex mainline Linux kernel" +SECTION = "kernel" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + +FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex-mainline-git:" + +DEPENDS += "coreutils-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}" + +SRC_URI = " \ + ${LINUX_REPO};protocol=https;branch=${KBRANCH};name=machine \ + file://defconfig \ + ${TDX_PATCHES} \ +" + +KERNEL_VERSION_SANITY_SKIP = "1" + +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-deploy-config toradex-kernel-localversion + +# Additional file deployed by recent mainline kernels +FILES:${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" + +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" diff --git a/recipes-kernel/linux/linux-toradex-mainline-rt_git.bb b/recipes-kernel/linux/linux-toradex-mainline-rt_git.bb index 09df83e..df41c28 100644 --- a/recipes-kernel/linux/linux-toradex-mainline-rt_git.bb +++ b/recipes-kernel/linux/linux-toradex-mainline-rt_git.bb @@ -1,17 +1,24 @@ -LINUX_VERSION ?= "6.5-rc" -require recipes-kernel/linux/linux-toradex-mainline_git.bb -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-git:" +require linux-toradex-mainline-common.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex-mainline-rt-git:" SUMMARY = "Toradex mainline real-time Linux kernel" # To build the RT kernel we use the RT kernel git repo rather than applying # the RT patch on top of a vanilla kernel. LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git" -KBRANCH = "linux-6.5.y-rt" -SRCREV_machine = "16ae0de52ef9f7e5c2cd7e8443f5195c176353ea" -SRCREV_machine:use-head-next = "${AUTOREV}" - +TDX_PATCHES = " \ + file://0001-thermal-imx-Update-critical-temp-threshold.patch \ + file://0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \ + file://0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch \ + file://0004-media-i2c-ov5640-Implement-get_mbus_config.patch \ +" SRC_URI:append = " \ file://preempt-rt.scc \ file://preempt-rt-less-latency.scc \ " + +LINUX_VERSION ?= "6.5-rc" +KBRANCH = "linux-6.5.y-rt" +SRCREV_machine = "16ae0de52ef9f7e5c2cd7e8443f5195c176353ea" +SRCREV_machine:use-head-next = "${AUTOREV}" diff --git a/recipes-kernel/linux/linux-toradex-mainline_git.bb b/recipes-kernel/linux/linux-toradex-mainline_git.bb index 6539013..b702e5e 100644 --- a/recipes-kernel/linux/linux-toradex-mainline_git.bb +++ b/recipes-kernel/linux/linux-toradex-mainline_git.bb @@ -1,31 +1,7 @@ -SUMMARY = "Toradex mainline Linux kernel" -SECTION = "kernel" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" +require linux-toradex-mainline-common.inc -FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex-mainline-git:" - -DEPENDS += "coreutils-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 \ -" - -SRC_URI:append = " \ +LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" +TDX_PATCHES = " \ file://0001-thermal-imx-Update-critical-temp-threshold.patch \ file://0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \ file://0003-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch \ @@ -34,23 +10,5 @@ SRC_URI:append = " \ LINUX_VERSION ?= "6.6-rc" KBRANCH = "master" -KERNEL_VERSION_SANITY_SKIP = "1" SRCREV_machine = "2dde18cd1d8fac735875f2e4987f11817cc0bc2c" 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-deploy-config toradex-kernel-localversion - -# Additional file deployed by recent mainline kernels -FILES:${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" - -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" -- cgit v1.2.3