Skip to content
Merged
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
29 changes: 14 additions & 15 deletions src/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use intel_fw::{
fit::Fit,
ifd::{FlashMasterV1, FlashMasterV2, IFD},
me::{Generation, ME},
part::{gen2::Gen2Partition, gen3::Gen3Partition, partitions::Partitions},
part::{fpt::FTUP, gen2::Gen2Partition, gen3::Gen3Partition, partitions::Partitions},
};

fn print_gen2_dir(dir: &Gen2Dir) {
Expand Down Expand Up @@ -73,24 +73,23 @@ fn print_me(me: &ME) {
println!("Partitions and directories:");
println!();
for p in parts {
match p {
Gen2Partition::Dir(dir) => {
print_gen2_dir(&dir.dir);
}
_ => {}
if let Gen2Partition::Dir(dir) = p {
print_gen2_dir(&dir.dir);
}
}
}
Partitions::Gen3(parts) => {
println!("Partitions and directories:");
println!();
for p in parts {
match p {
Gen3Partition::Dir(dir) => {
let d = &dir.cpd;
println!("{d}");
if let Gen3Partition::Dir(dir) = p {
let d = &dir.cpd;
if d.name == FTUP {
// FTUP contains NFTP and potentially WCOD and LOCL.
// Skip it to avoid redundant printing.
continue;
}
_ => {}
println!("{d}");
}
}
}
Expand Down Expand Up @@ -148,18 +147,18 @@ pub fn show(fw: &Firmware, verbose: bool) {
match &fw.ifd {
Ok(ifd) => {
let ver = get_ifd_ver(&fw.me);
print_ifd(&ifd, ver);
print_ifd(ifd, ver);
}
Err(e) => warn!("Could not parse IFD: {e:?}"),
}
if let Some(me_res) = &fw.me {
match me_res {
Ok(me) => {
if let Ok(ifd) = &fw.ifd {
print_me_soft_config(&me, &ifd);
print_me_soft_config(me, ifd);
println!();
}
print_me(&me);
print_me(me);
}
Err(e) => error!("ME firmware could not be parsed: {e:?}"),
}
Expand All @@ -168,7 +167,7 @@ pub fn show(fw: &Firmware, verbose: bool) {
}
println!();
match &fw.fit {
Ok(fit) => print_fit(&fit),
Ok(fit) => print_fit(fit),
Err(e) => warn!("Could not parse FIT: {e:?}"),
}
println!();
Expand Down