Due to the lack of well-maintained community Android ROMs / firmware for Samsung Galaxy S20 FE 5G, the best option stills seems to be using the stock firmware as base and install a GSI image on top.
See my older post here: https://kernelpanik.net/gsi-on-samsung-galaxy-s20-fe-5g/
Here are the steps I took to update everything on my device. Well, it's really a full installation from scratch. So in any case, backup your data first, as all existing data will be wiped during the process (maybe I could have avoided that, but I did backups anyways and wanted to have a clean setup at the end).
As I'm a Linux user with an arm64 machine, I was glad to learn that there is an Odin version for Linux, as Heimdall wasn't working for me. Unfortunately, the Odin binary is compiled for amd64 and there is no source code available, so I had to use an amd64 VM for installing the stock firmware, recovery and vbmeta images. I also tried with a Docker container, but that didn't work because of some USB access problems.
Downloads
- Odin for Linux (amd64): https://xdaforums.com/t/official-samsung-odin-v4-1-2-1-dc05e3ea-for-linux.4453423/
- Samsung stock firmware: https://samfw.com/firmware/SM-G781B
- TWRP: https://eu.dl.twrp.me/r8q/twrp-3.7.1_12-0-r8q.img.tar.html
- vbmeta: https://github.com/ata-kaner/r8q_archive/releases/tag/vbmeta
- LineageOS GSI: https://sourceforge.net/projects/andyyan-gsi/files/lineage-20-td/
Steps
Helper VM (not needed when running on amd64 machine)
- Create Debian 12 amd64 VM in Virtual Machine Manager (VMM)
- Default desktop deployment with XFCE is sufficient
- Share directory on host (containing firmware images) via VirtioFS to VM
- Mount VirtioFS 'fs' in VM under '/mnt':
$ sudo mount -t virtiofs fs /mnt
Install stock firmare (from VM)
- Boot device to download mode (Vol up+down + Power)
- Redirect USB device in VMM
- Check if device ready:
$ sudo /mnt/odin/odin4 -l
- Flash stock firmware
$ sudo /mnt/odin/odin4 -b /mnt/BL_G781BXXSAHXC6_G781BXXSAHXC6_MQB78624741_REV00_user_low_ship_MULTI_CERT.tar.md5 \
-a /mnt/AP_G781BXXSAHXC6_G781BXXSAHXC6_MQB78624741_REV00_user_low_ship_MULTI_CERT_meta_OS13.tar.md5 \
-c /mnt/CP_G781BXXSAHXC6_CP26187603_MQB78624741_REV00_user_low_ship_MULTI_CERT.tar.md5 \
-s /mnt/CSC_OXM_G781BOXMAHXC6_MQB78631186_REV00_user_low_ship_MULTI_CERT.tar.md5 \
-d /dev/bus/usb/001/002
- Boot stock firmware
- Finish intial setup
- Check for OS updates
- Check for OEM unlock status
Install vbmeta (from VM)
-
Boot device to download mode (Vol up+down + Power)
-
Redirect USB device in VMM
-
Flash vbmeta_patched_G781B.tar:
$ sudo /mnt/odin/odin4 -u /mnt/vbmeta_patched_G781B.tar -d /dev/bus/usb/002/009
Check file : ../vbmeta_patched_G781B.tar
/dev/bus/usb/002/009
Setup Connection
initializeConnection
Receive PIT Info
success getpit
Upload Binaries
vbmeta.img
Close Connection
Install TWRP recovery (from VM)
-
Boot device to download mode (Vol up+down + Power)
-
Redirect USB device in VMM
-
Flash TWRP:
$ sudo ./odin4 -a ../twrp-3.7.1_12-0-r8q.img.tar -d /dev/bus/usb/002/011
Check file : ../twrp-3.7.1_12-0-r8q.img.tar
/dev/bus/usb/002/011
Setup Connection
initializeConnection
Receive PIT Info
success getpit
Upload Binaries
recovery.img
Close Connection
- Boot to recovery (Vol up + Power)
- Wipe > Advanced wipe > Wipe DATA, METADATA, KEYDATA and KEYREFUGE
- Reboot
- Boot stock firmware
- Finish intial setup once more
Install GSI (from host)
-
Boot to recovery (Vol up + Power)
-
Reboot to fastboot
-
Delete product partition (not needed anyways):
$ fastboot delete-logical-partition product
Deleting 'product' OKAY [ 0.004s]
Finished. Total time: 0.004s
-
Reboot to fastboot
-
Unpack GSI:
$ unxz lineage-20.0-20240414-UNOFFICIAL-arm64_bvS.img.xz
- Flash GSI:
$ fastboot flash system lineage-20.0-20240414-UNOFFICIAL-arm64_bvS.img
Resizing 'system' OKAY [ 0.003s]
Sending sparse 'system' 1/9 (262112 KB) OKAY [ 6.929s]
Writing 'system' OKAY [ 0.552s]
Sending sparse 'system' 2/9 (262112 KB) OKAY [ 6.950s]
Writing 'system' OKAY [ 0.530s]
Sending sparse 'system' 3/9 (262112 KB) OKAY [ 6.859s]
Writing 'system' OKAY [ 0.541s]
Sending sparse 'system' 4/9 (262124 KB) OKAY [ 6.930s]
Writing 'system' OKAY [ 0.526s]
Sending sparse 'system' 5/9 (262128 KB) OKAY [ 6.999s]
Writing 'system' OKAY [ 0.544s]
Sending sparse 'system' 6/9 (262088 KB) OKAY [ 6.941s]
Writing 'system' OKAY [ 0.519s]
Sending sparse 'system' 7/9 (262120 KB) OKAY [ 6.873s]
Writing 'system' OKAY [ 0.527s]
Sending sparse 'system' 8/9 (262140 KB) OKAY [ 6.926s]
Writing 'system' OKAY [ 0.534s]
Sending sparse 'system' 9/9 (69560 KB) OKAY [ 1.817s]
Writing 'system' OKAY [ 0.243s]
Finished. Total time: 62.226s
- Reboot to recovery
- Wipe > Format DATA
- Reboot to system
- Done
There was one problem after everything else seemed to be working nicely: receiving SMS didn't work for some strange reason, while sending SMS and initiating / receiving phone calls worked.
From what I read on XDA forums and GSI related bug reports at https://github.com/TrebleDroid/treble_experimentations/issues it seems that Samsung did some changes that broke integration with the IMS implementation on TrebleDroid (basis for LineageOS GSI), which is responsible for receiving SMS (amongst other things).
See https://kernelpanik.net/fix-sms-reception-on-samsung-s20-fe-5g/ for fixing the SMS reception problem.