Skip to main content
The Qualcomm® Linux RT kernel is built using the same Yocto toolchain as the standard kernel. The meta-qcom layer provides a dedicated Bitbake recipe that fetches the LTS RT kernel sources, applies the PREEMPT_RT patch set, and enables the required Kconfig options automatically.

Choose the correct RT recipe

Two RT recipes are available depending on the target branch:
RecipeKernel trackUse when
linux-qcom-rt_6.18.bbLTS 6.18.xBuilding for a QLI release (stable, production-ready)
linux-qcom-next-rt_git.bbqcom-nextBuilding from the latest development tree
Both recipes are in meta-qcom/recipes-kernel/linux/. The LTS recipe is used for all examples on this page.

Build the RT kernel image

1. Sync the workspace

Clone meta-qcom at a release tag and sync all Qualcomm Linux meta layers before building. For workspace setup instructions, see Build the kernel with Yocto.

2. Open the kas shell for the RT kernel

kas shell meta-qcom/ci/qcs6490-rb3gen2-core-kit.yml:meta-qcom/ci/linux-qcom-rt-6.18.yml:meta-qcom/ci/qcom-distro-kvm.yml
Replace qcs6490-rb3gen2-core-kit.yml with the kas machine file for your target board.

3. Build the image

bitbake qcom-multimedia-image
Build output is in:
build/tmp/deploy/images/<Machine>/<Image>-*.rootfs.qcomflash/

4. Flash to the device

cd build/tmp/deploy/images/<Machine>/<Image>-*.rootfs.qcomflash/
fastboot flash efi efi.bin
fastboot flash dtb_a dtb.bin
fastboot reboot

Customise the RT kernel

Add a patch

  1. Place the patch file in recipes-kernel/linux/linux-qcom-6.18/:
    meta-qcom/recipes-kernel/linux/linux-qcom-6.18/your_patch.patch
    
  2. Append it to SRC_URI in linux-qcom-rt_6.18.bb:
    SRC_URI += " \
        file://your_patch.patch \
    "
    

Add a Kconfig configuration fragment

  1. Create a .cfg file with the required CONFIG_* symbols:
    meta-qcom/recipes-kernel/linux/linux-qcom-6.18/configs/qcom_rt_custom.cfg
    
    Example contents:
    CONFIG_CPU_ISOLATION=y
    CONFIG_HZ_1000=y
    # CONFIG_TRANSPARENT_HUGEPAGE is not set
    
  2. Append it to SRC_URI in linux-qcom-rt_6.18.bb:
    SRC_URI += " \
        file://configs/qcom_rt_custom.cfg \
    "
    

Modify the kernel command line

Add or override command-line parameters in meta-qcom/ci/base.yml using the KERNEL_CMDLINE_EXTRA variable:
KERNEL_CMDLINE_EXTRA:append: " isolcpus=7 nohz_full=7 rcu_nocbs=7"
For platform-specific command-line tuning variables, set them in meta-qcom/conf/machine/<machine-name>.conf:
QCOM_RT_CPU        = "7"
QCOM_IRQAFF        = "0-6"
QCOM_RCU_NOCBS     = "7"
QCOM_RCU_EXPEDITED = "1"
QCOM_CPUIDLE_OFF   = "1"
These variables configure the RT core isolation, IRQ affinity, and RCU callback exclusion on the platform kernel command line.

Verify the RT kernel is installed

After flashing and rebooting, confirm the RT kernel is active:
uname -r
# Expected: a version string with the -rt suffix, e.g. 6.18.0-rt1+

zcat /proc/config.gz | grep CONFIG_PREEMPT_RT
# Expected: CONFIG_PREEMPT_RT=y
For latency validation after installation, see RT validation and known limitations.