mstaz / backup_android_device_fairphone_fp3

Android / LineageOS 16 device tree for Fairphone 3
4 stars 0 forks source link

Device configuration for Fairphone 3

Device specifications

Basic Spec Sheet
CPU Octa-core 1.8 GHz Cortex-A53
CHIPSET Qualcomm SDM632 Snapdragon 632
GPU Adreno 506
Memory 4GB
Shipped Android Version 9.0 (Pie)
Internal Storage 64GB
microSD Up to 400GB (dedicated slot)
Battery 3000 mAh
Dimensions 158 x 71.8 x 9.89 mm
Display 2160 x 1080 pixels, 5.65-inch IPS LCD
Rear Camera 12 MP (f/1.8, 1/2.55", PDAF)
Front Camera 8 MP (f/2.0, 1/4", HDR)

Introduction

This is my first draft to build LineageOS 16 for the Fairphone 3. It's also my first time building LineageOS and it's been a while I last worked on Android platform development. So please forgive me any major mistakes :blush:

I started with the base configuration of Motorola's SDM632 platform and used the river configuration as an example. Not sure if that makes sense but at least it's the same chipset.

Also I took some settings and the kernel from k4y0z's amazing work for porting TWRP to Fairphone 3:

Current Status

Known Issues

These things are untested or known not to work:

Kernel Source

Based on repository from k4y0z: https://github.com/chaosmaster/android_kernel_fairphone_sdm632

Added the qcom specific audio-kernel stuff in techpack/audio.

Also I read the kernel config from the stock firmware as base.

Find my fork here: https://github.com/mstaz/android_kernel_fairphone_sdm632

How to compile

How to flash

First both slots need to have success state. See HOW TO for flashing GSI images for that.

Flashing the package with TWRP seems to cause some problems yet.

So far I flash the images with fastboot. system.img is not copied to output root folder so I take it from the packaging subfolder.

fastboot flash system out/target/product/fp3/obj/PACKAGING/target_files_intermediates/lineage_fp3-target_files-eng.ms/IMAGES/system.img
fastboot flash vendor out/target/product/fp3/vendor.img
fastboot flash product out/target/product/fp3/product.img
fastboot flash boot out/target/product/fp3/boot.img
fastboot flash dtbo out/target/product/fp3/dtbo.img

Boot into TWRP and disable verity:

adb disable-verity

Unfortunately sometimes for some reason AVB immediately switches back to the other slot and prevents it from booting. Booting any image (even TWRP) failes with following message:

Downloading 'boot.img'
OKAY [  1.006s]
booting
FAILED (status read failed (No such device))
Finished. Total time: 7.387s

Slot is switched to the other one then. Maybe it's connected to rollback protection. However I'm not sure yet how this can be solved. Sometimes re-flashing vbmeta images worked. Sometimes I needed to completely flash stock back to both slots and get them successfully booted first. Sometimes even that doesn't work immediately.