Warning
PROCEED AT YOUR OWN RISK. This project is an advanced, bare-metal research port of Linux onto an Android smartphone platform. Following the guides, flashing partition tables, or executing scripts in this repository carries real risks, including permanent hardware brick, bootloops, bootloader lockouts, or irreversible data loss.
- NO GUARANTEE OF SUCCESS: Hardware components on the Samsung Galaxy A70 vary significantly across production batches and regional variants (
SM-A705F,SM-A705FN,SM-A705GM,SM-A705MN,SM-A7050,SM-A705W). Crucially, aftermarket replacement screens (such as TFT/INCELL panels with non-standard I2C/SPI bridge controllers) behave completely differently from OEM Super AMOLED panels (S6E3FC2_AMS670TA01_FHD). - MANUAL ADJUSTMENTS REQUIRED: Depending on your bootloader version (e.g., Knox S-Boot Rev 1 through Rev 5 / U5), DRAM vendor, and touchscreen digitizer revision, you will need to adapt device tree overlays (DTBO), kernel command-line arguments, and driver timings. This is not a one-click flash-and-play ROM.
- BACKUP MANDATORY: Under no circumstances should you proceed without taking full raw block-level backups (
ddor TWRP/OrangeFox raw partition backups) of/dev/block/sda,boot,dtbo,recovery,efs, anduserdata. The authors assume zero liability for any damage to your hardware or loss of data.
Genuine bare-metal Debian GNU/Linux 13 (Trixie) port for the Samsung Galaxy A70 (SM-A705F / a70q), featuring full systemd PID 1, custom dual-boot initramfs, Phosh Wayland mobile environment, Qualcomm Adreno 612 hardware acceleration via Turnip Vulkan + Zink, and headless USB gadget connectivity (CDC-NCM Ethernet + CDC-ACM serial root console).
For the exhaustive trial-by-trial engineering journal, read docs/EXPERIMENTAL_RESEARCH_LOGS.md.
| Component | Specification |
|---|---|
| Device Model | Samsung Galaxy A70 (SM-A705F, codename a70q) |
| SoC | Qualcomm Snapdragon 675 (SM6150), 8-core Kryo 460 (2x Cortex-A76 @ 2.0GHz, 6x Cortex-A55 @ 1.7GHz) |
| GPU | Qualcomm Adreno 612 |
| Graphics Stack | Mesa Turnip Vulkan driver + Zink OpenGL ES over Qualcomm downstream KGSL (/dev/kgsl-3d0) |
| Display Panel | 6.7" FHD+ (1080x2400 @ 60Hz), DSI-1, 2x UI scaling |
| Touchscreen | Imagis IST40XX (sec_touchscreen / I2C bus 1 @ 0x50) |
| Storage / Rootfs | 128GB UFS 2.1 (/dev/block/sda30 dedicated ext4 rootfs partition, preserving /dev/block/sda29 Android userdata) |
| Base Kernel | Qualcomm downstream Linux 4.14 (msm-4.14, LineageOS / crDroid tree adapted for systemd) |
| Userland | Debian GNU/Linux 13 (Trixie) ARM64 (aarch64) |
| Compositor / Shell | Phosh (Pure Wayland Mobile Shell) + Phoc (wlroots) |
| Subsystem | Driver / Interface | Status | Notes |
|---|---|---|---|
| Boot & Init | Custom C dual-boot initramfs (dualboot_init.c) |
Working | Auto-detects partition layout; non-destructive dual-boot |
| Display (KMS) | Qualcomm MSM DRM KMS (/dev/dri/card0, DSI-1) |
Working | Non-atomic modesetting; software cursor forced (WLR_NO_HARDWARE_CURSORS=1) |
| GPU Acceleration | Mesa Turnip Vulkan + Zink OpenGL | Working | Physical Adreno 612 firmware placed; hardware acceleration verified via KGSL |
| Touchscreen | Imagis IST40XX (/dev/input/event*) |
Working | Tagged via udev for seat0 and libinput Wayland mapping |
| USB CDC-NCM | Linux ConfigFS Ethernet gadget (192.168.7.2) |
Working | Plug-and-play USB networking to host PC |
| USB CDC-ACM | Linux ConfigFS Serial Console (/dev/ttyGS0 /dev/ttyACM0) |
Working | Direct passwordless root console from host PC |
| Backlight | PM6150L WLED (/sys/class/backlight) |
Working | Initialized via hardware-init
|
| Battery / PMIC | PM6150 / SMB1355 charger driver | Working | Thermal monitoring and charging functional |
| Audio | ALSA / PipeWire / WirePlumber | WIP | Qualcomm WCD937x audio codec driver in progress |
| Wi-Fi / WLAN | Qualcomm qcacld-3.0
|
WIP | Kernel module loads; panic guard in initramfs |
Bringing desktop Linux onto a modern Qualcomm Snapdragon smartphone is not a simple userland chroot. It requires navigating kernel constraints, driver omissions, and bootloader quirks:
- Trial: Installing native Linux without erasing the user's primary Android ROM (crDroid 13 / LineageOS 20).
- Breakthrough: Discovered an unallocated 77GB LUN partition on
/dev/block/sda30. Formatted it as pureext4, leaving/dev/block/sda29(crDroid F2FS userdata) 100% untouched.
- Trial: Flashing generic
boot.imgresulted in immediate bootloops. - Root Cause: Samsung Knox S-Boot Rev 5 (
A705FXXU5DXD2) verifies the device tree overlay table (dtbo.img, magic0x1eabb7d7). Missing matching overlays for SM6150 revision 13 halts bootloader handover. - Breakthrough: Extracted and injected the LineageOS DTBO table (
2,499,651bytes) with relative offset calculation (0x1d8e000).
- Trial: Setting
earlycon=msm_geni_serial,0x880000halted boot instantly. - Root Cause: Qualcomm SM6150 GENI serial clocks are disabled prior to kernel clock provider initialization. Accessing unclocked MMIO registers triggers ARM64 EL1 hardware faults.
- Fix: Stripped
earlycon, passedconsole=null nokaslr printk.devkmsg=on.
- Trial: Triggering
echo 1 > /sys/kernel/boot_wlan/boot_wlanon early boot. - Root Cause: Vendor driver
qcacld-3.0was compiled with+PANIC_ON_BUG. Triggering WLAN before regulatory domains and firmware are loaded by userspace caused fatal kernel panic and EDL crash. - Fix: Deferred and isolated WLAN initialization out of the critical boot path.
- Trial: Bypassing
llvmpipeCPU software rendering without upstream DRM MSM. - Breakthrough: Utilized Mesa Turnip's native KGSL backend (
TU_DEBUG=kgsl) communicating directly with/dev/kgsl-3d0. Placed physical firmware (a612_zap.mdt,a630_sqe.fw), adjusted udev permissions (chmod 666 /dev/kgsl-3d0 /dev/ion), and layered Zink OpenGL ES (MESA_LOADER_DRIVER_OVERRIDE=zink) on top. Confirmed native acceleration:GPU: Qualcomm Turnip Adreno (TM) 612 [Integrated].
- Trial: Starting Phosh compositor (
phoc). - Root Cause:
phoclinked tolibseat. Because packageseatdwas installed,libseatdefaulted toseatd. Butseatdstrictly requires Linux Virtual Terminals (/dev/tty0,/dev/tty1,CONFIG_VT), which downstream Android kernels disable.seatdwaited 10s, timed out, and causedphocto crash. - Breakthrough: Completely masked
seatd.serviceand forcedLIBSEAT_BACKEND=logind.systemd-logindmanages DRM and input directly via DBus without virtual terminals.
- Trial: Mutter / GNOME Shell page flipping.
- Root Cause: Qualcomm's downstream KMS driver (
sde_kms) does not implement hardware cursor planes. Mutter calling KMSdrmModeSetCursorfailed with-ENXIO, causing the page flip to fail and triggering display power-off (dsi_display_disable). - Breakthrough: Exported
WLR_NO_HARDWARE_CURSORS=1andMUTTER_DEBUG_DISABLE_HW_CURSORS=1. Cursors render in software; panel remains alive.
- Trial: User lockout on GDM greeter due to unscaled DPI and missing on-screen keyboard.
- Breakthrough: Configured 2x Phoc scaling (
[output:DSI-1] scale = 2), PAM passwordless authentication, GDM autologin into Phosh, and disabled screen lock via dconf.
+--------------------------------------------------------------+
| Phosh Mobile Shell |
| (Squeekboard On-Screen Keyboard) |
+--------------------------------------------------------------+
|
+--------------------------------------------------------------+
| Phoc (wlroots) Compositor |
| (LIBSEAT_BACKEND=logind, scale = 2) |
+--------------------------------------------------------------+
|
+-----------------------+-----------------------+
| |
+-------------------------------+ +-------------------------------+
| Mesa Zink OpenGL ES | | Mesa Turnip Vulkan |
+-------------------------------+ +-------------------------------+
| |
+---------------------------------------------------------------+
| Qualcomm KGSL Driver (/dev/kgsl-3d0) |
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
| Qualcomm MSM DRM Display Controller (DSI-1) |
+---------------------------------------------------------------+
native-linux/
├── artifacts/ # Checksums, build instructions, and verification docs
├── debian/ # Debian rootfs bootstrapping & image packaging scripts
│ ├── build_rootfs_native_a70.sh
│ └── package_ext4_image.sh
├── device/ # LineageOS device tree & platform configuration
│ ├── a70q-device/
│ └── sm6150-common/
├── docs/ # Exhaustive hardware audits and porting documentation
│ ├── EXPERIMENTAL_RESEARCH_LOGS.md # Complete deep-dive trial journal
│ ├── ACTUAL_PARTITION_INVENTORY.md
│ ├── BUILD_AND_TEST_GUIDE.md
│ ├── DRIVER_COMPATIBILITY_MATRIX.md
│ ├── DUAL_BOOT_ARCHITECTURE.md
│ └── FIRST_NATIVE_BOOT_RESULTS.md
├── initramfs/ # Custom dual-boot initramfs C source and build scripts
│ ├── dualboot_init.c
│ ├── debian_splash.c
│ └── build_initramfs.sh
├── kernel/ # Kernel configuration and build environments
│ ├── config-4.14.190-running
│ └── build_kernel.sh
├── scripts/ # Utility scripts for flashing, log collection, and debugging
│ ├── connect_debian.sh
│ ├── flash_linux_direct.sh
│ └── collect_native_boot_logs.sh
└── vendor/ # Firmware extraction tools and Adreno GPU firmware maps
- Samsung Galaxy A70 (
SM-A705F) with unlocked bootloader (OEM Unlockenabled in Developer Options). - Host Linux machine (Ubuntu / Debian / Fedora) with
adb,fastboot,heimdall, andgcc-aarch64-linux-gnuinstalled.
cd initramfs
# Compile custom dual-boot C init
aarch64-linux-gnu-gcc -static -O2 -Wall dualboot_init.c -o dualboot_init
# Package ramdisk
./build_initramfs.sh- Turn off the phone.
- Hold Volume Down + Volume Up and plug in the USB cable connected to your PC.
- On the turquoise warning screen, press Volume Up to enter Download Mode.
- Run the flashing script:
chmod +x scripts/flash_linux_direct.sh
./scripts/flash_linux_direct.shOnce booted, the phone exposes a composite USB gadget:
- Instant Root Console (Serial):
screen /dev/ttyACM0 115200
# or
minicom -D /dev/ttyACM0- Network / SSH Connection:
# Configure host USB interface
sudo ip addr add 192.168.7.1/24 dev enp0s20f0u5
sudo ip link set enp0s20f0u5 up
# Connect via SSH
ssh debian@192.168.7.2This project is licensed under the Apache 2.0 License. Linux kernel sources and LineageOS device trees are licensed under GPLv2 and Apache 2.0 respectively.