[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

Tags: #<Tag:0x00007f05dc232088> #<Tag:0x00007f05dc231f48>

Unable to find image ‘jftr/fairphone2-build-env:latest’ locally
latest: Pulling from jftr/fairphone2-build-env
92ec6d044cb3: Pull complete
2ef91804894a: Pull complete
f80999a1f330: Pull complete
6cc0fc2a5ee3: Pull complete
56706dda2366: Pull complete
739c62aa8a48: Pull complete
55873708e642: Pull complete
83df967c727b: Pull complete
661ae9835943: Pull complete
ad936d02bfb8: Pull complete
b3d04d8db290: Pull complete
8029956fa39e: Pull complete
Digest: sha256:10b418fb85cdf433a43ddddfec06786189ddffec34d9a89b9aec9d8d66a2923a
Status: Downloaded newer image for jftr/fairphone2-build-env:latest
/bin/sh: 1: [/bin/bash,: not found

@Bergziege: Looks like a shell (bash) is missing.

Try apt-get install bash (?) in your shell (?).

I’ve build the images again (but without docker here) … with the lastest bin blobs/fixed scripts. It seems to work, but I have no phone here to test it.

I’d wager there’s a syntax error. I can’t imagine a system without bash :slight_smile: But [/bin/bash, looks like an error to me

Script with a wrong “bang” (Shebang) path, maybe?

It worked two days ago with the same commands on my computer, so my guess also is a error inside the Docker-file.

What root terminal? The one inside the docker container? There is no fastboot installed in the container, is there? You should flash from your host.

As stated above: The docker container definitely has both bash and sh installed.

However, I can confirm this error. I’ll investigate and report back.

1 Like

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:
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.