feat: recipe durability guard — prevents build system from deleting local recipes
Add guard-recipes.sh with four modes: - --verify: check all local/recipes have correct symlinks into recipes/ - --fix: repair broken symlinks (run before builds) - --save-all: snapshot all recipe.toml into local/recipes/ - --restore: recreate all symlinks from local/recipes/ (run after sync-upstream) Wired into apply-patches.sh (post-patch) and sync-upstream.sh (post-sync). This prevents the build system from deleting recipe files during cargo cook, make distclean, or upstream source refresh.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
use std::env;
|
||||
use std::process;
|
||||
use std::time::Duration;
|
||||
use log::{info, error, LevelFilter};
|
||||
|
||||
struct StderrLogger;
|
||||
impl log::Log for StderrLogger {
|
||||
fn enabled(&self, m: &log::Metadata) -> bool { m.level() <= LevelFilter::Info }
|
||||
fn log(&self, r: &log::Record) { eprintln!("[{}] cpufreqd: {}", r.level(), r.args()); }
|
||||
fn flush(&self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
log::set_logger(&StderrLogger).ok();
|
||||
log::set_max_level(LevelFilter::Info);
|
||||
|
||||
let governor = env::var("CPUFREQ_GOVERNOR").unwrap_or_else(|_| "ondemand".to_string());
|
||||
info!("cpufreqd: CPU frequency scaling daemon starting (governor={})", governor);
|
||||
info!("cpufreqd: supported governors: performance, powersave, ondemand");
|
||||
info!("cpufreqd: MSR access via /dev/cpu/*/msr (needs kernel support)");
|
||||
info!("cpufreqd: ready");
|
||||
|
||||
loop {
|
||||
std::thread::sleep(Duration::from_secs(5));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user