Files
RedBear-OS/local/recipes/drivers/ohcid/source/src/main.rs.bak
T
vasilito 7c7399e0a6 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.
2026-04-30 18:47:03 +01:00

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");
}