Skip to content

Commit ff2b06a

Browse files
Add a recipe to compile qcom staging kernel. (#784)
This PR is submitted based on the discussions that happened in [PR745](#745) and sync-ups with @ndechesne and @ricardosalveti about the need for a recipe to build a staging kernel tree with additional patches, especially for boards based on QCS9100 & QCS6490. For the early enablement of other Qcom technologies such as Multimedia and Connectivity on these boards, we need this staging kernel to be built. This staging kernel tree includes additional patches on top of the 6.12 kernel, many of which are in the process of being upstreamed. Starting with 6.12, this tree will continue to catch up with the latest releases (6.13, 6.14, etc.), with patches being dropped and rebased in the process. Eventually, all patches from this staging kernel will be available in the mainline kernel. This patch series brings a recipe for the staging kernel and a CI yml file to build linux-qcom-staging. The machine configuration files are untouched and continue to build the linux-yocto-dev kernel. To build the staging kernel, run the kas command as below: `kas build meta-qcom/ci/qcs6490-rb3gen2-core-kit.yml:meta-qcom/ci/staging-kernel-provider.yml` I’ll further work with @ndechesne, @koenkooi, and @ricardosalveti to enable this staging kernel in GitHub CI to avoid regressions.
2 parents 3da7640 + 4a1c210 commit ff2b06a

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

ci/staging-kernel-provider.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
header:
2+
version: 14
3+
4+
local_conf_header:
5+
kernelprovider: |
6+
PREFERRED_PROVIDER_virtual/kernel = "linux-qcom-staging"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
SECTION = "kernel"
2+
3+
DESCRIPTION = "Linux ${PV} staging kernel for QCOM devices"
4+
LICENSE = "GPL-2.0-only"
5+
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
6+
7+
inherit kernel
8+
9+
COMPATIBLE_MACHINE = "(qcom)"
10+
11+
LINUX_QCOM_GIT ?= "git://git.codelinaro.org/clo/la/kernel/qcom.git;protocol=https"
12+
SRCBRANCH ?= "qclinux.6.12.y"
13+
SRC_URI = "${LINUX_QCOM_GIT};branch=${SRCBRANCH}"
14+
15+
# To build bleeding edge qcom staging kernel set preferred
16+
# provider of virtual/kernel to 'linux-qcom-staging-tip'
17+
BBCLASSEXTEND = "devupstream:target"
18+
PN:class-devupstream = "linux-qcom-staging-tip"
19+
SRCREV:class-devupstream = "${AUTOREV}"
20+
21+
SRCREV = "10325dc2277dc03687683b9f5f57a472b37de0b4"
22+
PV = "6.12+git"
23+
24+
S = "${WORKDIR}/git"
25+
26+
KERNEL_CONFIG ?= "qcom_defconfig"
27+
28+
# Additional fragment for qcom value add features
29+
KERNEL_CONFIG_FRAGMENTS += " ${S}/arch/arm64/configs/qcom_addons.config"
30+
31+
do_configure:prepend() {
32+
if [ ! -f "${S}/arch/${ARCH}/configs/${KERNEL_CONFIG}" ]; then
33+
bbfatal "KERNEL_CONFIG '${KERNEL_CONFIG}' was specified, but not present in the source tree"
34+
else
35+
cp '${S}/arch/${ARCH}/configs/${KERNEL_CONFIG}' '${B}/.config'
36+
fi
37+
38+
# Check for kernel config fragments. The assumption is that the config
39+
# fragment will be specified with the absolute path. For example:
40+
# * ${WORKDIR}/config1.cfg
41+
# * ${S}/config2.cfg
42+
# Iterate through the list of configs and make sure that you can find
43+
# each one. If not then error out.
44+
# NOTE: If you want to override a configuration that is kept in the kernel
45+
# with one from the OE meta data then you should make sure that the
46+
# OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed
47+
# after the in kernel configuration fragment.
48+
# Check if any config fragments are specified.
49+
if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ]
50+
then
51+
for f in ${KERNEL_CONFIG_FRAGMENTS}
52+
do
53+
# Check if the config fragment was copied into the WORKDIR from
54+
# the OE meta data
55+
if [ ! -e "$f" ]
56+
then
57+
echo "Could not find kernel config fragment $f"
58+
exit 1
59+
fi
60+
done
61+
62+
# Now that all the fragments are located merge them.
63+
( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 )
64+
fi
65+
}

0 commit comments

Comments
 (0)