Any guide to adding a newer kernel to my custom compile?

I have googled and tried every piece of advice I've found. Not having any success.

So is there a guide that shows how I can pull master, and configure it to pull a newer kernel?


If you have to ask, you probably can't.

The kernel is very tightly integrated into OpenWrt, as many of the targets and devices need heaps of non-mainline patches to get them working (and to get the kernel smaller/ using aligned access for mips/ arm, …), so there are multiple layers of different patch series (generic, target, sub-target, backport/ pending/ hack, …) to take care of (to rebase) and corresponding DTS/ setup changes. To cut it short, it's difficult and a manual process, you start with:

  • copying the current patch series verbatim
  • start by rebasing the generic patch layers
    ideally on a platform that doesn't needs any non-mainline patches to work, e.g. x86_64
  • once that part is working, you can start looking into doing the same for your actually preferred target.

don't expect that to be a walk in the park, it isn't.


In addition to the above, check out in the Kernel patch section to see how to use quilt which will let you push/pop the current patchset to the kernel and see what breaks


I try to follow the first principles discipline. So, in the first place, why do you want to use another kernel version? What are you looking for?

Thanks for the info. It's true that I haven't compiled a kernel since the early 4.x's but I have a bit of faith in my abilities :wink:

Thank you Grommish!

There will be newer kernels in the snapshot code base. Building with these would allow you to provide useful feedback to the project.

1 Like

5.15 WIP as an example in progress.

1 Like

I tend to march to my own drum. Yeah I would rather keep it simple and use the stable release but sometimes you just cant and reach your other goals.

Currently I am running a custom compiled 5.10.x based off master because I was trying to get either of my 2.5Gbps usb based adapters working with my APU2D4. I've got a 1.2Gbs cable broadband rate but the APU2D4 only has 1Gbps Ethernet connections natively. The drivers for RTL8156B were not present or working in 21.02.01 nor 21.02.02 (I believe I tested that) so I did a custom build off master. Which I got and still have working, all but the broken banip due to the change in firewall architecture breaking it. The changes for this adapter are present in 19.x that runs on my GL-AR750S-Ext (my failover device when I work on my APU) which was kind of surprising. According to Phronx the driver changes werent supposed to be in till kernel 5.13.x but, whatever, got that working.

So I moved to the next challenge, getting ready for my AIRETOS E63 Evaluation Board an AEX-QCA6391-NX1-EVK to arrive. This board will need ath11k support. So I figured why not be a glutton for punishment and grab the 5.16.15 kernel and fight my way through that as well.

Check out include/kernel-5.10 in master branch on how to setup versioning. You'll need the revision and hash, and KERNEL_TESTING_VERSION in the target tree.

You'll need target/linux/generic/hack-5.16/,target/linux/generic/backport-5.16/, target/linux/generic/pending-5.16/ etc if you are targetting 5.16 (in this example)

You could also just attempt to backport the upstream into the current kernel, but anything dealing with RealTek you are going to find has been split and changed in the OpenWrt kernel vs upstream, so you may run into a situation where the driver code will also need to be physically changed to matched.

I'm not saying you shouldn't, I just want to put out there possible roadblocks so you can plan for them before you hit the wall (like I did several times!).. It's frustrating, at best :slight_smile:

1 Like

Oh aint that the truth. Thanks for the tips on the versioning. It was a struggle to figure out some of that versioning and those two folders I handnt created thinking the build process would.

this morning I managed to get things at least progressing, now I am just fighting my way through all the issues as you mentioned. Currently at;

Package kmod-r8169 is missing dependencies for the following libraries:
make[3]: *** [modules/ /home/rahlquist/build/openwrt/bin/targets/x86/64/packages/kmod-r8169_5.16.15-1_x86_64.ipk] Error 1

But taking a timeout to get some other weekend tasks done.

1 Like