Personally i do not have a FP5 (yet) as i am waiting for a LineageOS build. I would give it a try myself if anyone has a thorough guide on how to port LineageOS to a Fairphone?!
@ochorocho: ok great and good luck looking forward to a working LineageOS image. @yvmuell: thanks for the links, i will see what i can find in there
One question: Is there an official image from Fairphone that can be flashed to get back to a working state if flashing a custom build image fails?
Update (answering my own question): Here is the official FP5 image for download with installation instructions https://support.fairphone.com/hc/en-us/articles/18896094650513
@ochorocho Would you be open to sharing how you build your image? I tried using the LineageOS FP4 build instructions and the XML you shared as roomservice.xml, but the build command brunch FP5 fails (most likely during the kernel build). This is the last output i get:
INSTALL techpack/display/msm/msm_drm.ko
DEPMOD 5.4.242-qgki-g82801cb08268
make[1]: Leaving directory '/root/android/lineage/out/target/product/FP5/obj/KERNEL_OBJ'
make: Leaving directory '/root/android/lineage/kernel/fairphone/qcm6490'
depmod: WARNING: could not open modules.order at /root/android/lineage/out/target/product/FP5/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.builtin at /root/android/lineage/out/target/product/FP5/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.order at /root/android/lineage/out/target/product/FP5/obj/PACKAGING/depmod_vendor_ramdisk_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.builtin at /root/android/lineage/out/target/product/FP5/obj/PACKAGING/depmod_vendor_ramdisk_intermediates/lib/modules/0.0: No such file or directory
00:15:57 ninja failed with: exit status 1
I want to write simple build instructions once i get a working build so maybe others can join and help make a working image.
Mind the ccache -M 100G ! 50GB was not enough in my case.
INFO:
I also tried to extract the binary blob using cd device/fairphone/FP5/ && ./extract-files.sh
with the device connected and USB debugging enabled. But this build did not work.
I compared the files and it seems like it is not required because the files are already there, and the extract-files script fails to download all files anyways.
I hope this helps.
Iām not sure if this is all a 100% correct as Iām not an expert.
Thank you! I will try to build using these settings.
One more question: Which distro + version did you use to build this (Ubuntu 22.04, debian 12, ā¦)?
About the binary blobs: The āproprietary_vencor_fairphone_FP5ā repo seems to have the blobs so i guess extracting them is not neccessary as you mentioned.
You added the āsm7225ā kernel to the xml, i was wondering about that since the āandroid_device_fairphone_FP5ā repo has an open pull-request which changes the used kernel for the build to āqcm6490ā.
Did you manage to boot your image yet, maybe a build using the qcm6490 kernel will work better on the FP5, what do you think?
Sorry, missed that part.
Didnāt try to use qcm6490 kernel yet.
When trying to install i get kinstalldeviceopenerror when using TWRP and Signature verification failed without TWRP (regular recovery)
For sake of information, was able to flash the rom after installing e/OS.
The build with sm7225 and qcm6490 both do not boot. Currently stuck at LineageOS boot animation.
as promised here is my build guide and what i found out along the way:
disclaimer: i did not flash the output of my build to a phone as i do not have an FP5, the primary goal was to get the build to run
the guide was made on ubuntu 22.04 LTS, ubuntu is also used in the android docs so i went with it.
if you build this on another distribution, please report back if you did something different
the machine you use for building must be āamd64ā, i tried building on āarm64ā but it did not work (there are prebuild binaries used for the build and they are compiled only for amd64). if you get this to run on arm64 please tell me how to do this
build as normal user (non root), you only need root for the first step (and the optional second step). after that you can run the whole build as a non-privileged user
have fun and please report back if you find any errors or have more information on what goes on during the build. we would like to understand more about how android / LineageOS is build
# 1. bring your system up to date und install needed packages
# (this needs root privileges, add 'sudo' if necessary)
apt update
apt upgrade --yes
apt install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32readline-dev lib32z1-dev lib32ncurses5-dev libncurses5 libncurses5-dev libelf-dev liblz4-tool libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush python-is-python3 rsync schedtool squashfs-tools unzip wget xsltproc zip zlib1g-dev --yes
# 2. [optional] create a separate builduser
# skip this step if you want to use your already existing user
adduser builduser
su builduser
# 3. install 'adb' and 'fastboot'
# as far as i can tell not strictly necessary for building but used later to flashing the image to a device
cd ~
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip -d ~
cat >> ~/.profile << EOF
if [ -d "\$HOME/platform-tools" ] ; then
PATH="\$HOME/platform-tools:\$PATH"
fi
EOF
# 4. get the repo tool
# used for syncing all the source files to yor build machine
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
# 5. source this file so the $HOME/bin and $HOME/platform-tools folders will be searched for binaries
source ~/.profile
# 6. set your git info (if you want to commit changes to official repos, add your real user and mail here)
git config --global user.email "null@null.com"
git config --global user.name "null"
git lfs install
# 7. get the LineageOS repo
mkdir -p ~/android/lineage
cd ~/android/lineage
# the repo contains information about all the other software repos that are needed to build LineageOS
# uses 'lineage-20.0' branch
repo init -u https://github.com/LineageOS/android.git -b lineage-20.0 --git-lfs
# 8. sync all the source code to your build machine
# this takes some time (depending on your machine and internet connection)
# took me 30min to >60min on the machines i tested it
# also uses ~160GB on disk after it finishes
repo sync
# 9. create the FP5 config file
# since the FP5 is not an official LineageOS target yet, you need to add the config where to find kernel and device info etc.
cd ~/android/lineage
mkdir -p ~/android/lineage/.repo/local_manifests
# option 1: (choose this when getting started)
cat >> ~/android/lineage/.repo/local_manifests/roomservice.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="WeAreFairphone/android_device_fairphone_FP5" path="device/fairphone/FP5" remote="github" revision="staging/lineage-20" />
<project name="BLeQuerrec/proprietary_vendor_fairphone_FP5" path="vendor/fairphone/FP5" remote="github" revision="lineage-20" />
<project name="WeAreFairphone/android_kernel_fairphone_qcm6490" path="kernel/fairphone/qcm6490" remote="github" revision="staging/lineage-20" />
</manifest>
EOF
# option 2: uses the same XML as above but change the first project entry to: name="zalox/android_device_fairphone_FP5"
# see the open pull-request for the changes between the repos. once these changed in github are merged, just use the XML from above
# if unsure use option 1 to get started
# 10. source this to get the android build environment commands
source build/envsetup.sh
# 11. enable ccache to speed-up subsequent builds
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 100G
# 12. prepare build environment
# from the docs: Breakfast configures your build environment with the correct variables to create your device-specific rom
# this took me ~5min and used another 3GB on disk
breakfast FP5
# 13. change directory to the top of the tree
croot
# 14. build your image
# this took me about 4h on a Core-i7 with 4+4 CPU cores
# after it finished the total size used for the ~/android/lineage directory was ~280GB
# it's possible during the build more disk space is used so plan accordingly
brunch FP5
# 15. look at the generated files
# i did not flash this to a phone! use at your own risk
# for flashing maybe look at the LineageOS FP4 instructions!?
# and plase report back if you got an image to boot on an FP5
cd $OUT
thanks to @ochorocho for the XML and all the tips so far to get this working
I am trying to replicate what @ochorocho and @chris81 have done, but on Debian 12 (Bookworm) instead of Ubuntu 22.04 LTS.
The differences for now (if anyone on Debian also wants to replicate) which I have found:
git lfs install failed ā apt install git-lfs instead (okay, this could happened because I didnāt really followed @chris81 guide step by step and probably did not begin with apt install ... )
repo init ... failed due to not finding a python binary ā add ln -s /usr/bin/python3 ~/bin/python and then repo init ... works
when running brunch FP5 there was an error that ~/.cache/ccache/tmp isnāt a directory. The reason was, that ~/.cache/ccache was created as a file and not a directory (donāt know why)ā¦ deleting the ccache file and creating ~/.cache/ccache/tmp as a folder structure and rerunning brunch FP5 seemed to work
One question thoā¦ Shouldnāt a working LineageOS be āpretty easyā, since /e/OS as LOS-downstream already is supporting FP5?
Add/Edit:
The build finished with the following line: #### build completed successfully (01:17:40 (hh:mm:ss)) ####
The āapt installā in 1. of the guide contains āgit-lfsā and āpython-is-python3ā which should already have installed the git lfs subcommand and set python3 as the default python version. I tested this on a fresh debian install so this might not work if you already had git oder maybe python2 installed.
when running brunch FP5 there was an error that ~/.cache/ccache/tmp isnāt a directory.
I got that error too (sometimes). On my final build run it did not occur so i left it out of the guide. Your explanation is exactly what i did so i hope it will help others, too.
One question thoā¦ Shouldnāt a working LineageOS be āpretty easyā, since /e/OS as LOS-downstream already is supporting FP5?
I am hoping the same but did not have time to look how /e/OS is being built and what sources they use. If their base is the same lineage-20.0 branch then we should hopefully figure out what changes they made to their sources so we can also built a working image.
@_elpato_9 Do you have an FP5 device to test your image?