7c7399e0a6
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.
24 lines
806 B
Plaintext
24 lines
806 B
Plaintext
mod registers;
|
|
|
|
use std::env;
|
|
use std::process;
|
|
use log::{info, error, LevelFilter};
|
|
|
|
struct StderrLogger;
|
|
impl log::Log for StderrLogger {
|
|
fn enabled(&self, md: &log::Metadata) -> bool { md.level() <= LevelFilter::Info }
|
|
fn log(&self, r: &log::Record) { eprintln!("[{}] ohcid: {}", r.level(), r.args()); }
|
|
fn flush(&self) {}
|
|
}
|
|
|
|
fn main() {
|
|
log::set_logger(&StderrLogger).ok();
|
|
log::set_max_level(LevelFilter::Info);
|
|
let channel_fd: usize = match env::var("PCID_CLIENT_CHANNEL") {
|
|
Ok(s) => match s.parse() { Ok(fd) => fd, Err(_) => { error!("invalid PCID_CLIENT_CHANNEL"); process::exit(1); } },
|
|
Err(_) => { error!("PCID_CLIENT_CHANNEL not set"); process::exit(1); }
|
|
};
|
|
info!("OHCI USB 1.1 controller (PCI fd: {})", channel_fd);
|
|
info!("ohcid: ready");
|
|
}
|