Skip to content

Commit f7babd4

Browse files
committed
tools: allow gating board ROM image on feature
1 parent 90af4b6 commit f7babd4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tools/helios-build/src/main.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use helios_build_utils::metadata::{self, ArchiveType};
1010
use helios_build_utils::tree;
1111
use serde::Deserialize;
1212
use slog::Logger;
13-
use std::collections::HashMap;
13+
use std::collections::{HashMap, HashSet};
1414
use std::fs::File;
1515
use std::io::{BufReader, Read, Write};
1616
use std::os::unix::fs::PermissionsExt;
@@ -1314,6 +1314,7 @@ impl Publishers {
13141314
struct Board {
13151315
efs: Option<String>,
13161316
app: String,
1317+
feature: Option<String>,
13171318
}
13181319

13191320
impl Board {
@@ -1599,6 +1600,7 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
15991600
let templates = top_path(&["image", "templates"])?;
16001601
let brand_extras = rel_path(Some(&tempdir), &["omicron1"])?;
16011602
let projects_extras = top_path(&["projects"])?;
1603+
let features = res.opt_strs("F").into_iter().collect::<HashSet<_>>();
16021604
std::fs::create_dir_all(&brand_extras)?;
16031605
let basecmd = || -> Command {
16041606
let mut cmd = Command::new("pfexec");
@@ -1633,7 +1635,7 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
16331635
if recovery {
16341636
cmd.arg("-F").arg("recovery");
16351637
}
1636-
for farg in res.opt_strs("F") {
1638+
for farg in &features {
16371639
cmd.arg("-F").arg(farg);
16381640
}
16391641
cmd
@@ -1968,6 +1970,15 @@ fn cmd_image(ca: &CommandArg) -> Result<()> {
19681970
* Go through and create the per-board ROM images.
19691971
*/
19701972
for (name, board) in target_boards.iter() {
1973+
if let Some(feat) = &board.feature {
1974+
if !features.contains(feat) {
1975+
info!(
1976+
log,
1977+
"skipping building ROM for {name} ('{feat}' disabled)"
1978+
);
1979+
continue;
1980+
}
1981+
}
19711982
info!(log, "building ROM for {name}");
19721983

19731984
let romname = format!("{name}.rom");

0 commit comments

Comments
 (0)