Building LineageOS for FP4

GPS should still work without problems, those are used to get a faster fix or location information in places where GPS isn’t available.
More ≠ precise in this case, there’s sadly no real logic to which one takes precedence. IIRC the fastest one is used :thinking:

As for which one to choose, they all have their strengths and weaknesses, I think this wiki (a bit old) provides a great overview. As far as I can tell, the most up to date one is LocalGsmNlpBackend and that’s the one I usually use, mostly because it’s easy to contribute to with Tower Collector and the database is available offline.
Wifi based ones have been buggy for me in the past, sometimes the location would end up two towns over, cell towers rarely move :smirk:


Edit: Maybe this topic should be split now above this post and turned into a more general one discussing building lineage etc.? :thinking:


Edit 2: Thank you @robbert.f that was fast :smiley:
Would it be possible to move the first post back to the other topic, otherwise that one ends without the solution. Nevermind :slightly_smiling_face:

2 Likes

Don’t press the power button, but instead maintain one of the volume buttons and then connect the USB-C cable to your computer. Your FP4 will be in:

  • volume down + cable : fastboot mode,
  • volume up + cable : Android recovery
4 Likes

That’s a great way to do it :metal:

I generally keep it plugged in and release Power as soon as the screen turns black, then just keep holding up or down until you’re in the desired mode.
Bonus tip: Pressing Vol. Down during the boot animation (that blue dot) will boot you into Safe Mode, really useful if you messed up some Magisk configuration as this will disable all modules.

2 Likes

I’m currently looking into building LineageOS with microG and fdroid. As far as I understand, I need to enable signature spoofing using these patches and then include these packages while building LineageOS.

I was able to apply this patch but when I tried to apply this one I get an error saying

can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/src/com/android/permissioncontroller/permission/utils/Utils.java
|+++ b/src/com/android/permissioncontroller/permission/utils/Utils.java
--------------------------

since the files it’s trying to patch don’t exist.

Do I only need to use the other patch or did I miss a step?

Very nice, you got a working build for the FP4! :smiley:
Are you able to contribute your work the the semi-official channels in this thread: FP4 and LineageOS - #70 ?

Seems dk1978 and the others would be happy to get help. :slight_smile: Then, even more users would benefit. Have a nice day!

1 Like

I would gladly contribute, but to be honnest this is my first ever custom ROM build - kind of a little event in my concern :smiley: - and I wouldn’t really know how to contribute.

I only but followed the procedure written by @Error so I didn’t really achieve anything I could take credit for ! I didn’t modify a single file from the repo in the process… (I’m just starting to mess with the manifest to create a gApps bundled version but that’s about it)

2 Likes

I just didn’t apply the second patch, only the first and continued. LineageOS built successfully, I checked the installed-files.txt file in the output directory and it says that /system/app/FDroid/FDroid.apk and /system/app/FDroid/FDroid.apk are installed, so I guess it worked.

I’ll write a post later on what exactly I did.

1 Like

There isn’t any work to be contributed per se, we just compiled the already existing code using the sources on the WeAreFairphone github account.

I’d be interrested to know more indeed.
I’m trying to bundle pico Gapps to the build, following this guide .
Well a lot of things didn’t go as planned and I was able to fix some of them but there’s still a bit of work ahead

1 Like

I managed to build version with pico Gapps bundled, I know this will make lot of you cry, anyway I’ll try to test my limits in my ability to use a fully degoogled system before I flash it :smiley:

1 Like

:sob:
My FOSS :heart: is crying, but I love it that you have hacked your way to the system you want / need, nice job :metal:
Keep us posted! (And maybe throw in a short tutorial for others that want to take the dark route)

1 Like

Well don’t cry just wait I didnt give up on degoogled spirit as I didn’t flash the beast yet (I will post a tutorial if I get certain it actually works).

I really start to like and do want my phone to run as clean as possible its just… the maps thing :smiley:
I don’t know if there’s something wrong with the build or if it is the lot of degoogled roms but location is VERY inconsistent: when I’m at home (appartement in rather big building) and open OsmAnd, Waze or Gmaps location is sometimes 4-5km off, and then it goes gets my accurate position then off 5km again etc….

That sounds like UnifiedNLP acting up. Try disabling all location providers and see if the problem persists :thinking:
You can also use GPSTest to download time data and improve the time it takes to get a GPS fix.

1 Like

Againg, you were right, thank you ! I should never trust internet; I tried enabling/providers but always kept Mozilla one as there seemed to be some kind of consensus on the web according to it being mandatory. Turns out it was the one messing with my location.
That FOSS device is starting to be usable after all !

2 Likes

I’ve got LineageOS 18.1 running on my phone, together with microG and fdroid + FDroidPrivilegedExtension.

Before building I applied this patch with

patch -p1 -i /home/username/Documents/projects/FP4-lineageos/microgpatches/android_frameworks_base-R.patch

as described here.

Then I included these packages by adding

<project path="vendor/partner_gms" name="lineageos4microg/android_vendor_partner_gms" remote="github" revision="master" />

to my roomservice.xml file.

I also added two environment variables:

export WITH_GMS=true
export CUSTOM_PACKAGES="GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps FDroid FDroidPrivilegedExtension"

Although I’m not sure if the latter is necessary for the build.

MicroG’s self-check reports that everything is fine.

The phone warns me about using test keys (duh).

The only thing that’s different is that the camera looks worse than before - 12MP instead of 48MP and no access to the wide-angle camera. I’m thinking about bundling their camera app as a system app and seeing if it works.

5 Likes

Ok thanks. What does it take to make it an official LOS build downloadable on https://download.lineageos.org? I’m going to ask in the other thread. Thank you @Aaanze for sharing the files and documentation. As I understand it, it will need a fresh installation, when the official LOS comes available because of the signing keys. Is this correct?

I have one question, @Error @hirnsushi maybe you could enlight; I see fairphone deployed a new security patch for FP4 on FPOS.
Are those patches OS specific only or somehow they include some improved driver and therefore should be included whatever the OS.
In the later case how would one “add” it to lineage repo for the purpose of building an OTA file ? Does it only make sense ?

At the moment only the stock Camera of FPOS can access 48MP resolution, so that’s not a bug of your LineageOS build :wink:
You can look up on this forum for similar experience with OpenCamera, GCam, GrapheneOS camera etc.

1 Like

That update can’t be installed on your custom ROM, no.
Someone (more knowledgeable) will have to look at the update and merge changes with the source (if applicable). How you would do it exactly I can’t tell you, that’s definitely outside of the stuff I have messed with before.

1 Like