Skip to content

Commit

Permalink
Writes partition header
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Nov 9, 2024
1 parent bfb3462 commit ee94fbb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dumper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn run<K: Kernel>(k: K) {
let lock = unsafe { MtxLock::new(k, (*mp).mtx()) };

ok = if unsafe { (*mp).flags() & K::MNT_RDONLY != 0 } {
unsafe { dump_mount(mp, lock) }
unsafe { dump_mount(k, fd.as_raw_fd(), mp, lock) }
} else {
drop(lock);
true
Expand Down Expand Up @@ -150,7 +150,16 @@ fn run<K: Kernel>(k: K) {
}
}

unsafe fn dump_mount<K: Kernel>(_: *mut K::Mount, _: MtxLock<K>) -> bool {
unsafe fn dump_mount<K: Kernel>(k: K, fd: c_int, _: *mut K::Mount, _: MtxLock<K>) -> bool {
// Write header.
if !write_dump(
k,
fd,
core::slice::from_ref(&FirmwareDump::<()>::ITEM_PARTITION),
) {
return false;
}

true
}

Expand Down

0 comments on commit ee94fbb

Please sign in to comment.