From 8746fc5a760832ac7cfb06201ef45e1728f99983 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 26 Apr 2024 18:12:47 +0800 Subject: [PATCH] add --with-jump flag for image creation of cramium target --- xtask/src/builder.rs | 61 ++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 189a70054..1254e14a7 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -865,25 +865,48 @@ impl Builder { return Err("cargo build failed".into()); } - let status = Command::new(cargo()) - .current_dir(project_root()) - .args([ - "run", - "--package", - "tools", - "--bin", - "sign-image", - "--", - "--loader-image", - loader_presign.to_str().unwrap(), - "--loader-key", - &self.loader_key, - "--loader-output", - loader_bin.to_str().unwrap(), - "--min-xous-ver", - &self.min_ver, - ]) - .status()?; + let status = if self.utra_target.contains("cramium") { + Command::new(cargo()) + .current_dir(project_root()) + .args([ + "run", + "--package", + "tools", + "--bin", + "sign-image", + "--", + "--loader-image", + loader_presign.to_str().unwrap(), + "--loader-key", + &self.loader_key, + "--loader-output", + loader_bin.to_str().unwrap(), + "--min-xous-ver", + &self.min_ver, + "--with-jump", // cramium target has a jump inserted in the loader sig block + ]) + .status()? + } else { + Command::new(cargo()) + .current_dir(project_root()) + .args([ + "run", + "--package", + "tools", + "--bin", + "sign-image", + "--", + "--loader-image", + loader_presign.to_str().unwrap(), + "--loader-key", + &self.loader_key, + "--loader-output", + loader_bin.to_str().unwrap(), + "--min-xous-ver", + &self.min_ver, + ]) + .status()? + }; if !status.success() { return Err("loader image sign failed".into()); }