Add support for packing and unpacking logical partition images

This supports both empty and normal LP images, including those that span
multiple files/devices.

Currently, repacked files are semantically equivalent, but not exactly
identical. avbroot's data structure for the metadata does not preserve
the arbitrary partition ordering of the LP image. Instead, to make the
API a bit nicer, it only preserves the relative partition ordering
within partition groups.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
Andrew Gunnerson
2024-08-27 23:28:20 -04:00
parent dd40f64918
commit 13c910274e
11 changed files with 3057 additions and 3 deletions
+21
View File
@@ -0,0 +1,21 @@
#[cfg(not(windows))]
mod fuzz {
use std::io::Cursor;
use avbroot::{format::lp::Metadata, stream::FromReader};
use honggfuzz::fuzz;
pub fn main() {
loop {
fuzz!(|data: &[u8]| {
let reader = Cursor::new(data);
let _ = Metadata::from_reader(reader);
});
}
}
}
fn main() {
#[cfg(not(windows))]
fuzz::main();
}