[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

In the beginning I did the flashall as described on code.fairphone.com, but I think it is better to only flash what you really need, i.e.

  • recovery: fastboot flash recovery recovery.img
  • system: fastboot flash system system.img

In the latter case fastboot flash -w … might be interesting, this wipes the partition and settings, so if the two ROMs are not fully compatible there won’t be any problems.
If you want to use flashall, you need boot.img, recovery.img and system.img as well as the file android-info.txt, if you don’t flash from your environment
(edit: put this in the wiki also)

1 Like

I’ve encountered the same problem when creating the Docker image. I was able to solve it by adding a dpkg --add-architecture i386 before calling apt-get.


BTW: The Docker image is now on Docker hub. You can get it as simply as

$ docker pull jftr/fairphone2-build-env

Don’t forget to add the fixes! :slight_smile:

Thanks for pointing it out, I missed your update.

I’l add the -c.

What is wrong with the && sh fp2-sibon-2.0.0-blobs.sh part? Do you mean I should extract fp2-sibon-2.0.0-blobs.tgz to stdout and directly pipe it into sh? Why?

Everyone, feel free to send me pull requests on GitHub.

I tried to build on Gentoo. Everything seemed to work at first, but finally I also got the „out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp“ error. Maybe it is caused by the newer version of Make.
To go round any other incompatibilities I go on with jftr’s Docker image now. Thanks for that!

Just started building. I realized some messages about missing unzip command. Is it required or missing in Docker image respectively?

1 Like

apt-get install unzip is missing :slight_smile: I had the same problem. But @jftr fixes much fast than I can report stuff :wink:

Indeed, it is not available. Does the makefile need it? gunzip is available though. Are these errors or info messages? The build script could for instance first try unzip and – if not available – fall back to gunzip.

I can easily add it if it is necessary.


Edit: Since I’m already at it: Is anything else missing?

1 Like

+ && make update-api \

I have no clue what it does … I assume it updates the API list. We need someone who will test the images created here ;). Could you update the wiki so that people will understand the difference between a normal build and the one inside docker and how they can get their files?

Building was successful for me. And also flashing worked without problems.
Unfortunately phone doesn’t boot. It’s stuck on the boot screen.
I already tried to wipe with “-w” but no success too. Does anybody have an idea?
Edit:
Fastboot in Docker can’t find my phone. So I needed to do it in my host system. May that be the problem?

Did you do a factory reset after flashing (from the recovery)?

I’ve tried now. But didn’t help.

Maybe you forgot to put the blobs in there before building? Did you compare the image / zip sizes with the ones posted here previously by others?

These are the sizes of my img files:
-rw-r–r-- 1 root root 15257600 Jan 10 15:17 out/target/product/FP2/boot.img
-rw-r–r-- 1 root root 12820796 Jan 10 14:58 out/target/product/FP2/cache.img
-rw-r–r-- 1 root root 5828608 Jan 10 14:54 out/target/product/FP2/dt.img
-rw-r–r-- 1 root root 5088376 Jan 10 14:55 out/target/product/FP2/persist.img
-rw-r–r-- 1 root root 1419949 Jan 10 15:15 out/target/product/FP2/ramdisk-recovery.img
-rw-r–r-- 1 root root 2821304 Jan 10 15:14 out/target/product/FP2/ramdisk.img
-rw-r–r-- 1 root root 13856768 Jan 10 15:17 out/target/product/FP2/recovery.img
-rw-r–r-- 1 root root 6221312 Jan 10 14:50 out/target/product/FP2/splash.img
-rw-r–r-- 1 root root 440520572 Jan 10 15:32 out/target/product/FP2/system.img
-rw-r–r-- 1 root root 142911480 Jan 10 15:32 out/target/product/FP2/userdata.img

Where should I add it? After what other step? Is that necessary even if one does not change anything?

The Docker image is only meant for compiling and not for a connection to your smartphone. It could probably be added but I have not done it yet. I don’t know how easily it is possible to connect to a USB device from Docker.

Ok, good to know. I’d also assume that it shouldn’t be problem to flash from another system.

I updated the Docker image, synced again, put the blobs in again and finally built again.
Now my system.img is bigger:
-rw-r–r-- 1 root root 453558248 Jan 10 16:37 out/target/product/FP2/system.img

And it works. Took some time for first start, but now it seems to run smooth.
Thanks for your help.

1 Like

He everybody!

It’s is so great you are working so enthusiastically and constructive on the Fairphone Open Source OS. Keep up the good work! :+1:

2 Likes

Was anybody able to successfully install Open GApps yet?

Is the SuperSU app working for somebody? It just tells me that there is no su file available.