Porting LineageOS to FP2

I was able to build with @chrmhoffmann’s sources using the following local manifest file:

.repo/local_manifests/fp2.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <remote fetch="https://github.com/" name="github2" />
    <project name="chrmhoffmann/android_device_fairphone_FP2" path="device/fairphone/FP2" remote="github2" revision="cm-14.1" />
    <project name="chrmhoffmann/android_kernel_fairphone_msm8974" path="kernel/fairphone/msm8974" remote="github2" revision="cm-14.1" />
    <project name="chrmhoffmann/proprietary_vendor_fairphone" path="vendor/fairphone/FP2" remote="github2" revision="cm-14.1" />
</manifest>

Edit: Regarding device encryption, might also be a general Lineage OS bug. I will try out the workaround (with FP Open OS) and report back.

2 Likes

I would also love to compile my own Lineage OS :smiley:

Can you provide some basic instructions for what you did?

So far I have been following this guide.

Can you point me to what I need to change to make it work with @chrmhoffmann 's changes? (How to create the local_manifests and to include it in the build and other stuff…)

Just follow any build guide from the Lineage OS wiki, for example this one.

Follow it until “Download the source code”. Then, in android/lineage/ create a new directory:
mkdir .repo/local_manifests

Inside that directory, create the fp2.xml file with vi or nano:
vi .repo/local_manifests/fp2.xml
And paste the content from my previous post inside that file.

After that, resync your source code:
repo sync -c -j8

Finally, build the image by running the following:
source buid/envsetup.sh
breakfast FP2
brunch FP2

Depending on your computer, this might take a while :wink:

6 Likes

FYI, the workaround did not work for me.

I’d suggest using this Docker image, which has a reputation to work pretty well, and solves a lot of environment problems. Only problem I had with that was my refurbished server overheating, absolutely non-related with the Docker image.

If anyone choose to go with this route, don’t hesitate to contact me! I can help to setup the thing for the FP2 (pretty much the directions given by @jnsp above, but skipping the environment setup).

1 Like

6 posts were split to a new topic: Will Lineage OS be officially supported?

Confirming Dual SIM works without problems until now together with the latest FP OS modem files.

You can easily install them with this zip: Using LineageOS on the FP2

1 Like

Does the follwowing work for you?

  • Changing the 4G SIM to, let’s say 3G, and then back to 4G
  • Switch 4G SIM to 2G and 2G SIM to 4G and back again

You might want to backup your data partition via TWRP beforehand, in order to go back if you’re stuck on 3G (or can’t reenable 4G on one SIM).

EDIT: Can we make this a wiki post and update the top post regarding what is working, what is not working, which bugs are present and where to download the latest build/source code?

2 Likes

Going to test this in the weekend! Will gather other bugs in the meantime.

About the wiki: good idea! A centralized place to build / host the souce / zip’s is also being discussed here:
https://github.com/WeAreFairphone/android_device_fairphone_fp2/issues/13

2 Likes

For some people this isn’t working in regular Fairphone OS at the moment, so it’ll be interesting to see if it does work in Lineage. If, however, it doesn’t work on Lineage either, maybe the same work-around helps:

I agree, this is a good idea to get more oversight, so I allowed myself to do that.

4 Likes

Thanks, I have updated the top post. The original post is now in a spoiler at the bottom of the post.

I am not sure if we should provide installation instructions, or if those kind of things are better kept in the “Using LineageOS” thread.

Feel free to edit, it’s a wiki! :slight_smile:

Edit: Regarding the modem firmware, I’m happy to update my flashable zip whenever a new modem firmware version comes out. However, Fairphone could support the custom ROM development by providing an official flashable zip with the latest modem firmware (without /system and /boot) at code.fairphone.com.

6 Likes

Great work! The only thing I’m missing is a type of versioning. Is it maybe a idea to call this version 1.0 and work from there? Then people will know when to flash.

1 Like

I also needed to add the following dependency to my local manifest:
<project name="lineageos/android_device_qcom_common" path="device/qcom/common" remote="github2" revision="cm-14.1" />

