Where is kernel commit + repo used in builds defined?

Hello all,

Where in the OpenWrt Buildroot source is the git URL and exact commit used when checking out the kernel? I'm working with the ipq40xx-based Habanero board and I'm trying to build the kernel independently. Building a basic image and running it on the device shows that the kernel version is 5.15.110, but when I've tried checking that out manually and applying the patches found in target/linux/ipq40xx, some of them fail to apply correctly.

I figure that if I can checkout the kernel using the exact commit and git repo used by OpenWrt buildroot, I'll be able to get the patches to apply.

The kernel version isn't referenced by git, but downloaded as full tarball from kernel.org (and checked via its sha256 checksum), see e.g. https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=include/kernel-5.15, but on top of that multiple layers of patchsets are applied (the ipq40xx target patches come at the end of this, way after e.g. https://git.openwrt.org/?p=openwrt/openwrt.git;a=tree;f=target/linux/generic - but there are other approaches (such as full source files being dropped in-) as well). Use the buildsystem to do your bidding/ patching, everything else is bound to fail.

Thanks for the pointer. I'm trying to use Yocto to build an image for the Habanero board, and so I'm trying to port the kernel and other board support files from OpenWrt, hence why I'm looking into this.