Kernel modification in Yocto environment

Hi guys

I would like to know your idea on how to do kernel programming in Yocto build.
Well, anyway, just rushing with kernel module programming in separate directory will not hurt the source/binary integrity maintained by Yocto build toolset and none of “xxxxx layers/meta-toradex-nxp/recipes-kernel/linux/ is tainted from a forced run” message will come out. Then, how I can modify the source code of linux kernel ? That’s the steps I tried just to keep as much silent as possible I can try.

-# bitbake virtual/kernel -c devshell ← kernel sources will gather to deploy/apalis-imx8qm/kernel-source

-# mkdir deploy/apalis-imx8qm/kernel-build

-# cd deploy/apalis-imx8qm/kernel-build

< modify sources in…/kernel-sources >

-# cp …/kernel-sources/.meta/cfg/.config .config

-# make -f …/kernel-souces/Makefile O=pwd ARCH=arm64 menuconfig ← kernel configuration I want

-# make -f …/kernel-souces/Makefile O=pwd ARCH=arm64 Image modules
<— I can just use arch/arm64/boot/Image and modules

However, after this , when I tried to again image full build by using bitbake

-# bitbake tdx-reference-multimedia-image

<— Still " layers/meta-toradex-nxp/recipes-kernel/linux/ is tainted from a forced run" message comes out again.

[1] How bitbake knows that I tried to compile/build kernel source with a path other than bitbake? [2] Do I have to always use bitbake just to test kernel without full image build?

Can I take a quicker path to generate kernel image just in keeping silent to bitbake ?

Thanks in advance.

Hi @toddhwang, I think the following links should give you a good overview of the options.