Skip to main content

Android

Turning an Old Android Phone into a Server (Redmi 4X [santoni])

Turning an Old Android Phone into a Server (Redmi 4X [santoni])

hahnavi hahnavi

This is my rough-and-ready notes for turning a Redmi 4X (santoni) into a tiny Linux server. Huge credit to the original work here: https://github.com/dreemurrs-embedded/arch-linux-santoni

Quick heads‑up: this will wipe and rework partitions, so don’t do it on a phone you still need as a phone. Backups first.

What I used

  • A Linux host
  • USB cable
  • Some patience

Create a rootfs image

dd if=/dev/zero of=rootfs.img bs=1M count=2560

Format it as ext4

mkfs.ext4 rootfs.img

Mount it

sudo mount rootfs.img /mnt/rootfs

Grab Arch Linux ARM64 rootfs

Build Linux Kernel for Android Device

Build Linux Kernel for Android Device

hahnavi hahnavi

This is a simple walk‑through for building an Android kernel from source. It assumes a Linux host and a device tree that already builds (LineageOS kernels are usually a good starting point).

Download the Kernel Source Code

Pick the kernel tree that matches the device. Example: Xiaomi Mi8937

git clone https://github.com/LineageOS/android_kernel_xiaomi_msm8937.git --depth=1

Install Cross Compiler

Android kernels for ARM64 need an AArch64 cross compiler. Use the package for the host distro: