[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

I indeed flashed from my host.
I copied the images (the whole folder) on a usb-drive, copied them on my laptop, tried
fastboot flashall from there. didn’t work either.
But I don’t see that as the important problem. It shouldn’t make a difference if I flash one image after the other “by hand”, or flash all at once with flashall. The problem is a phone that won’t start after flashing…

I don’t know what exactly caused the error but I’ve nailed it down. With the builds from today the multiline CMD has stopped working. I’ve created a new Dockerfile with that command moved to a script file. I’ll let you know once building is finished.

Edit: You can follow the build process on Dockerhub. Here it will tell you whether the latest build is finished.

1 Like

With my (very early) tests the phone booted so far I could see the errors in logcat via adb. Maybe yours also gives a hint that way?

1 Like

I’ve built again tonight with the new blobs and just flashed it - now it boots into the OS! :slightly_smiling: Thanks for updating!

A stupid question: In contrast to the freshly shipped status, there was no phone setup procedure at all after flashing. Is this intended behaviour?

Btw, I didn’t copy the libs around after . ./build/envsetup.sh, so this seems to be fixed with version 2.0.1 of the blobs.

Additional remark about the previous attempts: Saying this, I realized that missing libs could have been the reason for the failure of my earlier build. I did copy them during the compilation procedure but not before flashing in the new shell (I hadn’t thought about this being necessary as well). As I have a backup of my previous build with the old blobs, I tested it:

$ . ./build/envsetup.sh
$ cp -v vendor/qcom/proprietary/target/product/FP2/obj/lib/*.so ./vendor/qcom/proprietary/target/product/FP2/system/vendor/lib/
$ choosecombo 1 FP2 2
$ fastboot -w flashall    

but still the phone got stuck at FP-logo. So, copying the libs around during the compilation process seems to be enough and the libs have probably not caused the earlier problems.

1 Like

Please add ‘gcc-multilib’ to the dependency list for Ubuntu 14.04 LTS.

Edit: Now that I am “Basic User (Access Level 1)”, I was able to edit the wiki post myself.

If someone is getting the error “fatal: unable to access ‘https://code.fairphone.com/gerrit/fp2-dev/manifest/’: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none”, you need to add the Comodo RSA Domain Validation Secure Server CA certificate that code.fairphone.com uses to your /etc/ssl/certs/ca-certificates.crt. This is necessary, because Ubuntu 14.04 does not ship with this CA certificate.

In order to do that, obtain the certificate from Comodo (copy the PEM file) and store it somewhere on your filesystem (e.g. /tmp/Comodo.pem). Afterwards append the Comodo.pem file to your ca-certificates.crt file

# cat /tmp/Comodo.pem >> /etc/ssl/certs/ca-certificates.crt

You should now be able to use the repo command with the https mirror.

1 Like

Hi @jnsp, thanks for that info. I just finished my first make and im not sure if its gone all right…
I didn’t have any fatal errors anymore but one checkpolicy for sure…

can i flash my phone with that or should i write to the support?
Regards, Novski

Hi @novski, not sure about that. I’d suggest to run make clean and build again:
make clean && . build/envsetup.sh && make -j 8

What operating system are you using? Have you installed all the dependencies listed in the first post?

This is not necessary. Just install ca-certificates:

$ sudo apt-get install ca-certificates

This should not be necessary. gcc-multilib is a dependency of g++-multilib which is already listed. Adding it separately does not change anything.

What phone setup do you expect? I don’t own a FP2 but I think the only setup you have when booting for the first time is the Google login procedure (or is there anything else)? The self-built ROM does not include Google services and thus no Google login will greet you.

Hi @jftr,

on a freshly installed Ubuntu 14.04.3 apt refused to install the packages as they were listed in the first post, since gcc-multilib was not in the list of packages to be installed. After adding it, apt installed all the packages without error.

This package was already installed. Downloading the CA certificate manually worked for me.

I just retried to install all the dependencies listed in the first post.
They were all already installed. Seams like my try to follow this is the same… so i will try a clean new make.
Im working that out on a Macbookpro Retina with Ubuntu 14.4 Native.

I have a question to the certificate.
if i click to download the file i get a xxxxx.crt file. not a .pem
now, possibly you mean to copy the text in the PEM box. But with or without the:
-----BEGIN/END CERTIFICATE-----
Text in the first and last line?
Regards, Novski

I’d suggest trying to install the package ca-certificates, as @jftr pointed out.

If it is already installed, you can copy the PEM file with the -----BEGIN/END CERTIFICATE----- and follow the instructions above.

Maybe sudo apt-get upgrade also helps (in case an older version of ca-certificates is installed).

Earlier on, I’ve had this problem as well. Thanks to your instructions, it now works for me, too! :relaxed:

I can confirm the behaviour @jnsp experienced. When I encountered the same issue, I also had ca-certificates already installed and it didn’t work.

As I’ve just noticed your posts all at once, I went ahead and tested this: I executed sudo apt-get upgrade and the repo init ... command afterwards, but this didn’t solve the problem. The error message was still the same (the one described by @jnsp). Only after following his guide to add the missing certificate, the error disappeared.

1 Like

Well, I read that (apart from the google stuff) you can configure a Wifi connection and, if you don’t, you are asked to manually set the date and time. Edit: Ok, it just came to my mind: The main part of the setup is probably the google stuff and the Wifi step is just invoked, because you need an internet connection for the google setup to work. Hence, it’s not surprising that there was no Wifi setup in the self-compiled OS. eoEdit

@All: I’ve edited the Wiki post to include the lessons learned from my 3rd Try above. I hope, that’s fine - if not, feel free to improve, delete or discuss.

As I finally have a running build thanks to help of this forum :heart_eyes:, where do you discuss the builds or the problems you encounter when running the OS? Just in the threads of the usual OS?

(For me everything is fine right now, my FP2 OSOS has an uptime of 48 hrs and all my apps run smoothly - just asking!)

2 Likes

Following my efforts from last week I tried again to build the source and failed again. :frowning: I constantly get segfaults. I’m following the official build instructions plus the infos in the wiki article at the top. I’ve uploaded a complete build log.
Could someone more experienced with compiling (android source) please have a look and help me debugging the problem. Feel free to ask for additional information you need.
Thanks!

Hi, I had almost the same “problem”, and after several reboots with just fairphone logo I tried the following and it worked!

1.- Ensure your battery > 80%
2.- Unplug usb (unplug any charger, I thing that was the key part…)
3.- Boot in recovery mode
4.- Wipe cache
5.- Factory reset
6.- Reboot (from recovery menu)

It takes quite long to start the first time but it works!