How to build a custom kernel for old firmware

I’d like to use network namespaces on the AR-300M
I’m happy with the existing customized user space.

What is the easiest way to compile a 4.14.221 kernel for it with the

CONFIG_KERNEL_NET_NS

option enabled?

I’d like to avoid (re-)building the whole image, if possible.
I’d like to simply write the new image to /dev/mtd4, over the existing one.
Since the versions will be unchanged, it should be compatible.

Thanks!

You can use this repository to compile the full image, but the image does not include glinet’s UI.