At the beginning of this article, i would like to mention that i’m a noob when it comes to android custom kernel or ROM development, so some of these information may be obvious to some of you, but it was relatively hard to find one place with up-to-date information on this topic.
Backstory - why i want to compile the kernel for my phone?
My current phone is the Xiaomi Mi 9 - i’m very happy with this phone, it is more than fast enough for my everyday needs, and the photo quality (especially on gcam) is also pretty good. My main issue with this phone was under MIUI 12 - it had a couple of annoying bugs that will probably never get fixed: