Building LineageOS for FP4

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

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 !


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


Ok thanks. What does it take to make it an official LOS build downloadable on 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

That’s what I thought. Well… guess I’ll have to wait for the qualified people to commit changes on the repo. Though its not been moving much for the last 17 days…

I just built and signed the build using this docker image. Just put this in your manifest file:

<?xml version="1.0" encoding="UTF-8"?>
  <remote name="device" fetch="" revision="lineage-18.1" />
  <remote name="kernel" fetch="" revision="lineage-18.1" />
  <project path="device/fairphone/FP4" name="WeAreFairphone/android_device_fairphone_FP4" remote="device" />
  <project path="kernel/fairphone/sm7225" remote="kernel" name="WeAreFairphone/android_kernel_fairphone_sm7225" />
  <project path="vendor/partner_gms" name="lineageos4microg/android_vendor_partner_gms" remote="github" revision="master" />
  <project path="vendor/fairphone" remote="github" name="USERNAME/proprietary-vendor_fairphone" />

You’ll have to create (or find) a github repo with the proprietary files and replace USERNAME with, well, your username. The repo should look a little like this. Obviously the directory with the blobs should be called FP4 and the repo whatever is in the manifest file, here it’s proprietary-vendor_fairphone.

This build will include microG and fdroid, as well as the privilege extension thingy to make fdroid able to install apps without asking a million times.


Any ideas where I should upload/share the build?


WET, mega

you might want to take a look at



I just uploaded mine on github:

except it’s just the vendor/fairphone/FP4 subtree and not the whole vendor/fairphone, so I guess it needs to be set like this in repo’s config instead:

<project path="vendor/fairphone/FP4" remote="github" name="g4bwy/proprietary-vendor_fairphone_FP4" />

Looks like I found one source of where the 54 LineageOS installations
comming from, when you search for “FP4” at :wink:

I am by now sure LOS will find its way onto my brand new FP4 sooner or later. :smiley: I’ll try to be a patient patient by now.
Have fun!


The fall back Stock ROM is available now Touch wood and have fun trying.

1 Like

I’ll post it here just for cross refs: FP4 and LineageOS - #162 by g4b

btw, this build was made with test keys. I have another one with custom keys, but I’m concerned about migration whenever an official upstream build becomes available, so I didn’t upload it (also signature verification needs to be bypassed when installing from recovery, and I’m not sure how to fix it)

does anyone here have experience with that ? (I found the migration scripts here, but since I can’t test it with an actual official build I’m not yet confident to start using my custom keys as a daily driver…)

So I’ve been playing with my LOS build and so far I’m very happy with it.

Now I’m a bit disappointed because I intended to do greater things with my FP4 one of them implying cifs filesystem support. Which of course is not enabled by default.
I would not mind starting to mess with custom kernels but I honestly have but a blurry idea how to do that.

  1. I’ve browsed a bunch of threads mentioning cifs support and the only thing valuable I found was

    • add “CONFIG_CIFS=m” in some obscur configuration file named “defconfig” ? I looked at the kernel sources tree and could not find such file
    • I need to incorporate modules md4.ko and cifs.ko to the build. Here again I understood those modules have to be built in a device specific way that I could not figure out
  2. In the event I solved 1. I’d still I need to figure out how to build ONLY the LOS kernel. I mean I could get it by building the entire room but it seems a bit disproportionate.

Anyone here has some knowledge on custom kernel building/patching to share ?