Hands-on Guide

From an 8-dollar stick to a Debian server — the reproducible way

Back up, flash, connect. Backup first, courage second.

scroll down

Quickstart

Five steps. Each leads to its matching detail section — no dead ends.

1
Mode
Understand ADB → Fastboot → EDL 9008.
→ 0x00 Modes
2
Backup
Full dump + boot/modem individually.
→ 0x01 Backup
3
Modem-FW
Rescue the firmware, later into /lib/firmware.
→ 0x02 Modem-FW
4
Flash
Write the Debian image.
→ 0x03 Flash
5
Connect
SSH, LTE/APN, done.
→ 0x04 Connect
0x00

The three modes: ADB · Fastboot · EDL

Before anything gets written: how do you enter each mode, how does the host PC see the device, and what is it for?

ModeHow to enterHost PC seesPurpose
ADB
(stock Android)
Boot stock Android → connect via Wi-Fi to http://192.168.100.1 (login admin) → enable ADB at /usbdebug.html → re-plug the stick adb devices lists the device Initial recon & backups while Android is still running
Fastboot
(bootloader)
adb reboot bootloader from a running ADB fastboot devices Write individual partitions, the actual Debian flash (./flash.sh)
EDL 9008
(Emergency Download)
adb reboot edl (or from Fastboot: fastboot oem reboot-edl) USB device 05c6:9008 („Qualcomm HS-USB QDLoader 9008“) Full read/write access to the eMMC + rescue of bricked devices
Order: EDL is the safety anchor — whatever you can back up in EDL you can also write back in EDL. So: pull a complete backup first (0x01), only then flash.
# Bjoern Kerler's EDL client (tools/edl) + firehose loader
EDL=tools/edl/edl
LOADER=tools/edl/edlclient/prog_emmc_firehose_8916.mbn

# Detect device / read the partition table
edl printgpt
0x01

Backup first — three granularities

From „all at once“ to the surgical single shot. Store the files safely — they are your return ticket.

Full dump (the insurance)

# Full dump of all partitions into one file (~3.7 GB)
edl rf uz801-stock.bin

boot partition individually

# Read the boot partition individually
python edl r boot boot.img

modem + NV (the „extra files“)

These are the pieces you'll need later for a working modem.

# Back up all partitions individually — produces modem.bin, modemst1.bin,
# modemst2.bin, fsg.bin, fsc.bin … + rawprogram0.xml:
edl rl uz801_stock --genxml

# Critical NV partitions (IMEI/calibration): modemst1, modemst2, fsg, fsc

Partition table (reference)

Offset = start sector (sector size 512 bytes), size converted from size_in_KB — both verbatim from the autogenerated rawprogram0.xml. The XML has no flags column. „Purpose“ is a standard MSM8916 description (not from a repo comment).

NameOffsetSizeFlagsPurpose
modem6553664 MBModem firmware (NON-HLOS)
sbl1196608512 KBSecondary Bootloader (SBL1)
sbl1bak197632512 KBSBL1 backup
aboot1986561 MBAndroid/LK bootloader (aboot)
abootbak2007041 MBaboot backup
rpm202752512 KBResource Power Manager firmware
rpmbak203776512 KBRPM backup
tz204800512 KBTrustZone (Secure World)
tzbak205824512 KBTrustZone backup
hyp206848512 KBHypervisor
hypbak207872512 KBHypervisor backup
pad2088961 MBPadding/reserve
modemst12109441.5 MBModem NV storage 1 (IMEI/calibration)
modemst22140161.5 MBModem NV storage 2
misc2170881 MBBoot-mode flags (misc)
fsc2191361 KBModem FS cookie
ssd2191388 KBSecure storage (SSD)
splash21915410 MBBoot logo
DDR26214432 KBDDR training data
fsg2622081.5 MBModem filesystem (NV/provisioning)
sec26528016 KBSecurity/fuse data
boot26531216 MBKernel + ramdisk (boot image, DTB appended)
system298080800 MBRoot filesystem (Android system / Debian rootfs)
persist193648032 MBPersistent sensor/calibration data
cache2002016128 MBCache
recovery226416016 MBRecovery image
oem229692810 MBOEM partition
userdata2317408≈2.47 GBUser data (largest partition)
0x02

