Skip to content

Fastboot

The ABL (Android Boot Loader) supplies fastboot. The stock Android 10 ABL has only basic flashing and query commands. The AT&T 8.1 userdebug ABL adds the flashing subcommands that change the lock state. This page describes the command set and the quirks seen on the XP8800.

Command table

The ABL registers its commands from a fixed table. These are the commands that were seen:

Command Purpose
flash: Write a partition
erase: Erase a partition
set_active Select the active A/B slot
getvar: Read a variable
download: Bulk-download a payload
continue Continue the boot
reboot-bootloader Reboot back to the boot loader
flashing get_unlock_ability Print if unlock is permitted
flashing unlock Unlock the boot loader
flashing lock Lock the boot loader again
flashing unlock_critical Unlock critical partitions
flashing lock_critical Lock critical partitions again
oem device-info Print the lock and verity state
oem select-display-panel Select a boot splash panel
oem enable-charger-screen / oem disable-charger-screen Charger UI
oem off-mode-charge Charge while “off”

WARNING: Make a verified backup before you use flash:, erase:, or the flashing commands. These commands change partitions or the lock state. An incorrect partition can hard-brick the phone. Do not write modemst1, modemst2, fsg, fsc, or persist. See NV partitions and backup.

The ABL also registers a critical-partition list (devcfg frp cdt cmnlib cmnlib64 keymaster mdtp …). The *_critical commands operate on those partitions.

Lock state

  • get_unlock_ability reads the last byte of the frp partition (offset 524287). See Bootloader unlock.
  • The ABL variables hold unlocked, unlock_critical, and the verity state. oem device-info prints them.
  • The stock ABL does not have get_unlock_ability. It returns unknown command.

A/B slots

Item Value
Active slot _a at inspection
Retry count for a slot that was just written 7
Failed-boot behavior The slot is marked unbootable. The phone stops in fastboot
Recovery on an unlocked boot loader fastboot set_active a
_b caution Stock abl_b has no flash or set_active. Do not switch to it with a custom image

Variables

Read one variable in each call. These are the common getvar values:

Variable Meaning
unlocked yes / no
current-slot a / b
secure Secure boot flag
product sdm630
kernel uefi
variant SDM EMMC
max-download-size About 768 MB on this platform
version-bootloader Can be blank on the Sonim ABL
partition-size:<name> Size of a partition

WARNING: Do not use fastboot getvar all. On this ABL, it can return unknown command or stop the USB endpoint. Query single variables.

Write timing

After each fastboot flash, wait this number of seconds before the next command:

(bytes / 15_000_000) + 5 seconds

The ABL acknowledges the write immediately. It keeps writing to the eMMC at approximately 15 MB/s.

CAUTION: Do not send the next command before the wait time ends. The ABL can continue to write to the eMMC.

Example session

Terminal window
fastboot getvar unlocked
fastboot getvar current-slot
fastboot oem device-info
fastboot flashing get_unlock_ability
fastboot flashing unlock

WARNING: Do not use fastboot flashing unlock if you did not make a verified backup. The command wipes userdata.