There isn't much homebrew apps, but there is Termux
to install Ubuntu, do
pkg install proot-distro
proot-distro install ubuntu
then proot-distro ubuntu
-------------------------
ubuntu is pretty helpful for coding
firmware also can be made using ubuntu,
but that would need to overwrite the bootloader.
----bootloaders----
the android bootloader are really just the modified
linux bootloader (i call it the mlabooter)
modifing the bootloader is pretty hard. flashing the phone using a physical
chip could help modify the bootloader.
----android os----
the source for the android os is actually avaliable.
but its an archive...
core of mla...still can be compiled using gcc/g++
may need rust and asm if need/added!