Fairphone 2 and CyanogenMod / LineageOS

I got a similar error yesterday when I tried to build (As I didn’t change much I did a complete repo sync before).
How do you debug this error? I tried searching for the missing file, but usually find multiple versions of it and even if I knew wich one to use, where to put it? Or am I going at this completely wrong?

Well, I don’t know how to debug it, :confused:. I’ll tell you what I did:
I looked for an audio_effects.h file on FP Open OS sources and I found it in kernel/include/sound. So I assume it is part of the kernel.
Kernel sources are included in our CM local sources (in kernel/fairphone/fp2), but, AFAIK, it shouldn’t be compiled yet, because we use a prebuilt kernel (TARGET_PREBUILT_KERNEL is set on BoardConfig.mk). [1]

So is something misconfigured, then? I’ll try to build with TARGET_NO_KERNEL set to true. Didn’t work.

[1] = A prebuilt kernel is the way to go until we have something that boots fine, because building the kernel can cause a lot of troubles.

1 Like

I updated the kernel to 16.07.1. repo sync -c kernel (or cd kernel && git reset --hard origin cm-12.1 if it fails for anything)

Edit: Ok, so after the kernel update (and after rm -rf out/ I did just in case) I’m no longer getting the odd audio_effects.h error. Now I’m getting this FM-related error:

make: *** No rule to make target '/home/debian/android/cyanogenmod/out/target/product/fp2/obj/KERNEL_OBJ/usr', needed by '/home/debian/android/cyanogenmod/out/target/product/fp2/obj/SHARED_LIBRARIES/libqcomfm_jni_intermediates/android_hardware_fm.o'.  Stop.

I’ll try to make it build, or maybe we can disable FM support in the meantime (and I really mean temporalily, I want a functional offline radio)

3 Likes

android_hardware_fm.o error seems fixed now. I made the kernel compile, and for that purpose I cherrypicked a three years old commit (Did someone said “Android fragmentation”?) to make it build out of Ubuntu 14.04 (i.e. with updated pearl compilers)

Let’s see where it breaks now, :laughing:

1 Like

With a certain amount of time, it sounds really cool to dive that deep into CM development and to PROGRESS :).

2 Likes
make: *** No rule to make target '/home/debian/android/cyanogenmod/out/target/product/fp2/obj/STATIC_LIBRARIES/librecovery_updater_msm_intermediates/export_includes', needed by '/home/debian/android/cyanogenmod/out/target/product/fp2/obj/EXECUTABLES/updater_intermediates/import_includes'.  Stop.
make: Leaving directory '/home/debian/android/cyanogenmod'

#### make failed to build some targets (06:54 (mm:ss)) ####

:frowning:

Hi guys! Do you have something new about your CM port attempt ?

2 Likes

Hi ! Since my attempt at building Ubuntu Touch has met with a terrible fate (it’s stalled until I understand the basics of UT debugging) I’m trying to build @Roboe’s version to see if I get the same error.

This is the local manifest I use :

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="Roboe/android_device_fairphone_fp2" path="device/fairphone/fp2" remote="github" revision="cm-12.1" />
  <project name="Roboe/android_kernel_fairphone_fp2" path="kernel/fairphone/fp2" remote="github" revision="cm-12.1" />
  <project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github"/>
</manifest>

(The last one is Cyanogenmod’s qcom/common to avoid the “dtbToolCM” error, it might be the wrong branch though).

For now, it’s building the kernel nicely.

3 Likes

Hi, I have received my Fairphone 2 some days ago and and followed the setup by @NicoM. So far I get the same errors like @Roboe with the “audio_effects.h” and “android_hardware_fm.o” when building everything with “mka”. I don’t understand how he exactly resolved them. :sweat_smile:

I really would like to contribute to the project and get CM running on FP 2 … but right now I’m an absolute beginner. I will try to understand the build/compile process in the next days.

5 Likes

Sadly, no. I bought a new computer (a why!, for those curious) with a nice processor and SSD, but broke my old HDD (accidentally) and I’m currently out of space for such heavy sources, :confused:

I don’t know if you’ll take some advantage of that work, CM wasn’t compiling successfully and AFAIK Ubuntu Touch needs at least some modifications over a working ROM.

