FP4 and (unofficial) LineageOS

It’s relatively easy. There are even Docker containers, though I never tried those.
It just takes some hours and you need about 250 GB free disk space.

1 Like

Do you have any links? I’ve tried Build for FP4 | LineageOS Wiki together with muppets.md · GitHub but I keep encountering this issue:

repo sync has finished successfully.
icterid$ source build/envsetup.sh
icterid$ breakfast FP4
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "lineage_FP4".
21:50:03 dumpvars failed with: exit status 1
/usr/bin/env: 'python': No such file or directory
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "lineage_FP4".
21:50:04 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "lineage_FP4".
21:50:04 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_FP4'
** Do you have the right repo manifest?
1 Like

I followed the instructions at:

Just change everything accordingly to the FP4 and change the WeAreFairphone repos to the now existing LOS repos.

I think this was my last roomservice.xml (still with WeAreFairphone), but I didn’t build for about three months, so not a hundred percent sure:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="WeAreFairphone/android_device_fairphone_FP4" path="device/fairphone/FP4" revision="staging/lineage-19.1" remote="github" />
  <project name="WeAreFairphone/android_kernel_fairphone_sm7225" path="kernel/fairphone/sm7225" revision="staging/lineage-19.1" remote="github" />
  <project name="FairBlobs/proprietary_vendor_fairphone" path="vendor/fairphone/FP4" revision="staging/lineage-19.1" remote="github" />
  <remove-project name="LineageOS/android_hardware_qcom_display"/>
  <project name="LineageOS/android_hardware_qcom_display" path="hardware/qcom-caf/sm8250/display" remote="github" revision="lineage-19.1-caf-sm8250"/>
  <project name="LineageOS/android_external_bson" path="external/bson" remote="github" />
  <project path="vendor/partner_gms" name="lineageos4microg/android_vendor_partner_gms" remote="github" revision="master" />
</manifest>
2 Likes

Sorry for the question, but if i have the previous build of mmustermann, then should i only sideload the current build?

Hey, I built myself a LineageOS + microg image (used GitHub - lineageos4microg/docker-lineage-cicd: Docker microservice for LineageOS Continuous Integration and Continous Deployment & thanks to max_o I know what manifest to use for the correct proprietary files).
Now I’m unsure if I can flash it without risk due to I currently have /e/ OS with Android Security Patches up to 2022-07-05 installed and don’t want a bricked phone due to the anti rollback mechanism. (I don’t care about losing data.) Does anyone know how I can lookup which security patches my LineageOS build includes (without flashing it)? Or does anyone know if it save to just try it?

(If my build runs fine for me, I can upload it to my server and even provide OTA updates until official builds are available.)

1 Like

Quick answer: don’t relock the bootloader! :smiley:
AFAIK bricking is only happening when relocking (flag set to 0 and anti-rollback)

3 Likes

This is great news for me, I’m would also like to use a linageos+microg build, but so far didn’t tried to build it myself (As a consequence, my FP4 is still unused at the moment). It would be really awesome if you could share your build until there are official ones!

Thanks for the pointer to NeoBackup. I have used its predecessor oandbackup so far, but the ability to do batch backups was a good reason to switch over.

As for rooting, well, with an unofficial LOS build I am already messing with stuff that could set my house on fire, get my cat pregnant and whatnot. Magisk is one of my lesser worries; at least it has worked well on my OnePlus One with official LOS18. (The post you linked seems to focus primarily on the stock OS.)

I switched to the FP4 today. NeoBackup did a lot of the heavy lifting for me, but some things need to be done manually:

  • NeoBackup has issues restoring apps which were first installed on ~Android 5 and before, as the APK path differs. (This will be fixed in the upcoming version, thanks to the NeoBackup team, who were really quick to respond to my bug report.) As a workaround, restore the missing APKs from the backup dir, then restore data with NeoBackup in the usual way. You may need to reconfigure permissions for these apps.
  • Since I also migrated to a new Android version (11 to 12), migrating data for system apps did not work for all apps. For some it did, for the others I had no choice but set everything manually.
  • In particular, text messages and call history did not get migrated. SMS Backup/Restore (available on F-Droid) did the trick for me. (Contacts might be the same, if you store them locally.)
  • Some user apps need extra steps to migrate data:
    • DAVx⁵: accounts need to be set up from scratch, then recreated.
    • OpenVPN: profile needs to be set up (or re-imported) from scratch
    • Signal: delete app data, then transfer the account from the old device
    • Syncthing will identify itself as the old device. If you want to use both devices in parallel, you will need to delete app data, then set up sync from scratch
  • The Terminal app, which could be enabled from Developer Settings in LOS18, is no longer available in LOS19. Terminal Emulator for Android (available on F-Droid) is a suitable replacement. UX is so similar you will hardly feel a difference.
