10 Commits

Author SHA1 Message Date
Caleb Connolly
e9e86efb96 even even more rework, drop zlib dep
Also fix the mark_boot_successful feature which I broke earlier
2023-06-24 01:04:15 +01:00
Caleb Connolly
bca9aa5dd7 more rework, cleanup, port to pure C
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.
2023-06-24 00:06:02 +01:00
Caleb Connolly
04f4ac81ea rework, fixup, cleanup
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.
2023-06-23 21:53:30 +01:00
Caleb Connolly
75e30f8d09 Revert "Use scope-based memory management for malloc, free, open, close, etc."
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.
2023-06-23 13:30:08 +01:00
Eric Curtin
9d7600df51 Use scope-based memory management for malloc, free, open, close, etc.
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.
2023-05-29 01:26:29 +00:00
Caleb Connolly
e705c38010 add missing linux/limits.h
Needed for PATH_MAX
2023-05-15 20:26:28 +01:00
alefnode
df63d7c21c Fix to << uint32_t has not been declared >> 2023-05-04 09:15:29 +02:00
Richard Acayan
17ee1b8e65 detect and handle emmc-backed xbl partitions when switching slots 2022-08-31 17:49:18 -04:00
Caleb Connolly
4c49647382 cleanup, stub out tests
not sure how best to write tests, probably a larger test framework on
a board farm to test on real devices will be more sensible.
2022-06-04 15:51:22 +01:00
Caleb Connolly
2f5bf10269 initial commit
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.
2021-10-09 23:16:20 +01:00