Support extracting any partition from payload.bin

This commit is contained in:
topjohnwu
2023-05-25 23:45:38 -07:00
committed by John Wu
parent ec31cab5a7
commit 659b9c6fee
14 changed files with 203 additions and 116 deletions
+5 -2
View File
@@ -1,5 +1,7 @@
#![feature(format_args_nl)]
extern crate core;
pub use base;
pub use payload::*;
@@ -8,14 +10,15 @@ mod update_metadata;
#[cxx::bridge]
pub mod ffi {
extern "C++" {
unsafe extern "C++" {
include!("compress.hpp");
pub unsafe fn decompress(in_: *const u8, in_size: u64, fd: i32) -> bool;
fn decompress(buf: &[u8], fd: i32) -> bool;
}
#[namespace = "rust"]
extern "Rust" {
unsafe fn extract_boot_from_payload(
partition: *const c_char,
in_path: *const c_char,
out_path: *const c_char,
) -> bool;