Ubuntu 26.04 + Lomiri (the Ubuntu Touch shell) on a mainline Linux kernel
Samsung Galaxy M52 5G (m52xq, SM-M526B, Snapdragon 778G / SM7325)
What is this?
A regular Ubuntu 26.04 system with Lomiri 0.6.2, the phone shell of Ubuntu Touch (UBports). It runs a mainline Linux kernel (7.1.13) with device patches. It does not use the Android kernel or Halium. Packages come from the normal Ubuntu archive and the UBports repositories; apps from the OpenStore can be installed too.
This is a personal hobby port. It is not official: not a UBports or Canonical release. Tested on one SM-M526B unit only.
The device tree is under review for mainline Linux (v1 is on the linux-arm-msm mailing list).
Disclaimer
You alone are responsible for anything you do to your phone. If this phone is your primary means of communication, I do not recommend using this port. Your warranty is void. You flash this at your own risk. I am not responsible for bricked devices, lost data, a dead modem/IMEI or anything else. Make backups first (see below). If you are not comfortable restoring a Samsung phone with Odin, do not install this.
What works
- Boot from UFS, 8 GB system partition (resized during install)
- Display (Samsung S6E3HAB), brightness, auto-rotation
- GPU acceleration (Adreno 642L, Mesa)
- Touchscreen
- First-run wizard with language choice (the chosen language is applied to the shell, the quick settings and all apps)
- Wi-Fi and Bluetooth (WCN6750), Bluetooth audio
- Calls, SMS and mobile data - dual SIM (both SIMs active); switching between loudspeaker and earpiece during a call; the call window on the lock screen; a call bar with call time and contact name
- Audio: loudspeaker, earpiece, microphone, in-call noise suppression
- GPS
- Sensors: light, proximity (screen off during calls), accelerometer
- Battery level and charging, Samsung AFC 9 V fast charging
- Deep sleep: the phone wakes up for calls, SMS and alarms; the screen stays dark on network wake-ups
- Alarm clock that wakes the phone from sleep
- Camera app: rear and front cameras, 64 MP photos, digital zoom up to 4x (pinch or slider), video with the hardware encoder (Venus)
- OpenStore;
- Compressed swap in RAM (zram, 3 GB), so large photos and heavy web pages do not run out of memory
Known issues
- On-screen keyboard after a rotation: sometimes, after turning the phone from portrait to landscape, the right half of the keyboard does not react. Hide the keyboard and tap the text field again; it then works. In the first-run wizard it is easiest to type the Wi-Fi password in portrait.
- Video in the browser is decoded in software.
Not working
- Fingerprint reader
- VoLTE (calls use 2G/3G)
Requirements
- SM-M526B with an unlocked bootloader
- TWRP for m52xq: https://github.com/saadelasfur/Action-Recovery-Builder/releases/tag/20261004173308
- A microSD card with the zips on it (Format Data in TWRP erases the internal storage)
- A PC with Odin and the stock firmware for your model/region, in case you want to go back
Device firmware is taken from your own phone. The zip contains no proprietary firmware. The installer copies the DSP, GPU, IPA (mobile data), video codec, Bluetooth, modem and sensor firmware from your phone's own apnhlos, vendor, modem, persist and EFS partitions (read-only). So these partitions must be intact, and vendor must come from a Samsung-based ROM (stock, UN1CA or Lineage). Your phone also gets its own Bluetooth address, SSH keys and machine ID during the install.
Installation
Video guide: https://www.youtube.com/watch?v=xJV4l0g4Kwc
Warning: the phone gets warm during the install. If your display already shows vertical coloured lines, do not install this: the heat may make them worse.
Recommendation - system partition size: the installer grows the system partition to 8 000 000 000 bytes. I recommend flashing UN1CA_3.1.0 first to get the maximum system partition size. After Lineage 23 the system partition will be 1 GB smaller, but the installation will still succeed.
TWRP steps:
Wipe - Format Data - yes - enter - Back - Back - Advanced Wipe - Data - Repair or Change File System - Change File System - EXT4 - Swipe to Change - Back - Back - Back - Back - Back - Install - Select Storage - Micro SD card - ubuntu_touch_classic_26.04-m52xq-mainline-v1-UNOFFICIAL.zip - Swipe to confirm Flash - Reboot System
The install takes about two minutes; wait for "Updater process ended with RC=0". A line "Failed to mount '/system_root'" at the very end is normal. The first boot takes longer; then the setup wizard starts (language, Wi-Fi, time zone).
Default password (4-digit screen unlock, user and root): 1111
You can change it in System Settings - Security & Privacy.
SSH over USB (about 30 s after boot): ssh root@172.16.42.1 (password 1111)
Screenshot: press Volume Up + Volume Down at the same time. The picture is saved to the Screenshots folder in your home directory.
Going back to Android
Video guide: https://www.youtube.com/watch?v=0lgLbtdl4rA&t=89s
These steps return the phone from Linux (mainline or Halium ports) to Lineage or UN1CA).
If the port you are leaving has no option to reboot directly into recovery, enter TWRP with the usual power and volume button combination. Before switching back, copy the firmware zip to your microSD card. The Lineage and UN1CA zips rewrite boot, vendor_boot and dtbo themselves.
TWRP steps (Lineage 23.2):
Wipe - Format Data - yes - enter - Back - Back - Back - Advanced Wipe - Data - Repair or Change File System - Change File System - EXT4 - Swipe to Change - Back - Back - Back - Back - Back - Install - lineage-23.2-2026-nightly-m52xq-signed.zip - Back - Back - Wipe - Format Data - enter - Reboot System
Take the latest build lineage.zip from https://download.lineageos.org/devices/m52xq/builds
Downloads
- Flashable zip (1.1 GB): ubuntu_touch_classic_26.04-m52xq-mainline-v1-UNOFFICIAL.zip
- MD5:
a3343884846751530f4a590e23e9275e
Source code
- Port (installer, patches, scripts, manual): https://github.com/korryasdlerto-lgtm/samsung-m52xq-ubuntu-lomiri
- Kernel source: https://github.com/korryasdlerto-lgtm/sc7280-mainline-linux-m52xq
Bug reports
Please write your model (SM-M526B / SM-M526BR), what you did and what happened. Logs help a lot: journalctl -b and dmesg over SSH or in the Terminal app.
Credits
- UBports and the Lomiri developers
- Ubuntu
- postmarketOS (pmbootstrap, device bring-up work)
- The mainline Linux developers for Qualcomm SC7280/QCM6490 (Fairphone 5 and others) - most of the SoC support comes from their work
Asdlerto Korry@forums.ubports.com 1 day ago
Hi Keneda,
In principle, yes. The Fairphone 5 (QCM6490) has very good mainline
support already, much better than the Galaxy M52 - a lot of what this
port uses comes from the FP5 work (Luca Weiss and others), and
postmarketOS already runs the FP5 on a mainline kernel.
Lomiri runs on top of a normal mainline Linux system, so an image like
this one (Ubuntu + Lomiri on a mainline kernel) should be quite doable
for the FP5. It would be a different approach from the official
Halium-based Ubuntu Touch port, though: no Android drivers, everything
native (e.g. libcamera for the cameras).
I don't have an FP5, so I can't build or test it myself, but most of
the userspace parts of this port (installer, configs, call/audio
handling) are in the GitHub repo and could serve as a starting point.
@Asdlerto-Korry
Thanks for your quick and precise answer.
👍
And oh, thanks for your work ^^