Modem firmware → /lib/firmware

Where most people get stuck: without the right firmware files the modem won't register under Linux.

Where the files come from

From stock Android: pull /firmware/image/ (Android 4.4.4) via ADB — alternatively from the backed-up modem partition (modem.bin) of the EDL backup.

Which files

# 58 firmware files (stock dump):
#   modem.*    – 22  (modem.mdt + modem.b00 … baseband DSP)
#   wcnss.*    –  9  (Wi-Fi/Bluetooth, WCN3620)
#   cmnlib.*   –  5  (Common Library)
#   keymaste.* –  5  (Keymaster)
#   isdbtmm.*  –  5  (ISDB-T Multimedia)
#   playread.* –  5  (PlayReady DRM)
#   widevine.* –  5  (Widevine DRM)
#   modem_pr   –  1
#   mba.mbn    –  1  (Modem Boot Authenticator)

Install into Debian — two ways

Both drop the same files into /lib/firmware/. Way A is easiest while stock Android still runs; Way B only needs the EDL backup.

Way A — from stock Android (ADB)

# Android running, ADB active — pull the firmware folder:
adb pull /firmware/image/ firmware-backup/image/

# install on the Debian stick:
sudo cp firmware-backup/image/* /lib/firmware/
sudo systemctl restart ModemManager

Way B — from the backed-up modem partition

# modem partition from the EDL backup (see 0x01):
edl r modem modem.img --memory=emmc

# mount the image read-only via loopback and copy the firmware:
mkdir -p modem_mnt
sudo mount -o loop,ro modem.img modem_mnt
sudo cp modem_mnt/image/* /lib/firmware/
sudo umount modem_mnt

Note: adjust the exact target path / file layout (e.g. an image/ subfolder) to your setup — the install step was only prose in the repo; the source files are verbatim.

Gotcha: Incomplete /lib/firmware → the modem won't register. On top of that the Q6/remoteproc does an intentional reset ~30 s after boot (ModemManager loses the QMI port); fix: modem-fix.service restarts ModemManager after 45 s (since v6.0).
0x03

Flash Debian

Only once the backup is in place. Flashing runs in Fastboot mode — flash.sh first backs up the NV partitions internally, then writes the bootloader, rootfs and boot.

Beforehand: Do you have the backup from 0x01? The wrong image can soft-brick the device. The recovery path is in 0x05.
# In Fastboot mode (see 0x00). Download, unzip and flash the OpenStick release:
wget https://download.wvthoog.nl/projects/security/openstick/openstick-uz801-v3.0.zip
cd OpenStick/flash/
./flash.sh

Device tree (DTB) used: the DT is appended to the kernel zImage inside boot.imgno separate DTB file is flashed. Custom kernel builds compile msm8916-uz801-v3.dtb or msm8916-handsome-openstick-uz801.dtb. (There is no fy-mf800.dtbfy-mf800 is just a photo folder.)

0x04

Connect & internet

Plug in the stick, log in, enable LTE.

SSH

ssh user@192.168.200.1   # USB (RNDIS), default
ssh user@192.168.100.1   # Wi-Fi AP (SSID 4G-UFI-XX, PSK 1234567890)
# Default user password: 1

LTE / APN

# NetworkManager ships a prepared "lte" profile:
sudo nmcli connection modify lte gsm.apn <your_apn>
sudo nmcli connection up lte

# check:
sudo mmcli -m 0
ip a show wwan0

# optional, if a SIM PIN is set:
sudo nmcli connection modify lte gsm.pin <your_pin>
0x05

Recovery / bring back a brick

If the stick no longer boots: enter EDL (0x00) and write the backup back.

# Full restore (write the backup back):
edl wf uz801-stock.bin

# or individually, e.g. boot:
edl w boot boot.img

# Restore modem NV from this stick's originals (preserves IMEI):
edl w modemst1 uz801_stock/modemst1.bin
edl w modemst2 uz801_stock/modemst2.bin
edl w fsg uz801_stock/fsg.bin
edl w fsc uz801_stock/fsc.bin
edl reset
"The EDL backup before your first flash isn't a recommendation, it's the precondition." — everyone who has ever bricked a stick