Skip to content

Detect an OS installed on a partition (fork from pop-os/distinst)

License

Notifications You must be signed in to change notification settings

AOSC-Dev/os-detect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Detect an OS installed on a partition (fork from pop-os/distinst)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages