fix(core/build): include btconly in pub/ firmware filename
What changed, and why it matters
This commit fixes a build-script naming issue. When building a Bitcoin-only version of the Trezor firmware, the output filename in the published artifacts folder now includes 'btconly' so it is not confused with the regular firmware file. There is no change to device security, cryptography, or firmware behavior.
No security action required. This is a build/artifact labeling fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is in the Rust xtask build helpers. publish_artifact() gains an optional infix parameter inserted between the model ID and version string in the output filename. cargo.rs passes Some("btconly") when the project is Firmware and the btc_only flag is set. combine.rs passes None because combined artifacts already use a combined- prefix. This is purely a filename/artifact organization fix.
Changed components
core/embed/xtask/src/cargo.rscore/embed/xtask/src/combine.rscore/embed/xtask/src/postbuild.rsInspect captured patch +17 / −2
diff --git a/core/embed/xtask/src/cargo.rs b/core/embed/xtask/src/cargo.rs
index 23289a5e..32c47d59 100644
--- a/core/embed/xtask/src/cargo.rs
+++ b/core/embed/xtask/src/cargo.rs
@@ -141,7 +141,16 @@ fn build_impl(args: BuildArgs, is_dependency: bool) -> Result<()> {
// Copy the final binary to the `pub` directory
if !matches!(args.project, Project::Secmon | Project::Kernel) {
let version_file = helpers::get_version_file(args.project)?;
- postbuild::publish_artifact(&bin, args.project, args.model, &version_file, None)?;
+ let infix =
+ (matches!(args.project, Project::Firmware) && args.btc_only).then_some("btconly");
+ postbuild::publish_artifact(
+ &bin,
+ args.project,
+ args.model,
+ &version_file,
+ None,
+ infix,
+ )?;
}
}
diff --git a/core/embed/xtask/src/combine.rs b/core/embed/xtask/src/combine.rs
index b9fe7faf..dc8b8869 100644
--- a/core/embed/xtask/src/combine.rs
+++ b/core/embed/xtask/src/combine.rs
@@ -134,6 +134,7 @@ pub fn combine(args: CombineArgs) -> Result<()> {
args.model,
&version_file,
Some(COMBINED_PREFIX),
+ None,
)?;
Ok(())
diff --git a/core/embed/xtask/src/postbuild.rs b/core/embed/xtask/src/postbuild.rs
index 3820ec9e..e8e280d4 100644
--- a/core/embed/xtask/src/postbuild.rs
+++ b/core/embed/xtask/src/postbuild.rs
@@ -264,23 +264,28 @@ pub fn merge_compile_commands(inputs: &[&Path], output: &Path) -> Result<()> {
/// Copies a built binary to `artifacts/pub`.
/// The filename includes the project, model, version, git revision,
/// and dirty state, for example `bootloader-T3W1-2.1.17-9e4bbc68-dirty.bin`.
+/// Prefix goes at the very beginning of the filename. Infix goes between
+/// model and version.
pub fn publish_artifact(
binary: &Path,
project: Project,
model: Model,
version_file: &Path,
prefix: Option<&str>,
+ infix: Option<&str>,
) -> Result<()> {
let pub_dir = helpers::publish_dir()?;
helpers::ensure_directory(&pub_dir)?;
let prefix = prefix.unwrap_or("");
+ let infix = infix.map(|s| format!("-{s}")).unwrap_or("".into());
let name = format!(
- "{}{}-{}-{}-{}{}.bin",
+ "{}{}-{}{}-{}-{}{}.bin",
prefix,
project.binary_name(),
model.model_id(),
+ infix,
&helpers::parse_version_file(version_file)?,
&helpers::git_revision()?[..8],
if helpers::git_modified()? {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.