- C 85.8%
- Shell 9.6%
- Makefile 4.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| lib | ||
| scripts | ||
| .gitignore | ||
| bctltool.c | ||
| LICENSE.BSD | ||
| LICENSE.GPL | ||
| Makefile | ||
| README.md | ||
bctltool
Reads and writes the A/B boot control block that Android keeps in the misc partition.
Works on a device over adb/recovery shell, or on a dumped misc image on your host.
Building
make
For Android:
make android
Usage
Without -f the tool looks for misc in the usual by-name locations.
bctltool dump # decode the whole block
bctltool get active
bctltool set active b
bctltool mark a unbootable
bctltool mark b successful
bctltool -f misc.img dump # work on a dump instead
dump gives you the whole picture at once:
BootControl [Magic: BCAB | Ver: 1 | CRC: 0xaf100e51 (valid)]
suffix: _a
slot_count: 2
recovery_tries: 0
merge_status: 0 (none)
Slot A (_a) [active]
priority: 15
tries_remaining: 7
successful_boot: no
verity_corrupted: no
Slot B (_b)
priority: 14
tries_remaining: 7
successful_boot: no
verity_corrupted: no
Individual fields, if you need finer control:
bctltool get a priority
bctltool set a tries 7
bctltool set merge none
License
Dual-licensed, BSD-3-Clause or GPL-2.0-or-later, your choice.