4 Likes

Didnt point you to the rooting thread to highlight the risks, but to make you aware about the “how to” as you used the deprecated .zip way…and even if the thread was initially created before any Custom ROM existed and therefore mainly is about FPOS, the “how to” does not change…

1 Like

I might have found one thing that does not work the way it should: I got a third-party USB-C audio adapter and plugged it in, but the phone still happily plays audio over its speakers, ignoring the external headphones altogether.

As far as Wikipedia is concerned, such devices use a special USB-C mode where analog audio is transferred over the USB data pins. Somehow this does not work for my phone+OS+adapter combination. Either the there is something wrong with the adapter, or the OS fails to detect it and switch over to Audio Adapter Accessory mode.

Has anyone else tried using an analog audio adapter with the FP4 running LOS? Does it work for you?

As far as I know, the FP4 does not support a direct analog mode via USB-C, but needs a DAC included in the adapter. Which one do you use?

2 Likes

The adapoter is a Hoco LS19.

The description does not mention whether it is a direct analog adapter or has a DAC. However, a USB device monitor on the device does not find any devices, nor does lsusb when I plug the device into my laptop. (Whereas I suspect a device with a built-in DAC would be a regular USB device, correct?)

Edit: just checked, and the original Fairphone adapter has a DAC built in.

Only thing I could find on the manufacturers homepage is, that a converter with DAC has a badge on the package:
https://hocotech.com/product/phone-accessories/cables/adapters/adapter-type-c-to-3-5mm-ls33-audio-converter/
whereas another one hasn’t:
https://hocotech.com/product/phone-accessories/cables/adapters/adapter-type-c-to-3-5mm-ls30-audio-converter/

Both have the word “digital” in their product name, whereas the LS19 doesn’t. That looks like the LS19 is a passive analog adapter, without a DAC and requiring the phone to support direct analog mode. Which would explain why it doesn’t work, which I just learned the hard way. Thanks for shedding light on this!

1 Like

I have tried using the Docker image, but for some reason it fails without any error message:

$ podman run -it -e "BRANCH_NAME=lineage-19.1" -e "DEVICE_LIST=FP4" -e "SIGN_BUILDS=false" -e "INCLUDE_PROPRIETARY=false" -e "CLEAN_AFTER_BUILD=false" -v "lineage:/srv/src" -v "$(pwd)/zips:/srv/zips" -v "$(pwd)/logs:/srv/logs" -v "$(pwd)/cache:/srv/ccache" -v "$(pwd)/keys:/srv/keys" -v "$(pwd)/manifests:/srv/local_manifests" lineageos4microg/docker-lineage-cicd -e "SIGNATURE_SPOOFING=restricted" -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension"
>> [Thu Sep 29 11:57:25 UTC 2022] Branch:  lineage-19.1
>> [Thu Sep 29 11:57:25 UTC 2022] Devices: FP4,
>> [Thu Sep 29 11:57:25 UTC 2022] (Re)initializing branch repository

I never imagined that building Android/LineageOS would be so tourcherus. The tooling is horrible and the documentation almost useless. My appreciation has increased for all the people who put up with this kind of stuff.

Here is a new build based on lineage-20 (Android 13). I’ve not tested it. Would be cool if someone could try it out and report back here if everything works.

Download

Downloads for : Fairphone Fairphone 4 | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.

sha256sum lineage-20.0-20220929-UNOFFICIAL-FP4.zip recovery-20.0-20220929-UNOFFICIAL-FP4.img 
ad51c7467becfe892701943513eff0d188824884ce9c8bf22c3156198c097fc8  lineage-20.0-20220929-UNOFFICIAL-FP4.zip
28d019a8b8e620ad121f26a77014908fe9e0a7ed7ca7bf7cade706c37109059a  recovery-20.0-20220929-UNOFFICIAL-FP4.img
6 Likes

At first glance it seems to work alright, upgraded from one of your older LOS 19 builds.

3 Likes

It is cool !!!
I flashed it with NikGApps, first i could not because of partition size, but then after the first boot i could install it.
Only minority was that by the setup Seedvault crashed.
But i set up and use it now and works like a charm.
Thousand thanks.

1 Like

Wow that’s great, so basically you just sideloaded the rom on top of LOS 19 without wiping and everything works ?

It should work like most upgrades, just sideload the new build. But don’t forget to reboot to recovery if you are using any of the Gapps-Packages to update them too before you boot to the OS. Otherwise the upgrade process will cause unpredicted errors!