English

LineageOS 16 for FP3 development

Tags: #<Tag:0x00007f05e1ee0b68>

In the last few weeks dk1978 and me was working on porting LOS16 for FP3. Now we reached a milestone: LOS boots up completely and UI is working :partying_face:


So I wanted to create this topic to give you the current status and motivate/invite people to join development :slight_smile:

Why completely porting LOS for FP3, there is the GSI version which works fine?
Well, that’s true. But GSI for LOS16 is not maintained anymore, what means there will be no updates. Also it depends very much on the base system (boot and vendor partition) of the stock firmware. With an own configuration for building LOS for FP3, updates could be built and provided much more easy. Also more code and configuration would be under community control. It could even be the base for LOS17 or later and other custom roms.

What works so far?
These are the things known to work so far:

  • LOS boots up completely
  • adb is fully functional
    • logcat can be used to retrieve log messages
    • shell to open a console on device
  • UI with display and touch
  • Sound
  • Vibration
  • LED and brightness control with light sensor
  • Bluetooth
  • Camera
  • Wi-Fi
  • NFC

What doesn’t work so far?
These things are known not to work or are simply untested:

  • LTE
  • GPS
  • Fingerprint
  • Storage encryption
  • Updater
  • SELinux in enforcing mode

What is left to be done?
There are a lot of things that needs to be investigated, solved and tested:

  • Getting all non-working stuff done of course
  • Flashing LOS with TWRP from k4y0z
  • Clean up and remove remaining Motorola stuff (it’s based on the G7 config)
  • Removing more proprietary binaries
    • Some libraries and stuff is still copied from the stock firmware
    • Should be replaced by building as much from sources as possible
    • Required configs can be maintained in the device repo
    • Some stuff like firmware files will always come from stock firmware of course

Where can the sources be found?
My repo with the device configuration can be found on Github.
dk1978’s repo is here.
We tried to maintained required steps and information for building in the readme file.

How to communicate for development?
One proposal would be to use an IRC channel #fairphone3 on freenode (which is also used by the LOS team). But I’m also open to other suggestions.

Files for testing:
:exclamation::exclamation::exclamation: As always ensure you have a working backup before flashing anything.
These files are completely work-in-progress and may break your device if you don’t know what you do. :exclamation::exclamation::exclamation:

Archive with image files to flash with fastboot:
lineage_16_fp3.tgz

Package as created from LOS build system. This should be flashable via TWRP, however this is completely untested. Feel free to try it. :smile:
lineage-16.0-20200330-UNOFFICIAL-fp3.zip
lineage-16.0-20200330-UNOFFICIAL-fp3.zip.md5sum

Updates:
2020-03-24T23:00:00Z Got Wi-Fi running.
2020-03-29T22:00:00Z Add files for testing.
2020-03-30T22:00:00Z NFC is working

45 Likes

great, there is some… development!!! thanks!
btw, /e/ already has a booting system since 2 Days. you might want to cooperate with them since /e/ is based on LOS?
edit: I copied the link but I didn’t paste it here… there you are: https://community.e.foundation/t/fairphone-3-fp3-support-on-e/6438/83

1 Like

Great work! All the best to you

1 Like

Yes, I also wondered if they are doing the same or they use a GSI. I asked them in the thread.

They are doing the same (from a mail I received : “we already have all the needed blobs”).

but as far as I know /e/ is based on LOS15. just telling.

They recently released a Android 9 (Pie) build for the FP2, which would be LOS 16 IIRC.

Edit: ah, yes, this post contains a screenshot showing Android 9.

2 Likes

Will the the FM-radio and LED notifications works?

1 Like

I am using LOS16 (GSI) and can tell you that the notification LEDs are working.

1 Like

Thank you very much for the nice preparation.
I was able to follow the steps (in README.md) and compile easily.
However, I’m stuck at flashing as these both files are missing: product.img & dtbo.img.
I also can’t find them somewhere else.
Should they have been generated by the build process?
I see some magic for this in your device tree but I do not really understand it. Can I maybe rebuild just product and dtbo?
Best Regards, Michael

Hi @michlx,
Nice to hear that you were able to build so far. Usually all the image files should be generated with brunch fp3 eng. You can also build the images separately with:

m systemimage
m vendorimage
m productimage
m dtboimage

Prior you need to call lunch lineage_fp3-eng to select the right configuration. The brunch command usually does this for you already.
Also it makes sense to add -j parameter to run jobs in parallel and speed it up little bit. E.g. m -j4 systemimage. Number depends on your CPU of course. brunch also uses a default value here.

However I currently don’t have access to my machine and can’t verify all this.

Hi @Max_S, thanks a lot. That helps a lot to investigate.
I’ve tried to rebuild all the images with the above commands.
The first two succeed; The product also succeeds but doesn’t seem to build anything.
The dtbo fails with an error message:
ninja: error: '/......../out/target/product/fp3/dtbo.img', needed by 'dtboimage', missing and no known rule to make it
I tried to upload a snippet of the build log but it seem as one cant upload text files.
Now here : https://pastebin.com/6DdBsP6d

Maybe a related question:
in your git repo https://github.com/mstaz/android_device_fairphone_fp3
there is a lineage-16.0 branch.
But the tweaked local manifest mentions revision="refs/heads/master" for that repo.
Is that intentional?

Update: I’ve changed the line to revision="refs/heads/lineage-16.0" .
Now dtbo.img and procuct.img are getting build.
I flashed everything and I see a lineageos bootscreen - Wow !
Unfortunaltely, it restarts after some seconds and there is no related ouptut on my UART.

Oh, yes you’re right. That has changed of course. I’ll update that in the readme. I think you can leave the revision completely as this is the default branch now.

UART may not be enabled. But you may have adb available at that point. Can you run adb logcat with the phone connected before starting the system?

does the Fairphone company financially support those efforts?

It’s very essential for users to have an alternative to the Google surveillance capitsalism.

Hi @Max_S, at least I begin to understand this build system half way :slight_smile: .
For some reason adb logcat did not work yesterday. Not it works.
I saw complaints about Dalvik in the log so I Wiped Cache and Data partitions. That helped to proceed further but my device still restarts after booting for about 45s.
There are so many issues that is hard to make out a root-cause.
I’m now trying to enable the UART console I hope I see something meaningful there.

Hi @ooXoL4tu, as far as I know there is no financial support. Fairphone announced that they want to release more of the software, like they did for the Fp2 as Fairphone Open.
Up to now that has just happened for an (incomplete) Linux kernel. That means, people just can try to reverse engineer to proceed.

Yes, wiping data or factory reset respectively is required. Does it boot completely or you only see the LOS boot screen?
If you want you can send me the logcat output and I’ll have a look.

No, it does not boot completely. I just see the bubbles moving, then there is a break for one or two seconds and then it reboots.
(The last messages are always different)
Here is a logcat ouput. Pastebin was to small so here it’s in gist:

Did you flash with TWRP? There seem to be some twrp related stuff. Also update_engine seems to crash.
For me at the moment only flashing via fastboot works.