Building AOKP for Mi2


grondinm

Members
Jul 24, 2011
465
65
This is how i got AOKP built for the Mi2.


So this is really a "native" build of AOKP for the Mi2. it is not a port in that i do not use another devices rom as a base but really build AOKP from source. The only thing not build is the kernel as we do not have those sources(yet).

So first thing to do was fork the local_manifest provided by xiaomi here

https://github.com/mitwo-dev/android_local_manifest

that had to be modified to reflect AOKP repository. See here for what the modified file looks like

https://github.com/grondinm/android_local_manifest

After that i had to fork to device tree from xiaomi in order to modify it to build aokp.

see here for original

https://github.com/mitwo-dev/android_device_xiaomi_aries

and here for my modified version

https://github.com/grondinm/android_device_xiaomi_aries
(some of the changes here where not required in the end but i was learning)

Then i also had to fork the AOKP vendor tree to add the Mi2 to it.

See here for original

https://github.com/AOKP/vendor_aokp

and my modified version here

https://github.com/grondinm/vendor_aokp

Basically i took the cm.mk file from the xiaomi device tree and moved it to the products folder in the aokp vendor tree in order for it to be able to build.( i realized after that i could have done this a different way but this works just fine)

after that i was ready to build. I know this is not much of a "guide" but it should provide a good idea of what i had to do. Any question ask away. If you want to try building yourself follow the steps in the readme on my local_manifest tree and feel free to fork.
 
grondinm

Thanks for the tutorial!:)

This tutorial can be applied to other ROM like paranoid, PAC etc?
 
to a certain point yes. I was looking at paranoid android earlier but they have a different setup for the device .mk files so it will be different...not sure about PAC have not looked.
 
Combining PAC and Miui v5 would create the ultimate custom rom ever build :-D

Written on my Xiaomi MI2 with Tapatalk 4 Beta
 
  • Like
Reactions: L.Simon