Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions cli/src/programfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,27 @@ fn parse_read_cmd<T: QdlChan>(
let start_sector = attrs.get("start_sector").unwrap().parse::<u32>().unwrap();

if checksum_only {
return firehose_checksum_storage(channel, num_sectors, phys_part_idx, start_sector);
return Ok(firehose_checksum_storage(
channel,
num_sectors,
phys_part_idx,
start_sector,
)?);
}

if !attrs.contains_key("filename") {
bail!("Got '<read>' tag without a filename");
}
let mut outfile = fs::File::create(out_dir.join(attrs.get("filename").unwrap()))?;

firehose_read_storage(
Ok(firehose_read_storage(
channel,
&mut outfile,
num_sectors,
slot,
phys_part_idx,
start_sector,
)
)?)
}

fn parse_patch_cmd<T: QdlChan>(
Expand Down Expand Up @@ -77,15 +82,15 @@ fn parse_patch_cmd<T: QdlChan>(
let start_sector = attrs.get("start_sector").unwrap();
let val = attrs.get("value").unwrap();

firehose_patch(
Ok(firehose_patch(
channel,
byte_off,
slot,
phys_part_idx,
size,
start_sector,
val,
)
)?)
}

const BOOTABLE_PART_NAMES: [&str; 3] = ["xbl", "xbl_a", "sbl1"];
Expand Down Expand Up @@ -158,15 +163,15 @@ fn parse_program_cmd<T: QdlChan>(
sector_size as i64 * file_sector_offset as i64,
))?;

firehose_program_storage(
Ok(firehose_program_storage(
channel,
&mut buf,
label,
num_sectors,
slot,
phys_part_idx,
start_sector,
)
)?)
}

// TODO: there's some funny optimizations to make here, such as OoO loading files into memory, or doing things while we're waiting on the device to finish
Expand Down
4 changes: 2 additions & 2 deletions cli/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ pub fn read_storage_logical_partition<T: QdlChan>(
.ok_or(Error::from(ErrorKind::NotFound))?
.1;

firehose_read_storage(
Ok(firehose_read_storage(
channel,
out,
(part.ending_lba - part.starting_lba + 1) as usize,
slot,
phys_part_idx,
part.starting_lba as u32,
)
)?)
}
2 changes: 1 addition & 1 deletion qdl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ path = "src/lib.rs"

[dependencies]
anstream = "0.6.15"
anyhow = "1.0"
bincode = "1.3.3"
indexmap = "2.5.0"
owo-colors = "4.1.0"
Expand All @@ -28,6 +27,7 @@ rusb = { version = "0.9.4", optional = true }
serde = { version = "1.0.210", features = ["derive"] }
serde_repr = "0.1.19"
serial2 = { version = "0.2.28", optional = true }
thiserror = "2.0.17"
xmltree = { version = "0.11.0", features = ["attribute-order"] }

[features]
Expand Down
Loading