English

[HOWTO] ✏ Compiling Fairphone Open OS / Rooting

Thanks for trying! Did the map also show your position or was it just being happy to talk to satellites?

Yes it did, Osmand~ showed my position on the map

2 Likes

Thanks for trying! - Weird, I’m wondering what could have gone wrong :frowning: I was thinking it could have been because I installed a few alternate location backends from F-droid for coarse location, but I uninstalled them and the problem persists :frowning:

I guess I can do that. Mind you, it’s not very nice, as I just was experimenting and did not think for a formal patch… So, I just changed everything and tested. Install.cpp from ./bootable/recovery is Apache licensed, and I can’t imagine the Makefile, which does not sport any copyright notice, is licensed any different.

I will publish install.cpp and the Makefile for your perusal in some time, if nobody complains.

Klaus

1 Like

As I said, it’s an apache license, and no blobs involved: https://drive.google.com/open?id=0B-9cNi0ys0CMek5kOXBXLVhyLXM

edit: and crude :wink:

1 Like

Thanks! Which Makefile is that?

Also, what’s the rest of the procedure? I assume we have to recompile and reflash the image, what happens next? I’m not too familiar with rooting Android phones, I only know how to follow instructions other people make, sorry :frowning:

I assume it depends on the ROM you’re using. @lklaus patch takes care of the package verifying step in the recovery (without looking, I assume it removes it :wink: ), so you can sideload any package to ROM. If you don’t have a modified recovery you would need your own ROM as well. This ROM needs a su binary in /system/ (for the platform) with the right permissions (you can find them in busybox or on f-droid). A rooted adbd can be nice as well sometimes.

I’m sure someone will post a howto here soon. And I’m also sure that @lklaus will be able to help you.

Ah, sorry, the place for the Makefile is build/core.Makefile.
If you had a successful compile, take the recovery.img, reboot into bootloader (adb reboot bootloader), check for the device (fastboot devices) and then flash (fastboot flash recovery recovery.img). Then switch off and not into recovery. I added SuperSU then via adb sideload.

Mind you, this worked for me. There’s no guarantee that this will work for you and not bork your system.

Hi Klaus.

Correct me if I am wrong, but I guess for flashing SuperSU you just downloaded the version working on the FP just here(?):

https://download.chainfire.eu/696/supersu/

That would be it, in recovery mode - with patched recovery - select “Apply update from ADB” (or something similar), then adb sideload UPDATE-SuperSU-v2.46.zip on your computer.

That’s correct, that’s the way I did it

@USB-2 yes, the version from chainfire.

Hello,

thanks for the good guidance. I just hope there will also be a possibility to “just root” the FP2, without putting a new image on. Configuring the phone took quite a while and I don’t want to do that again. So basically I hope that the FP guys bring out a superSU.zip that works with FP2.

Cheers,
Georg

3 Likes

There you go, a basis to write your Dockerfile for the Fairphone build environment a Docker image with the Fairphone build environment.

Mind that I wasyou might not able to run this because of a kernel bug.

This, however, should be an easy start for anyone who wants to give it a try with docker (recap: this is useful to get the same build environment everywhere and has less overhead compared to virtual machines).


[Edit: Changed information to refer to pre-built Docker image on Docker hub]

4 Likes

In theory :slight_smile: this works without messing up your system. I had my system setup also, and didn’t want to redo all. If you flash recovery, it does not mess up the system. But I’m no expert for recovery, so I can’t say how good my patch for the recovery really is or whether it’s done with a sledgehammer… I wanted my phone setup as soon as possible, but also Fairphones description on how to root will be out rsn, as I understand

Maybe a stupid question - if I compile from source, would I have Android’s file system layout available before creating the images in a last step? So that I could manually do all the steps a given update.zip (such as SuperSu or OpenGAPPS) would do when ran from recovery? Or will I run into trouble with users, groups and permissions? (Obviously this post is inspired by the strange discussion on rooting…) Thank you a lot!

FYI: I yesterday got a reply from the technical support regarding my question about the release date of the Fairphone FOSS OS:

calculate within the first quarter of 2016. The software team is quite
busy these days. The best chance to get in touch with them is to be a
active member in the forum.

Thanks for your ideas. We currently
working on minor software fixes of the current FP2 release. Than we will
focus an updates and the open source tasks from our side.

If nothing happens till mid of February please remind me to pressure it a little!

4 Likes

I compiled Fairphone OS by following the instructions on http://code.fairphone.com
Took about 90min until it said everything was successful.

After fastboot flashall succeeded the phone restarted into recovery, NOT into the OS.

When I boot the phone now the following happens:

  1. short vibration
  2. fairphone splash screen shows
  3. popup in ubuntu that “Android” connected (because usb cable was connected)
  4. short vibration
  5. fairphone splash screen shows
  6. screen goes black
  7. recovery mode is active

At the bottom of the screen there is an error message:

E:Can't open /dev/block/platform/msm_sdcc.1/by-name/misc
(Permission denied)

I tried “wipe data/factory reset”, but it didn’t help. I have read that it only resets data, not the OS itself, but I tried it nonetheless.

In the recovery logs the error message from above appears several times.

How can I analyze/fix this?

The error itself is not a problem, it happens on stock and on my own build too. Have you tried flashing the images one by one ? On top of “flashall” (which I don’t use, I flash each image sequencially) I also flashed cache.img and userdata.img (just to be sure, it should be enough to wipe them but I did it anyway).

I flashed these images in sequence: boot, cache, persist, recovery, splash, system and userdata.
Still it won’t boot.
Can check additional logs? How do OS developers debug these errors?

Does the fact that I am still able to flash it mean that there is hope that the phone can eventually be rescued?

I can’t help you much for the first part without having the phone in front of me (there might be logs on the phone that you can retrieve while in recovery mode through adb yes).

For the second part, definitely. You will be able to flash a working ROM (sadly it’s currently a breach of license agreement to publish ROMs built with the binary blobs…) when you have one.