Advance firmware and IOMMU support
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -35,6 +35,14 @@ pub struct FirmwareRegistry {
|
||||
}
|
||||
|
||||
impl FirmwareRegistry {
|
||||
pub fn empty(base_dir: &Path) -> Self {
|
||||
FirmwareRegistry {
|
||||
base_dir: base_dir.to_path_buf(),
|
||||
blobs: HashMap::new(),
|
||||
cache: Arc::new(Mutex::new(HashMap::new())),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(base_dir: &Path) -> Result<Self, BlobError> {
|
||||
if !base_dir.exists() {
|
||||
return Err(BlobError::DirNotFound(base_dir.to_path_buf()));
|
||||
|
||||
@@ -116,10 +116,20 @@ fn main() {
|
||||
firmware_dir.display()
|
||||
);
|
||||
|
||||
let registry = FirmwareRegistry::new(&firmware_dir).unwrap_or_else(|e| {
|
||||
error!("firmware-loader: fatal error: failed to initialize firmware registry: {e}");
|
||||
process::exit(1);
|
||||
});
|
||||
let registry = match FirmwareRegistry::new(&firmware_dir) {
|
||||
Ok(registry) => registry,
|
||||
Err(blob::BlobError::DirNotFound(_)) => {
|
||||
error!(
|
||||
"firmware-loader: firmware directory not found, starting with an empty registry: {}",
|
||||
firmware_dir.display()
|
||||
);
|
||||
FirmwareRegistry::empty(&firmware_dir)
|
||||
}
|
||||
Err(e) => {
|
||||
error!("firmware-loader: fatal error: failed to initialize firmware registry: {e}");
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
info!(
|
||||
"firmware-loader: indexed {} firmware blob(s) from {}",
|
||||
|
||||
Reference in New Issue
Block a user