Recompile bzImage if payload is changed

This commit is contained in:
Tao Su 2025-09-24 23:48:39 -04:00 committed by Junyang Zhang
parent 9a99af1170
commit fc114019d6
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use std::{path::PathBuf, process::Command};
fn main() {
let source_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
let payload_file = PathBuf::from(std::env::var("PAYLOAD_FILE").unwrap());
let target_arch = std::env::var("TARGET").unwrap();
if target_arch.starts_with("x86_64") {
@ -25,6 +26,7 @@ fn main() {
.expect("failed to run the preprocessor");
assert!(status.success(), "the preprocessor exits with failure");
println!("cargo:rerun-if-changed={}", payload_file.display());
println!("cargo:rerun-if-changed={}", lds.display());
println!("cargo:rustc-link-arg=-T{}", out_lds.display());
} else {