A port of the Qualcomm Android bootctrl HAL for musl/glibc userspace.
Go to file
Caleb Connolly 7a5d5ee40e
make disk->hdr_bak actually be the GPT backup header
I do not know who thought this should be a "backup" copy of the primary
GPT header...
2023-06-23 17:22:39 +01:00
.clang-format cleanup, stub out tests 2022-06-04 15:51:22 +01:00
.gitignore gitignore: compile_commands.json 2023-05-15 20:25:59 +01:00
bootctrl_impl.cpp Revert "Use scope-based memory management for malloc, free, open, close, etc." 2023-06-23 13:30:08 +01:00
bootctrl_test.cpp cleanup, stub out tests 2022-06-04 15:51:22 +01:00
bootctrl.h cleanup, stub out tests 2022-06-04 15:51:22 +01:00
gpt-utils.cpp make disk->hdr_bak actually be the GPT backup header 2023-06-23 17:22:39 +01:00
gpt-utils.h Revert "Use scope-based memory management for malloc, free, open, close, etc." 2023-06-23 13:30:08 +01:00
LICENSE cleanup, stub out tests 2022-06-04 15:51:22 +01:00
meson.build cleanup, stub out tests 2022-06-04 15:51:22 +01:00
qbootctl.cpp Revert "Use scope-based memory management for malloc, free, open, close, etc." 2023-06-23 13:30:08 +01:00
README.md minor cleanups, improve error handling 2022-06-10 19:18:13 +01:00
ufs-bsg.cpp Revert "Use scope-based memory management for malloc, free, open, close, etc." 2023-06-23 13:30:08 +01:00
ufs-bsg.h minor cleanups, improve error handling 2022-06-10 19:18:13 +01:00
utils.h its ALIIIIIIVE 2022-06-04 04:42:40 +01:00

Qualcomm bootctl HAL for Linux

This HAL was pulled from AOSP source code and bastardised to build and run on a musl/glibc system. This may or may not render any hardware you run it on unusable, you have been warned.

Dependencies

  • zlib-dev
  • meson
  • cmake
  • linux-headers

Building

qbootctl uses the meson build system

meson build
meson compile -C build

Usage

qbootctl: qcom bootctrl HAL port for Linux
-------------------------------------------
qbootctl [-c|-m|-s|-u|-b|-n|-x] [SLOT]

    <no args>        dump slot info (default)
    -h               this help text
    -c               get the current slot
    -b SLOT          check if SLOT is marked as bootable
    -n SLOT          check if SLOT is marked as successful
    -x [SLOT]        get the slot suffix for SLOT (default: current)
    -s SLOT          set to active slot to SLOT
    -m [SLOT]        mark a boot as successful (default: current)
    -u [SLOT]        mark SLOT as unbootable (default: current)

Debugging

Set DEBUG to 1 in utils.h to enable debug logging.

Documentation

A more details explanation and a list of devices where qbootctl has been validated can be found on the postmarketOS wiki: