How to build custom kernel & use to flash FP4?

Hi everyone! I’m starting on a project where we’ll be adding some buttons to my fairphone 4, and possibly changing the screen. This will definitely require us to modify the kernel.

I know it’s open source, which is awesome, but how would I go about using the compiled kernel to flash onto the device, and then use it as a binary to actually build a custom version of AOSP on top of this, accessing the new buttons?

Thanks in advance!

Welcome to the community forum.

Fairphone 4 - Build Instructions — FAIRPHONE open source documentation doesn’t help?

This makes sense for how to build a custom version of AOSP that’ll run on the FP4, but I don’t understand how we’d go about extending the kernel to access different gpio buttons and what not.