From bfede0a1f8d33d34e92571196f70e7daa8d016b0 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 26 Sep 2025 22:57:39 +0800 Subject: [PATCH] update builder api to match latest features for image signing --- xtask/src/builder.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 9757ffded..bd163b93c 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -893,6 +893,19 @@ impl Builder { if !status.success() { return Err("cargo build failed".into()); } else { + // bao1x bootloader targets. Figure out if it's boot0 or boot1 + let function_code = match self.loader { + CrateSpec::Local(name, _) => { + if name == "bao1x-boot0" { + "boot0" + } else if name == "bao1x-boot1" { + "boot1" + } else { + return Err(String::from("Target subtype not supported").into()); + } + } + _ => return Err(String::from("Can't determine bootloader region").into()), + }; Command::new(cargo()) .current_dir(project_root()) .args([ @@ -913,6 +926,9 @@ impl Builder { "--sig-length", &self.sigblock_size.to_string(), "--with-jump", // bao1x target has a jump inserted in the loader sig block + "--bao1x", + "--function-code", + function_code, ]) .status()?; return Ok(());