Crates.io | os-detect-aosc |
lib.rs | os-detect-aosc |
version | |
source | src |
created_at | 2025-03-29 17:54:18.999685+00 |
updated_at | 2025-03-29 18:03:49.426365+00 |
description | Detect an OS installed on a partition (fork from pop-os/distinst) |
homepage | |
repository | https://github.com/aosc-dev/os-detect |
max_upload_size | |
id | 1611489 |
Cargo.toml error: | TOML parse error at line 21, column 1 | 21 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust crate for detecting the existence of an OS from an unmounted device, or path.
use os_detect::detect_os_from_device;
use std::path::Path;
pub fn main() {
let device_path = &Path::new("/dev/sda3");
let fs = "ext4";
if let Some(os) = detect_os_from_device(device_path, fs) {
println!("{:#?}", os);
}
}