I unpacked the initrd.img with cat initrd.img | gunzip | cpio -vid
and then there's an executable called init
which I think is the first thing the kernel runs. However, what does it do? Is there an example of one that I can look on google AOSP source so I have an idea? This one is likely modified by Xiaomi
Here's a brief explanation of android bootup and init
To read further you can refer here and this youtube video