USB-AIO für automatische Geräteprüfung
Some checks failed
Tests / test (push) Has been cancelled

This commit is contained in:
2026-10-14 20:14:36 +02:00
commit 81f06cf6b4
40 changed files with 9956 additions and 0 deletions

39
gui/build.rs Normal file
View File

@@ -0,0 +1,39 @@
use std::{env, fs, path::Path};
fn main() {
println!("cargo:rerun-if-env-changed=CSR_BUILD_ID");
println!("cargo:rerun-if-changed=src");
println!("cargo:rerun-if-changed=../scripts/inventory-sync.py");
println!("cargo:rerun-if-changed=Cargo.lock");
fn hash_dir(path: &Path, hash: &mut u64) {
let mut files: Vec<_> = fs::read_dir(path)
.unwrap()
.flatten()
.map(|e| e.path())
.collect();
files.sort();
for p in files {
if p.is_dir() {
hash_dir(&p, hash);
} else {
for b in fs::read(p).unwrap() {
*hash = (*hash ^ b as u64).wrapping_mul(1099511628211);
}
}
}
}
let mut hash = 14695981039346656037u64;
hash_dir(Path::new("src"), &mut hash);
for file in [
"../scripts/inventory-sync.py",
"Cargo.toml",
"Cargo.lock",
"build.rs",
] {
for b in fs::read(file).unwrap() {
hash = (hash ^ b as u64).wrapping_mul(1099511628211);
}
}
let id = env::var("CSR_BUILD_ID")
.unwrap_or_else(|_| format!("{}-{hash:016x}", env::var("CARGO_PKG_VERSION").unwrap()));
println!("cargo:rustc-env=CSR_BUILD_ID={id}");
}