Else I got the error:
ninja: error: '/var/android/out/host/linux-x86/bin/dtbToolCM', needed by '/var/android/out/target/product/FP2/dt.img', missing and no known rule to make it build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed

The files I am using:
.repo/local_manifests/fp2.xml:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote fetch="https://github.com/" name="github2" />
  <project name="chrmhoffmann/android_device_fairphone_FP2" path="device/fairphone/FP2" remote="github2" revision="cm-14.1" />
  <project name="chrmhoffmann/android_kernel_fairphone_msm8974" path="kernel/fairphone/msm8974" remote="github2" revision="cm-14.1" />
  <project name="chrmhoffmann/proprietary_vendor_fairphone" path="vendor/fairphone/FP2" remote="github2" revision="cm-14.1" />
</manifest>

docker-manual-lineageos-14.1.sh:

#!/bin/bash

echo """
RUN
export USE_CCACHE=1
export CCACHE_DIR=/var/ccache
export USER=\$(whoami)
export WITH_SU=true

source build/envsetup.sh

breakfast FP2 eng
mka bacon
# or
mka bootimage
"""

DOCKER_IMAGE="z3ntu/android-n-build-env"
MOUNTS="-v /mnt/1tb/lineageos-14.1/:/var/android -v /mnt/500gb/ccache/:/var/ccache/"

echo "Pulling down docker image."
sudo docker pull $DOCKER_IMAGE

sudo docker run --rm --net=host $MOUNTS -i -t $DOCKER_IMAGE /bin/bash

You can leave out the ccache stuff if you want

1 Like

Hi, first of all, thanks for the great work and showing that an alternative OS works on the FP2.
On the weekend I installed your lineageos version on my FP2 expecting some troubles, but against my expectations I didn’t run into much troubles.
The installation process was straight forward and worked very well.

I’m very happy now, to have a nearly actual android based system on my FP2, what is providing more flexiblity according to managing app restrictions and providing more time using my FP2 until it needs to be connected to a charger again.

Two things are NOT working for me until now:

  1. Using apps like ControlDNLA or DroidUPNP (or naim app to manage a naim device like muso) to control a UPNP device does not work. From my point of view there is no UPNP support implemented/activated at all?!
  2. When charging my FP2 there is no LED indication at all. Possibly I didn’t find the necessary configuration yet. (The LED works pretty well e.g. as notification for a new email or an alarm.)

Thank you

I can confirm 2.
I don’t know if it’s a matter of configuration or a bug.

Something broke my camera… I last used it on Saturday where it worked… (btw reboot doesn’t help)

