Skip to content

Commit

Permalink
Support populating SVNs in image builder
Browse files Browse the repository at this point in the history
FMC and RT SVNs are controlled by the vendor. Add an option to the image
builder to specify these SVNs from the command-line.
  • Loading branch information
jhand2 committed Jan 9, 2025
1 parent 8730762 commit 1d4f813
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions builder/bin/image_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ fn main() {
.value_parser(value_parser!(PathBuf)),
)
.arg(arg!(--"fw" [FILE] "FW bundle image").value_parser(value_parser!(PathBuf)))
.arg(
arg!(--"fmc-svn" [FILE] "Security Version Number of FMC firmware image")
.value_parser(value_parser!(u32)),
)
.arg(
arg!(--"rt-svn" [FILE] "Security Version Number of RT firmware image")
.value_parser(value_parser!(u32)),
)
.arg(
arg!(--"all_elfs" [DIR] "Build all firmware elf files")
.value_parser(value_parser!(PathBuf)),
Expand All @@ -41,6 +49,18 @@ fn main() {
std::fs::write(path, rom).unwrap();
}

let fmc_svn = if let Some(fmc) = args.get_one::<u32>("fmc-svn") {
*fmc
} else {
0
};

let app_svn = if let Some(rt) = args.get_one::<u32>("rt-svn") {
*rt
} else {
0
};

if let Some(path) = args.get_one::<PathBuf>("fw") {
// Generate Image Bundle
let image = caliptra_builder::build_and_sign_image(
Expand All @@ -49,6 +69,8 @@ fn main() {
ImageOptions {
fmc_version: version::get_fmc_version(),
app_version: version::get_runtime_version(),
fmc_svn,
app_svn,
..Default::default()
},
)
Expand All @@ -64,6 +86,8 @@ fn main() {
ImageOptions {
fmc_version: version::get_fmc_version(),
app_version: version::get_runtime_version(),
fmc_svn,
app_svn,
..Default::default()
},
)
Expand Down

0 comments on commit 1d4f813

Please sign in to comment.