From 0692a2532383275c4e74c752dcbdda2e64c70ded Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 8 Jan 2024 02:33:27 +0800 Subject: [PATCH] fix cramium build targets --- loader/Cargo.toml | 6 +++--- loader/src/main.rs | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/loader/Cargo.toml b/loader/Cargo.toml index 100918aa6..9e5f91b4d 100644 --- a/loader/Cargo.toml +++ b/loader/Cargo.toml @@ -11,7 +11,7 @@ curve25519-dalek-loader = { path = "curve25519-dalek-loader", default-features = utralib = { version = "0.1.23", optional = true, default-features = false } armv7 = { git = "https://github.com/Foundation-Devices/armv7.git", branch = "update", optional = true } atsama5d27 = { git = "https://github.com/Foundation-Devices/atsama5d27.git", branch = "master", optional = true } -sha2-loader = { path = "./sha2-loader", default-features = false } +sha2-loader = { path = "./sha2-loader", default-features = false, optional = true } [dependencies.com_rs] git = "https://github.com/betrusted-io/com_rs" @@ -21,8 +21,8 @@ branch = "main" lazy_static = "1.4.0" [features] -precursor = ["utralib/precursor", "ed25519-dalek-loader/precursor", "curve25519-dalek-loader/precursor", "resume", "secboot"] -renode = ["utralib/renode", "ed25519-dalek-loader/renode", "curve25519-dalek-loader/renode", "resume", "secboot"] +precursor = ["utralib/precursor", "ed25519-dalek-loader/precursor", "curve25519-dalek-loader/precursor", "resume", "secboot", "sha2-loader"] +renode = ["utralib/renode", "ed25519-dalek-loader/renode", "curve25519-dalek-loader/renode", "resume", "secboot", "sha2-loader"] cramium-soc = ["utralib/cramium-soc", "debug-print", "simulation-only"] cramium-fpga = ["utralib/cramium-fpga", "debug-print", "simulation-only"] atsama5d27 = ["utralib/atsama5d27", "armv7", "dep:atsama5d27"] diff --git a/loader/src/main.rs b/loader/src/main.rs index 3314eb7b9..90f8c7706 100644 --- a/loader/src/main.rs +++ b/loader/src/main.rs @@ -84,6 +84,8 @@ pub unsafe extern "C" fn rust_entry(signed_buffer: *const usize, signature: u32) // how data is loaded into memory #[cfg(feature = "secboot")] let mut fs_prehash = [0u8; 64]; + #[cfg(not(feature = "secboot"))] + let fs_prehash = [0u8; 64]; #[cfg(feature = "secboot")] if !secboot::validate_xous_img(signed_buffer as *const u32, &mut fs_prehash) { loop {}