05-30 08:23:25.131   303  3047 D QCamera2HWI: [KPI Perf] int qcamera::QCamera2HardwareInterface::openCamera(hw_device_t**): E PROFILE_OPEN_CAMERA camera id 0
05-30 08:23:25.131   303  3047 E mm-camera-intf: mm_camera_open: dev name = /dev/video1, cam_idx = 1
05-30 08:23:25.132   307   307 E mm-camera: server_process_bind_hal_ds:112: Error in bind socket_fd=11 Address already in use 
05-30 08:23:25.132   307   307 E mm-camera: main: New session [1] creation failed with error
05-30 08:23:25.132   303  3047 E mm-camera-intf: mm_camera_open:  opened, break out while loop
05-30 08:23:25.132   303  3047 E mm-camera-intf: mm_camera_open: cannot open control fd of '/dev/video1' (Bad address)
05-30 08:23:25.132   303  3047 E mm-camera-intf: camera_open: mm_camera_open err = -1
05-30 08:23:25.132   303  3047 E QCamera2HWI: camera_open failed.
05-30 08:23:25.135   303  3047 E CameraFlashlight: Could not open camera 0: -19
05-30 08:23:25.135   303  3047 E CameraClient: initialize: Camera 0: unable to initialize device: No such device (-19)
05-30 08:23:25.135   303  3047 E CameraService: connectHelper: Could not initialize client from HAL module.
05-30 08:23:25.137  3266  3266 E CarrierConfigLoader: Cannot save config with null packageName or iccid.
05-30 08:23:25.147   303  3047 E CameraService: initializeShimMetadata: Error initializing shim metadata: Status(-8): '10: connectHelper:946: Failed to initialize camera "0": No such device (-19)'
05-30 08:23:25.161   303  2388 E CameraService: getCameraPriorityFromProcState: Received invalid process state -1 from ActivityManagerService!
05-30 08:23:25.215   303  2388 D QCamera2HWI: [KPI Perf] int qcamera::QCamera2HardwareInterface::openCamera(hw_device_t**): E PROFILE_OPEN_CAMERA camera id 0
05-30 08:23:25.215   303  2388 E mm-camera-intf: mm_camera_open: dev name = /dev/video1, cam_idx = 1
05-30 08:23:25.215   307   307 E mm-camera: server_process_bind_hal_ds:112: Error in bind socket_fd=11 Address already in use 
05-30 08:23:25.215   307   307 E mm-camera: main: New session [1] creation failed with error
05-30 08:23:25.216   303  2388 E mm-camera-intf: mm_camera_open:  opened, break out while loop
05-30 08:23:25.216   303  2388 E mm-camera-intf: mm_camera_open: cannot open control fd of '/dev/video1' (Bad address)
05-30 08:23:25.216   303  2388 E mm-camera-intf: camera_open: mm_camera_open err = -1
05-30 08:23:25.216   303  2388 E QCamera2HWI: camera_open failed.
05-30 08:23:25.216   303  2388 E CameraFlashlight: Could not open camera 0: -19
05-30 08:23:25.216   303  2388 E CameraClient: initialize: Camera 0: unable to initialize device: No such device (-19)
05-30 08:23:25.216   303  2388 E CameraService: connectHelper: Could not initialize client from HAL module.
05-30 08:23:25.222   303  2388 E CameraService: initializeShimMetadata: Error initializing shim metadata: Status(-8): '10: connectHelper:946: Failed to initialize camera "0": No such device (-19)'
05-30 08:23:25.222  5310  5310 E CAM_Util: exception trying to get camera characteristics
05-30 08:23:25.279   303  5422 E CameraService: connectLegacy: Camera HAL module version 100 too old for connectLegacy!
05-30 08:23:25.360   303  5423 D QCamera2HWI: [KPI Perf] int qcamera::QCamera2HardwareInterface::openCamera(hw_device_t**): E PROFILE_OPEN_CAMERA camera id 0
05-30 08:23:25.360   303  5423 E mm-camera-intf: mm_camera_open: dev name = /dev/video1, cam_idx = 1
05-30 08:23:25.361   307   307 E mm-camera: server_process_bind_hal_ds:112: Error in bind socket_fd=11 Address already in use 
05-30 08:23:25.361   307   307 E mm-camera: main: New session [1] creation failed with error
05-30 08:23:25.361   303  5423 E mm-camera-intf: mm_camera_open:  opened, break out while loop
05-30 08:23:25.361   303  5423 E mm-camera-intf: mm_camera_open: cannot open control fd of '/dev/video1' (Bad address)
05-30 08:23:25.361   303  5423 E mm-camera-intf: camera_open: mm_camera_open err = -1
05-30 08:23:25.361   303  5423 E QCamera2HWI: camera_open failed.
05-30 08:23:25.364   303  5423 E CameraFlashlight: Could not open camera 0: -19
05-30 08:23:25.364   303  5423 E CameraClient: initialize: Camera 0: unable to initialize device: No such device (-19)
05-30 08:23:25.364   303  5423 E CameraService: connectHelper: Could not initialize client from HAL module.
05-30 08:23:25.376  5310  6349 E CameraHolder: fail to connect Camera:-1, aborting.
05-30 08:23:25.376  5310  6349 E CAM_PhotoModule: Failed to open camera:0

actually, a non-working LED while charging would be a feature here. I don’t want my phone to shine while lying next to my bed at night.

I put a box of matches on it, does the job perfectly :wink: .

3 Likes