I wiped out old out/ folder and the error disappeared somehow (cache related, maybe?). Later, I compiled the kernel (modified the BoardConfig.ml to do so) to tackle the FM error. So that would have solved them for all, but…
Which platform are you building from?

That’s our temptation too. We are all beginners, as far as CM porting concerns. @NicoM’s guide has some interesting documentation links at the bottom to get you started.
Happy to see new people involved! :smiley:

6 Likes

Last week I was surprised to see that @keesj started on github the not empty site about FP2 and CM. I don’t link it here because I am not sure if an empty github page would help. The surprise to me was topped by the point in time in september last year when his ambition stopped as soon as it was started even months before the first FP2 was deployed. Maybe @keesj could explain why it is not easy to bring CM on FP2.

1 Like

The work done here is based on that repo by Kees.

A CM port is a complex task. Taking in consideration Kees was leading a team for releasing two different flavours of Fairphone OS, I don’t see odd he didn’t continue the work on CM.

Let me be clear: It is not easy to port CM for any device. But the task is taking so long for us because we don’t have an Android OS building background, we lack documentation and we are not familiar with some tools/errors.

Nobody would say it isn’t so and you may have known that I didnot expect anything but helpfull comments from FP Then let me be also clear: I did expect to have helping comments instead of quick solutions or a full support of CM by FP. Did I expect too much ?

3 Likes

Maybe another topic is required to my following concerns about FP Open OS and CM:
Imagine, only imagine, CM could cover the complete FP2 hardware, - would be performant and taking not more battery power than FP Open OS and later would be supported by CM’s updates … Only if then, would FP Open OS still make any sense ?

Hi everyone, I completed the build and as proposed in the wiki post it indeed doesn’t boot. I need to mention that I seemingly can’t get the built recovery to work.

So I got back to stock TWRP Recovery, and extracted the kmsg, and am having a look at it.

It seems the kmsg generated by cyanogenmod’s kernel is corrupt, but using cat -v I could get back most of it. Here is the result, and here is an example of the same kmsg when successfully booting on TWRP.

6 Likes

I once had this kind of corruption in a last_ kmsg on fp open os… Probably when the reset happens, unpredictable thing happen to the memory (and also the clock?)
Interesting is the emergency remount r/o. There’s no real hint to why it’s doing this. Thought first the unexpected reset from synaptics, but this happens also in the other kmsg (just been checking only on the phone, not ideal for that kind of logs…).
Something is starting a shutdown. Also, i would have to check on a real pc, why the boot takes nearly seven times as long, according to the timestamp (might there be some watchdog, which gets started but not retriggered due to missing hw drivers? There are some qcom error messages)

Right now this all is just speculation.

4 Likes

Did some further inspections. In the end, it looks very similar.
What probably hints to hw discrepancy is

It starts to diverge after around 40s, where cm is quite, und fposos brings healthd information (whats happening on cm here?). Then again nothing I would consider serious, except for time passes and then the emergency reboot starts. Again, I’d say it’s some watchdog that triggers and starts the reboot.
Probably because of the qcom messages that seem to be caused by some wrongly performed initialization or wrong drivers?

Edit: this looks related: https://github.com/franciscofranco/bacon/issues/3

You’re talking about the recovery here, don’t you?

We can maybe ask to the developer who ported TWRP to the FP2? S/he could bring some light maybe about what a recovery needs to run properly.

I guess you are building the kernel from source too, right? But the dt.img is the prebuilt on the repo (moved to out/target/product/fp2/ as @NicoM documented on the wiki).
First time I built the CM recovery I used the blobs for the kernel and dt.img provided by Kees on the repo and the recovery was working

1 Like

Are you referring to my post? No, i answered @Avril’s post. As i understand it, it’s the log from booting Android itself

Aaaaaah, so he succeded at building CM only with the setup on my repos? :scream:

Also, I’ve realised I need to update the local manifest with the cm.dependencies content. A quick and dirty fix is to run breakfast m8, which has common dependencies.

I want to highlight here @Arvil has lended me a remote server to continue with the CM porting efforts. I’m setting it up right now. Thank you so much! :blush:

11 Likes