Fairphone 2 and CyanogenMod / LineageOS

An update from the CM blog about latest news of Cyanogen Inc: http://www.cyanogenmod.org/blog/cyanogen-inc-and-cyanogenmod

I post it here to come to an end the above brought up topic. For further discussion, I suggest a moderator to move the posts to a new topic, please, :slight_smile:

2 Likes

Your wish is our command (well, @NicoMā€™s, which documented it marvelously):

We forgot to link it here, :slight_smile:

3 Likes

Iā€™ll give it a try tonight.

Quick update: Building the recovery works, but I see some error messages. In the end itā€™s around 18 M.

./extract-files.sh is also able to work with rom images to make things easier. Try using fp2-sibon-16.07.1-ota-userdebug.zip as an example. Just unzip it somewhere and use something ugly like:

./extract-files.sh ../../unziped-rom/

mka is still running, no clue yet.

3 Likes

With bash (Ubuntu 14.14) included in Win10, I will try this week to build it on Windows. Seems fun :smiley:

Good morning, my name is AndrĆ©. Just bought a FP2 for my wife. I would love to be able to change from fairphone os to cm. if someone wants to write down an summary to whatā€™s been done in the development here, Iā€™d be very happy. Is there anything I can do to help? I run both win and ubuntu.

4 Likes

Three messages up :wink:

The current problem I have is that the device doesnā€™t boot but doesnā€™t show any error, even with adb logcatā€¦ So I have no idea what the problem isā€¦

2 Likes

Thank you very much :wink: Sorry for unnecessary questions. Will follow with interest, and see if I can help in any way.

Hello everyone,

I recently purchased a FP2 and Iā€™m quite satisfied with it. However, I would like to see a running port of CM as I used it in the past with other devices and liked it very much. Currently Iā€™m running Fairphone Open OS 16.07.1 but not 100% happy with stock Android OS, so I think having the ability to install alternative, stable OSs would make FP2 a better, longer-lasting device and more open to community contributions (which personally I think itā€™s very relevant step to make this a fairer, sustainable phone).

At the moment Iā€™m downloading the repositories (it will still take a few hours) and following steps from the wiki. Iā€™m running Linux Rebecca 17 on my computer. Iā€™m also reading some documentation on building/porting CM to get familiar with the processes involved in the meanwhile. For a start I would like to perform all steps to get to the current state (boot.img not working), from that point I could do some additional testing/debugging maybeā€¦

Iā€™m familiar with computers and development but never ported CM for any device. Still I would like to give it a try. Iā€™m aware this is now in a very early stage and far from having a stable working OS, but Iā€™m optimistic we could see a running CM over Fairphone in the near future if the project gets enough momentum and more people gets involved with it.

6 Likes

Yeah, welcome to the (small) club of people trying to get a working CM :smiley:
If you have any questions, donā€™t hesitate! I think @Roboe start to have a good expertise in Android in general and Cyanogen in particular.
It is the first time I cook rom too, it take a bit of time to start understanding how it works, but at the end it is pretty clear :slight_smile:

4 Likes

Welcome to the crowd!

Currently, @NicoM and I followed almost all the steps of the Porting CM article on CyanogenMod wiki. We are currently using a precompiled kernel, and the device configuration needs to be merged somehow with a Qualcomm general msm8974 config. The wiki post Nico did is a great knowledge base to start with.

Iā€™m right now in a personal situation that doesnā€™t allow me to work on the port, but Iā€™ll be happy to solve any doubd youā€™d have, if I have the knowledge to, and to bring ideas for anything. Just drop me a message, :wink:

PD: I check GitHub every night, so your pull requests are welcome!

2 Likes

OK, so I finished syncing the repos and I was about to launch a build.

As far as I see the idea behind is to take a device with same hardware as a starting point for the CM build, in this case the MSM8974AB. I see this referenced on many places as the FP2 SoCā€¦

However, my device reports this:

$ cat /proc/cpuinfo | grep Hardware                                
Hardware    : Qualcomm MSM8974PRO-AA

Should I trust Androidā€™s info or the spec sheets? I see this model is also used on the OnePlus X and is actually not the same chip as the AB. It would be something in between the snapdragon 800 and 801 series (CPU from the 800 and GPU from the 801) but itā€™s not very well documented. Would this have any implications with the build?

PS: I just came over this thread and I see Iā€™m not the first to realize :confused:

1 Like

I suppose thereā€™s no problem at all, itā€™s the same family after all, and Qualcomm distribute the same code on CodeAurora for msm8974.

1 Like

I think HTC M8 is a better fit than the OnePlus X because it has dual SIM support

2 Likes

OK, I started a build nowā€¦

I will let you know once done.

3 Likes

Hi guys,

So after some problems setting the build environment I successfully ran my first build. Repo sync is incredibly slow and unstable from my home network so I finally decided to run the build on a hosted server I have around.

Followed all steps from @NicoMā€™s wiki and finally got the build.

Now Iā€™m wondering how to properly flash the resulting .img files as Iā€™m pretty new to androidā€™s partitions, filesystems and boot process in general. Is it necessary to flash the recovery.img? Iā€™m currently using TWRP, canā€™t I just keep this? Or do I specifically need the one from CM?

I tried to use this commands (no recovery.img flashed):

fastboot flash boot boot.img
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot reboot

Is this correct or am I missing something? How do you guys flash these files?

Boot didnā€™t work as expected and adb logcat shows only ā€œwaiting for deviceā€.

2 Likes

Your commands are right I think. And I have the same result, the boot doesnā€™t work and doesnā€™t show any errors, this is the big problem actually :-/

1 Like

The adb logcat not working may be caused by adb authentication (enabled by default). If the RSA key of the computer is not known (and itā€™s not since we just flashed with a fresh build) adb connection wonā€™t work. adb Auth can be overriden adding this to default.prop:

ro.adb.secure=0

I will try to manually regenerate the boot.img with this modification and give it another try. Maybe then we could see the boot logsā€¦

4 Likes

I already try it too and it didnā€™t work for me but I hope I did something wrong!

Isnā€™t there a possibility to let the kernel post a log using the usb portst? One could also try to debug the image in a virtual machine.

2 Likes

I also didnā€™t manage to make it work yet. I donā€™t know if thereā€™s another way to debug the generated boot.img, but some virtual device/emulator would be useful for sure.

In the meanwhile I managed to have the repos synced on my desktop, so now I can do builds and deploy faster. Iā€™m trying to play around with different .mk files and following the CM porting tutorial from scratch to get an idea of what weā€™re actually doing :smiley:

Iā€™m also looking at the Fairphone Open OS source as I think we could get some valuable info from there for the CM build.

@NicoM, @Roboe: Which prebuilt kernel are you using in this blobs folder? Did you extract it from the device? Did you also try to build from source? Could it be broken?

Iā€™m also concerned about the partition scheme. I could not get a clear picture of which partitions and filesystems currently exist on the device. I read this should be on /proc/mtd or /proc/emmc, but neither of them exist on my deviceā€¦ I could however get some info from /proc/partitions and /proc/last_kmsg. Then I compared this to the recovery.fstab generated by extract-files.sh and it doesnā€™t make much sense to me.

I think we should take a closer look to the files generated by extract-files.sh as thereā€™s a lot of stuff there that might be breaking the boot.

2 Likes