Skip to content

Commit bb71f07

Browse files
committed
Use Permissive Serializers in order to collect errors without fail.
1 parent 5f9cc71 commit bb71f07

File tree

4 files changed

+675
-5
lines changed

4 files changed

+675
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ edition = "2018"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
amd-apcb = { git = "https://github.com/oxidecomputer/amd-apcb.git", tag = "v0.1.5", features = ["std", "serde", "schemars"] }
11-
amd-efs = { git = "ssh://git@github.com/oxidecomputer/amd-efs.git", tag = "v0.3.0", features = ["std", "serde", "schemars"] }
10+
amd-apcb = { git = "https://github.com/oxidecomputer/amd-apcb.git", branch = "issue-113", features = ["std", "serde", "schemars"] }
11+
amd-efs = { git = "ssh://git@github.com/oxidecomputer/amd-efs.git", branch = "issue-99", features = ["std", "serde", "schemars"] }
1212
amd-flash = { git = "ssh://git@github.com/oxidecomputer/amd-flash.git", tag = "v0.2.1", features = ["std"] }
1313
goblin = { version = "0.4", features = ["elf64", "endian_fd"] }
1414
#serde = { version = "1.0", default-features = false, features = ["derive"] }

amd-host-image-builder-config/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ edition = "2018"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
amd-apcb = { git = "https://github.com/oxidecomputer/amd-apcb.git", tag = "v0.1.5", features = ["std", "serde", "schemars"] }
10-
amd-efs = { git = "ssh://git@github.com/oxidecomputer/amd-efs.git", tag = "v0.3.0", features = ["std", "serde", "schemars"] }
9+
amd-apcb = { git = "https://github.com/oxidecomputer/amd-apcb.git", branch = "issue-113", features = ["std", "serde", "schemars"] }
10+
amd-efs = { git = "ssh://git@github.com/oxidecomputer/amd-efs.git", tag = "issue-99", features = ["std", "serde", "schemars"] }
1111
amd-flash = { git = "ssh://git@github.com/oxidecomputer/amd-flash.git", tag = "v0.2.1", features = ["std"] }
1212
schemars = "0.8.8"
1313
serde = { version = "1.0", default-features = false, features = ["derive"] }

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ use std::io::BufReader;
2525
use std::io::Read;
2626
use std::io::Seek;
2727
use std::io::SeekFrom;
28+
use std::io::stdout;
2829
use std::path::Path;
2930
use std::path::PathBuf;
3031
use structopt::StructOpt;
3132

3233
mod static_config;
3334
use amd_flash::allocators::{ArenaFlashAllocator, FlashAllocate};
3435

36+
mod serializers;
37+
use serializers::DummySerializer;
38+
3539
use amd_flash::{
3640
ErasableLocation, ErasableRange, FlashAlign, FlashRead, FlashWrite,
3741
Location,
@@ -699,11 +703,12 @@ fn dump_bhd_directory<'a, T: FlashRead + FlashWrite>(
699703
)
700704
.unwrap();
701705

706+
let apcb_options = ApcbIoOptions::builder().with_check_checksum(false).build();
702707
let apcb = Apcb::load(
703708
std::borrow::Cow::Borrowed(
704709
&mut apcb_buffer[..],
705710
),
706-
&ApcbIoOptions::default(),
711+
&apcb_options,
707712
)
708713
.unwrap();
709714
apcb.validate(None).unwrap(); // TODO: abl0 version ?

0 commit comments

Comments
 (0)