An attempt to port Cyanogenmod to Banana Pi M2

(Victor O) #1

I bought the M2 to learn about android internals. I bought it several months ago but cooking an android ROM from source requires a PC with 16GB of RAM. So, I put off doing it till now. I am going to use this topic as a mini-blog. Maybe somebody has been doing something similar or wants to tag along and help me.

For task 1.A I have in mind to compile an Android 4.4 ROM for the M2 from source. I just started to download the source file. Its a 15GB file. The progress status sais it will take anywhere from 43 hours to 7 days. Hopefully throughput gets better at night and it gets done by tomorrow.

For task 1.B I am going to try to compile Cyanogenmod from source for my Nexus tablet. After this post I am going to see if I can start something to this effect while the file gets downloaded.

A NOTE: On step 2 (installing needed software) in the instructions. There was one fail: mingw32. I suppose that should be mingw-w64. But what is that for? From what I gather its to cross compile windows executables on linux. But why is that needed? O.o hmmm

(Victor O) #2

I was unable to compile the Banana PI M2 sources but I did compile the Cyangenmod for the Nexus. I did find that the Banana PI firmware is based on the Mars tablet. I am thinking of compiling a plain vanilla Android ROM to learn more about the process. Then maybe I can find sources for the Mars tablet or equivalent.

Anyways, say that compiling the M2 source code successful, what would I do next? I am drawing a blank. I found a CyanogenMod image for generic AllWinner A31s tablets. I am attempting to flash that into the M2 but the M2 isn’t exactly a tablet with volume buttons. The M2 doesn’t appear to have a recovery menu.

(Victor O) #3

I am thinking that flashing the M2 should be as straight forward as using dd and copying data to the appropriate sectors. Currently worried about encryption mechanisms preventing tampering cause I found thats what PhoenixCard and LiveSuit images are about.

(Victor O) #4

Partitions of the Android 4.4 ROM on a 32GB card

sdb1 - 28GB – mounts as sdcard folder sdb2 - 16MB – [Volume] contains magic.bin and boot pictures sdb3 - 3.3GB – Extended partition sdb5 - 16MB - env sdb6 - 16MB - boot sdb7 - 768MB – mounts as /system/ folder sdb8 - 1.1GB – mounts as /data/ folder sdb9 - 16MB - misc sdb10 - 32MB - recovery sdb11 - 768MB – sysrecovery sdb12 - 512MB – contains /cache/ folder sdb13 - 16MB – [PRIVATE] is empty, msdos formated sdb14 - 128MB – contains HWML folder

There is funky stuff going on in the partition table. gparted won’t load it. You can list it with fdisk. I think to edit it you might need a hex editor.

(1) Had the dumb idea of overwritting the /system/ folder with one from a CyanogenMod ROM. Didn’t work.

(2) Also tried to use dd to see if I could manually flash sdb6 with a CyanogenMod boot image. Didn’t work.