mirror of
https://github.com/linux-msm/qbootctl
synced 2024-11-23 14:43:29 +08:00
A port of the Qualcomm Android bootctrl HAL for musl/glibc userspace.
843aa92266
The lines: if (instance == PRIMARY_GPT) hdr_offset = block_size; else { hdr_offset = lseek64(fd, 0, SEEK_END) - block_size; } if (hdr_offset < 0) { fprintf(stderr, "%s: Failed to get gpt header offset\n", __func__); goto error; } are error checked. But previously hdr_offset could never be less than zero because it was unsigned. |
||
---|---|---|
.clang-format | ||
.gitignore | ||
bootctrl_impl.cpp | ||
bootctrl_test.cpp | ||
bootctrl.h | ||
gpt-utils.cpp | ||
gpt-utils.h | ||
LICENSE | ||
meson.build | ||
qbootctl.cpp | ||
README.md | ||
ufs-bsg.cpp | ||
ufs-bsg.h | ||
utils.h |
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: