Building LineageOS for FP4

Yeah yeah that’s why I deleted my answer but you were too fast.
I’m sorry, told you I would be a pain.

ALRIGHT ! It’s brunching !

Thanks a lot for you patience, I learned a few things today.
Will let you know once/if its successfully built and I have flashed my device with this experimental thing :smiley:

1 Like

Awesome, I hope you had fun! You can find more information about LineageOS in the wiki here and how to contribute here should you want to in the future.


Alright so it seems I ran into what could be a memory issue ?

[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/
FAILED: out/soong/
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/ -globFile out/soong/.bootstrap/ -o out/soong/ Android.bp
16:30:13 soong bootstrap failed with: exit status 1

Tried to use:

make -j1


make -j2

Without any more succes. Maybe the fact that I’m trying to build from a WSL system is somehow limitating ?
Anyway, it’s not an issue that is device nor code dependant so I will dig this myself :slight_smile:

Not sure if it’s memory or something else, the error message isn’t exactly verbose. Keep in mind however that a full build might take up to 200-250GB of space on your disk.

I have that space on my SSD, that’s not the issue.

I have kind of the second error described in the first post of this topic

But the solution given doesn’t change anything. This seem to be kind of a specific issue

From what I read, it doesn’t seem easy to build from WSL, my best shot is to install a full linux distro on some computer and start all over again

How much RAM is available to your VM? :thinking: So far all similar reports seem to indicate some sort of OOM situation.
Could you check free -th under WSL and if it is wildly different from your physical RAM maybe try to reconfigure it (Microsoft Docs / WSL fixes).

I would help you reproduce it, but I really don’t want to boot into Windows, haven’t got all night to wait for updates to finish :smirk:


My man !

I read somewhere that WSL2 was automatically using ALL available memory.
Which ended up false because as a matter of fact your command only showed 7.5GB available memory.
Changed it to 16GB which is my total amount of ram on my computer, and so far it’s still building, though this greedy thing is taking 100% of what I gave it, would not be surprised if it crashed soon anyway. Didn’t know building rom was requiring so much ram !

Edit: 21% and still building, this might work after all !


Build succeeded !
Now I just have to find the right moment to flash it and mess everything up. Will of course update.

Thanks again


Do let us know how badly you messed up after the flash! :boom:

1 Like

Hello! It’s awesome that you wrote those easy instructions for building LOS yourself, as I’m unfamiliar with the process too it could be really useful for me in the future. :smiley:

Only thing that prevent me from trying it right now is the available space, I currently have around 100Go available on my linux laptop so I’ll need to free up space first :wink:


You also need a pretty decent CPU it appears.
I set up a full linux on my tiny Onemix 3S laptop (which has a 500GB SSD and 16GB RAM) and followed all the steps all over again to get a better grip at those, and it’s been building for the last 15 hours (only reach 75% so far) :smiley:

BTW I’m about to flash my device in the next few minutes, stay tuned if your into catastraphic events.

Alright: first attempt failed, it seems that flashing the recovery generated by the build did not… change the recovery ? I’m still getting greeted by stock recovery hence, unable to bypass signature verification

Edit: Was able to run lineage recovery with fastboot boot recovery.img

Edit2: I booted into Lineage !

So far so good. Though I have very minimal services installed.
Will try and get microG setup as I couldn’t flash openGapps pico apparently because of system partition too small. Kind of a deal breaker to me as I still need minimal google services, mostly maps


I couldn’t flash openGapps pico apparently because of system partition too small.

Do you still remember the exact error you got?

Halas no… I’m now struggling with my next mess: I naively tried to flash magisk via lineage recovery and ended up in a bootloop. I will therefore wipe everything all over again and let you know about the message I get when I go to gapps phase.

I would gladly hear some tricks about efficently going to fastboot/recovery/bootloader when device wont boot to OS and bootloader unlocked warning seems to somehow mess with the vol down + power combination.
I mean I’m pressing the vol down + power buttons and no matter what it either tries to boot and get stuck on Fairphone logo, or shutdowns. I managed to get to it earlier but don’t quite understand how I did it.
@hirnsushi an idea ? :smiley:

Edit: Finally got into recovery with a random 3 buttons simultaneously press after lgoo or something…

@Error here are the logs I get when trying to flash Open gapps pico:
First I got those errors:

E: open failed /metadata/ota: no such file or directory
E; couldn’t open mount Metadata

Then installer runs and after “performing calculation”:

Insufficient sotarge space in System partition. You may want to use smaller Open Open Gapps package or consider removing some apps blahblahbla…

That’s really weird, opengapps pico being the smallest variant should definitely have enough space. Are you able to boot into LineageOS again? If so, enable debugging, enter adb shell on your pc and then enter df to see how much space is used by the various partitions.

1 Like

yeah that what I thought too… usually works on other devices…

Here’s the df outout:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/dm-5 1222628 993036 213208 83% /
tmpfs 2805200 1268 2803932 1% /dev
tmpfs 2805200 0 2805200 0% /mnt
/dev/block/dm-6 445412 214716 221788 50% /system_ext
/dev/block/dm-7 585288 354588 218992 62% /product
/dev/block/dm-8 597452 366112 219384 63% /vendor
/dev/block/dm-9 232328 1084 226600 1% /odm
tmpfs 2805200 0 2805200 0% /apex
/dev/block/dm-10 107795640 1972480 105692088 2% /data
/dev/block/loop6 3940 3912 0 100% /apex/
/dev/block/loop7 848 820 12 99% /apex/
/dev/block/loop8 2400 2368 0 100% /apex/
/dev/block/loop9 5132 5096 0 100% /apex/
/dev/block/loop10 8836 8808 0 100% /apex/
/dev/block/loop11 876 848 12 99% /apex/
/dev/block/loop12 131428 127768 1028 100% /apex/
/dev/block/loop13 6532 6500 0 100% /apex/
/dev/block/loop14 18824 18796 0 100% /apex/
/dev/block/loop15 4688 4660 0 100% /apex/
/dev/block/loop16 1688 1660 0 100% /apex/
/dev/block/loop17 5660 5632 0 100% /apex/
/dev/block/loop18 336 304 28 92% /apex/
/dev/block/loop19 524 496 20 97% /apex/
/dev/block/loop20 232 92 136 41% /apex/
/dev/block/loop21 7764 7736 0 100% /apex/
/dev/block/loop22 83736 83708 0 100% /apex/
/dev/block/loop23 4712 4684 0 100% /apex/
/dev/block/loop24 4896 4868 0 100% /apex/
/dev/block/loop25 24648 24616 0 100% /apex/
/dev/block/loop26 3936 3908 0 100% /apex/
/dev/fuse 107795640 1972480 105692088 2% /storage/emulated

Funny enough googling for the error led me to another thread in the Fairphone forum:

Do we know if the device is encrypted by default? And do we know if lineage recovery can deal with that? :thinking:

Edit: It seems to me, /metadata is missing. If I compare your partitions to mine on vanilla, it should be mounted somewhere, huh, weird…

And… what is this partition used for ? Weirdly it doesn’t seem to prevent the device to run properly… so far…

On another matter, I managed to root the device which is great.

1 Like

OK, I found this info in the docs:

metadata partition. This partition is used when device is encrypted. The size is 16 MB or larger.

Could you check adb shell 'getprop ro.crypto.state' :thinking:

Well it returns “encrypted”