This is a port for the Fairphone 3.
There are two ways:
- the GSI (Generic System Image)-way
- the "native FP3"-way, I call it the Gitlab-CI way. The boot and system images are (currently) getting built by the Gitlab CI.
In the future, this will be the way, to install it by the ubports-installer and also get ota-updates working.
Sources
- Kernel: https://github.com/luksus42/android_kernel_fairphone_sdm632
- Device: https://github.com/luksus42/android_device_fairphone_FP3
- Vendor: https://github.com/luksus42/proprietary_vendor_fairphone
- Manifest: https://github.com/luksus42/halium-devices/blob/halium-9.0/manifests/fairphone_FP3.xml
- Erfan's GSI: https://build.lolinet.com/file/halium/GSI/
- Gitlab CI Builds: https://gitlab.com/ubports/community-ports/android9/fairphone-3/fairphone-fp3/-/pipelines
Status
GSI GITLAB CI Actors: Manual brightness Working Working Actors: Vibration Working Not working Actors: Notification LED Not working Working Actors: Torchlight Working with additional steps: use uTorch App Working with additional steps: use uTorch App Camera: Photo Working Working Camera: Video** Working Working Camera: Switch between back and front camera Working Working Camera: Flashlight Working Working Cellular: Data connection Working Working Cellular: Carrier info, signal strength Working Working Cellular: Incoming, outgoing calls Working Working with additional steps: a data connection must be active (mobile or wifi) Cellular: PIN unlock Working Working Cellular: Voice in calls Working Working Cellular: MMS in, out Not tested Not tested Cellular: SMS in, out Working Working Cellular: Change audio routings Working Working Endurance: Battery lifetime > 24h from 100% Working Working Endurance: No reboot needed for 1 week Not tested Not tested GPU: Boot into UI** Working Working GPU: Hardware video decoding Working Working Misc: AppArmor patches applied to kernel (Kernel 4.9) Working Working Misc: Battery percentage Working Working Misc: Offline charging Not tested Not tested Misc: Online charging Working Working Misc: Shutdown / Reboot Working Working Misc: SD card detection and access Working with additional steps: It is there but gets not displayed in Filebrowser. But one can access it over /media/phablet/<sdcard-name> Working Misc: Anbox patches applied to kernel Not tested Not tested Misc: Recovery image Not working Not working Misc: Reset to factory defaults Not tested Not tested Misc: RTC time is used after reboot Not working internet is needed for correct time Not working internet is needed for correct time Network: Bluetooth Working Working Network: WiFi Working Working Network: Flight mode Working Working Network: Hotspot Working Working Sensors: Fingerprint reader Working Working Sensors: Proximity Working Working Sensors: Rotation Working Working Sensors: Touchscreen Working Working Sensors: GPS partly working: the initial location is found but cannot be followed (Activity App) Not tested Sensors: Automatic brightness Not working Not working Sound: Loudspeaker Working Working Sound: Microphone Working Working Sound: Volume control Working Working Sound: Earphones Working Working USB: ADB access Not working Not working USB: External monitor - only for devices that support it Not working Not working USB: MTP access partly working: the ISODrive App works, but switching back to SSH dows not work partly working: the ISODrive App works, but switching back to SSH dows not work
How to build halium-boot
- create
halium
folder and cd into it- initialize the halium 9.0 repo:
repo init -u https://github.com/Halium/android -b halium-9.0 --depth=1
(creates a hidden .repo folder, in case if you are wondering)- do:
repo sync -c -j [number of parallel jobs]
** make sure that the bionic folder is synced (this somehow missing repo caused builderrors and a headache for me)- add manifest file
fairphone_FP3.xml
to halium/devices/manifests- missing exfat modules: cd into
kernel/fairphone/sdm632
and do:git submodule update --init --recursive
- do:
./halium/devices/setup FP3
- modify kernel config:
halium/halium-boot/check-kernel-config kernel/fairphone/sdm632/arch/arm64/configs/lineageos_FP3_defconfig -w
- most of these changes should already be in the kernel source, but there my be changes in the meantime
- check again without
-w
parameter- add fixup mountpoints for FP3, I am not sure if this is really needed:
"FP3") sed -i \ -e 's block/mmcblk0p30 mmcblk0p30 ' \ -e 's block/mmcblk0p31 mmcblk0p31 ' \ -e 's block/bootdevice/by-name/vendor_a mmcblk0p32 ' \ -e 's block/bootdevice/by-name/product_a mmcblk0p60 ' \ -e 's block/bootdevice/by-name/vendor_b mmcblk0p33 ' \ -e 's block/bootdevice/by-name/product_b mmcblk0p61' \ -e 's block/mmcblk0p62 mmcblk0p62 ' \ -e 's block/mmcblk0p34 mmcblk0p34 ' \ "$@" ;;
- apply hybris patches:
hybris-patches/apply-patches.sh --mb
- build:
I used a little bash script, you can also execute each command individually in the terminalOf course, you could also build the systemimage, but I could not get it to work/boot yet.#!/bin/sh # prepare # using python 3 caused builderrors, perhaps there is an environment variable for this?? sudo ln -sf python2 /usr/bin/python # when using zsh shell you will likely need this two commands setopt shwordsplit export LC_ALL=C # build export USE_HOST_LEX=yes source build/envsetup.sh breakfast FP3 mka halium-boot #mka systemimage # revert python sudo ln -sf python3 /usr/bin/python
It takes ~1h on an Intel i7 9750H (@45W) ;-).
How to flash
GSI
Prepare
Build or download the halium-boot image.
Get TWRP for Fairphone 3.
Get a ubports GSI.
Unlock your phone, see: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
You will need the android tools "fastboot" and "adb".Flash
- Boot the phone into bootloader/fastboot by pressing power + volume-down buttons until it reboots. Or just reboot and click a volume button within 5 seconds and select the bootloader.
- Flash halium-boot image:
$ fastboot flash boot halium-boot.img
- if fastboot throws the error:
Couldn't parse partition size '0x'
try the following command:$ fastboot flash:raw boot halium-boot.img
- Boot your downloaded TWRP image temporarly:
$ fastboot boot [twrp-image.img]
- In TWRP go to ADVANCED and Select "ADB Sideload". Activate sideload.
- in Terminal:
adb sideload [ubports_gsi.zip]
- Wait until it finished, then reboot system.
Gitlab CI
Prepare
Download the latest flashable artifacts zip, which contains boot.img and system.img.
Unlock your phone, see: https://www.fairphone.com/en/bootloader-unlocking-code-for-fairphone-3/
Get TWRP for Fairphone 3.
You will need the android tools "fastboot" and "adb".Flash
- Boot the phone into bootloader/fastboot by pressing power + volume-down buttons until it reboots. Or just reboot and click a volume button within 5 seconds and select the bootloader.
- Flash boot image: `$ fastboot flash boot boot.img
- if fastboot throws the error:
Couldn't parse partition size '0x'
try the following command:$ fastboot flash:raw boot boot.img
- Flash system image:
$ fastboot flash system system.img
- if flashing of system image does break before finished (file data too large), try:
fastboot -S 300M flash system system.img
- Boot your downloaded TWRP image temporarly:
$ fastboot boot [twrp-image.img]
- In TWRP format your data-partition (perhaps that could be done with fastboot too...)
- reboot the system.
Default password isphablet
.
Troubleshooting
In case something wents wrong, you should be prepared to be able to flash a working android image. I used the /e/ OS images for this case.
Look here: https://community.e.foundation/t/how-to-flash-e-os-on-fairphone-3-using-debian-based-gnu-linux/15498
Known Issues
- There are some graphics-glitches (black bars flashing up here and there).
- Much less with latest GSI v10
- Inititally the scaling is very small, this leads to some unwanted effects. Morph Browser, websites are always in Desktop Mode
- Fix: Make the system writable
sudo mount -o rw,remount /
and change/add following properties in/etc/ubuntu-touch-session.d/android.conf
:
GRID_UNIT_PX=21
QTWEBKIT_DPR=2.0
FORM_FACTOR=handset
In the app overview (swipe from the left) it is hard to grab the app, to close it by swiping it up or down.fixed with GSI v10- The settings app crashs, when opening the memory-overview in the Info-area.
With Erfan's GSI (v9) webapps crash on startfixed with GSI v10