The only C++ was for handling discovering and iterating over the
partitions PER block device, this was implemented in a really
overcomplicated way.
Simplify things, port everything over to c11 and drop the libstdc++
requirement entirely.
Allocate gpt_disk on stack, allocate when needed, rather than multiple
times for every partition.
Huge code cleanup, rerun clang-format, etc
Many changes here inspired by Eric's earlier work.
This commit introduced a lot of changes and seems to have caused a few
issues, including breaking crc32 generation. Revert it for now with the
intention to reimplement some of the improvements.
This reverts commit 9d7600df51.
If we are using C++, we might as well use scope-based memory management
for these things, cleaner and less error prone. Also removed
unnecessary gotos.
getting attributes work, setting them (e.g. with mark_boot_successful)
doesn't seem to work properly.
The IOCTL required to set the boot LUN doesn't work, some kernel driver
is missing for it.
This is a port of the Android bootctrl HAL and Qualcomms GPT based
implementation for musl/glibc based systems running mainline linux
Currently it doesn't work because the gpt hdr which is read doesn't
seem to have valid data.