Fairphone 3 (FP3)
-
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 terminal
Of 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
- if fastboot throws the error:
- 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
- if fastboot throws the error:
- 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
- if flashing of system image does break before finished (file data too large), try:
- 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/15498Known 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
- Fix: Make the system writable
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
-
Great this phone got ported!
-
I assume, the first todo will be about: "How to create a GSI with a more recent rootfs".
Long story short: I did try. But lost functionality. So I wonder if there are neccessary patches which should be applyed to the rootfs.For Example:
I just took the system.img from erfans GSI builds, created a rootfs image out of the latest android9 build (https://ci.ubports.com/job/xenial-mainline-edge-android9-rootfs/) (using halium-install and taking the created image out of the hidden temporary folder), and created GSI with this tool: https://github.com/erfanoabdi/ubport_GSI.I also tried some builds from here: https://mrcyjanek.net/ci/view/ubports-gsi/
But they are also not very up to date...After flashing multiple times (>15) I ended up with the phone in a corrupted state and needed to flash eOS again, to start from scratch.
I also managed to get my own built system-image running with this GSI method, but as I needed to comment out the WiFi part to make it compile, WiFi was missing.
The best I could get, was a rootfs build form the 28th of September, but there the display-backgroundlight, could not be controlled and the display could not be turned of. Maybe this was a sideeffect of the whole multiple flashing.
Currently I am back at Erfan's GSI v9, evaluating it.
-
Somehow I managed to build a more recent working GSI zip for arm64:
https://drive.google.com/file/d/1L_fA1W1D9xWO2OqmnimvHdLWEdRN1api/view?usp=sharingCamera does not work in this version, so far...
-
I updated the start-post.
With the latest GSI v10 from Erfan, the phone gets very usable. I don't know of a real issue so far. -
That sounds great! I might be able to try it out this weekend
-
I wasn't asked to set up a screen lock password after initial start and now the phone asks for it to unlock after suspend. Tried 0000 and leaving the password blank, but that didn't work.
What is the default password?Edit: ok, now I guessed it: "phablet"
Edit2: didn't test much so far, but swiping down the notifications etc. from the top only works on the right two-thirds of the screen (and the left third of the screen still shows the active app).
Edit3: seems like bluetooth isn't working (doesn't see any device; BT on/off from settings aps and quick settings pull down menu are not in sync) and with developer options enabled I don't see the phone with
adb devices
(ssh phablet@10.15.19.82
works) -
@Ingo sorry, I forgot to mention the default password.
The top swipe issue is because of the missing device-mode (handset, tablet, desktop or similar).
You have to edit the android.conf file, as I descriibed under known issues. -
@Luksus said in Fairphone 3 (FP3):
Make the system writable
How do I do that? I tried
sudo mount -o rw /
which gave
mount: unknown filesystem type 'rootfs'
-
@Ingo sorry again. The command is:
sudo mount -o rw,remount /
-
Ah yeah, I just remembered it wrong, it was too long ago I tried out UT
Edit: the first post mentions to edit
/etc/ubuntu-touch-session.d
but it should be/etc/ubuntu-touch-session.d/android.conf
It actually did contain the line with "handset", so I just added the other two. I assume it needs a reboot for it to take effect?
Edit: yeah, after the changes and a reboot the pull down menu looks fineYet another edit: of the things marked as "not tested" I tried SMS in/out and they are working
When long-pressing the power button to see the shutdown menu, the entry "restart" only restarts unity8 (I had assumed it'd do a full reboot; which is possible via
sudo reboot
over ssh).And in order to try out mobile data I temporarily disabled WiFi. After enabling it again, the phone did not reconnect, even if my WiFi was still in the list of known networks and also seemed to have stored the correct PSK. Only forgetting it and connecting again with PSK worked.
-
@Ingo the reboot thing also happens on my bq sometime, meaning, that on a second attempt it reboots normally.
-
-
Hello,
I have a fairphone 3+
I have downloaded (ubports_GSI_installer_v10) here (https://build.lolinet.com/file/halium/GSI/)But then i try to install GSI .zip / inside twrp recovery.
I get stuck on boot up, can some one tell me why and how to fix it? -
@007fred50 : did you flash the boot image?
And it could be necessary, to flash the data partition (which you can also do within twrp). But I am not 100% sure if this is really needed. -
@Luksus Yes.
step1: ubports_GSI_installer_v10.zip (download)
step2: boot up TWRP
step3: wipe data
step4: install
step5: ubports_GSI_installer_v10.zip
step6: install image inside ubports_GSI_installer_v10.zip->data->system.img
step7: reboot
step8: stuck in boot up logo / Fairphone 3+ boot logo -
I am missing step -1 and 0 in your list
- -1: download halium boot: download
- 0: boot into fastboot mode and flash halium-boot.img to boot:
fastboot flash boot halium-boot.img
You can flash the boot image also after the other steps.
-
@Luksus the link does not working
-
@007fred50 No?
just click download icon in the top-right-corner:
-
@Luksus i cant download the file and yes i press that on your photo. i use firefox mabye google?