[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

+ && 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.

Hi Klaus,

I do see a successful mount of /system.

As said before, I get errors when adding cp -R recovery/root/sbin $(TARGET_RECOVERY_ROOT_OUT) into build/core/Makefile. But I do see the files there in /out.

I did add that line to init.rc.

Meanwhile I managed to almost-root it through adb - SuperUser is automatically rejecting all root requests though. One of the steps I had to take was to disable SELinux, but it only lasts until I reboot the phone, couldn’t figure out how to make it permanent.

Hi vivia,
If you want you can send the Makefile via pm. I will have a look, then. Probably will be tomorrow, as this evening I’m away

I realized that the system/xbin/su file showed as empty from Amaze. I noticed that this is because of SELinux. Seems that it restricts access for nearly everything, except ADB shell. ADB doesn’t work for me, don’t know why. Works without problems with my FP1.
Anyway I found a hint here Disabling SELinux in Android 5.0.1 - Stack Overflow
So I added

BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive

to device/fairphone_devices/FP2/BoardConfig.mk. This requires to flash boot.img as the kernel cmdline changed.
With that change Amaze can see correct details of xbin/su. SuperSU tries to copy new su at least, unfortunately without success.

OpenGApps can be integrated quiet easily using this: https://github.com/opengapps/aosp_build
Only some lib files need to be moved or alternatively make files modified.
I tried with nano variant:

I also tried koush’s Superuser today (https://github.com/koush/Superuser). Integration was no problem, but didn’t work either. It looks like that SELinux stuff makes it complicated. There is a fork of that abandoned project: https://github.com/phhusson/Superuser
It states that it has most of SuperSU’s functionality. And its open source. That is what we want, right? :wink:

5 Likes

I’ve fooled a bit with Superuser a week ago, but SELinux prevented me from making it work (or at least I think so). I’ve tried installing their su binary by hand but it’s inaccessible from apps (trying to access it with a terminal emulator returned an error saying something like this : "access forbidden for pid ").

I hope you can find a workaround :wink:

Sorry for the spam but I think this deserves a separate post. Has anyone else had huge battery drains during sleep mode because of the AOSM “mail” app ? I went from 80% to 46% battery overnight because of it.

Using K-9 only brought me from 98% to 96% overnight…

I don’t know, I only use K-9, but maybe you can ask here instead? FP2 battery saving challenge

EDIT: @Arvil I was seeing K-9 Mail use around 33% of my CPU in the stats. Then I was looking for something else and enabled “Background Sync” in Settings -> Accounts -> three dots. K-9 Mail disappeared from the statistics. Of course I have set it to poll every 30 minutes and use push normally, but it might give you a clue.

1 Like