ksud: add boot-info cli

This commit is contained in:
weishu
2024-03-23 10:46:16 +08:00
parent b2d0de325f
commit ef92c32729
3 changed files with 53 additions and 7 deletions

View File

@@ -37,3 +37,13 @@ pub fn copy_assets_to_file(name: &str, dst: impl AsRef<Path>) -> Result<()> {
std::fs::write(dst, asset.data)?;
Ok(())
}
pub fn list_supported_kmi() -> Result<Vec<String>> {
let mut list = Vec::new();
for file in Asset::iter() {
if let Some(kmi) = file.strip_suffix(".ko") {
list.push(kmi.to_string());
}
}
Ok(list)
}