os-detect-aosc

Crates.ioos-detect-aosc
lib.rsos-detect-aosc
version0.2.0
created_at2025-03-29 17:54:18.999685+00
updated_at2025-03-29 18:03:49.426365+00
descriptionDetect an OS installed on a partition (fork from pop-os/distinst)
homepage
repositoryhttps://github.com/aosc-dev/os-detect
max_upload_size
id1611489
size23,550
Mag Mell (eatradish)

documentation

README

os-detect

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);
    }
}
Commit count: 6

cargo fmt