Arnaud Ferraris 413ee35eda bootctrl: fall back to active slot if current slot not found in cmdline
While postmarketOS makes use of a kernel cmdline argument, this isn't
the case for all distros. Furthermore, this argument isn't present in
those added automatically by the Android bootloader.

In order to still be able to use `qbootctl` on other distros, this
change ensures we use the currently active slot as the current slot when
the cmdline argument is missing. This ensure `qbootctl -m` picks up the
correct slot more often than not, instead of always defaulting to `_a`.
2025-03-18 13:40:57 +00:00
2023-06-23 21:53:30 +01:00
2023-05-15 20:25:59 +01:00
2023-06-24 01:38:14 +01:00
2023-06-24 01:38:14 +01:00
2023-06-24 01:38:14 +01:00
2023-06-23 21:53:30 +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)
    -i               still write the GPT headers even if the UFS bLun can't be changed (default: false)

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:

Description
No description provided
Readme Multiple Licenses 227 KiB
Languages
C 99.4%
Meson 0.6%