bb-flasher-sd

Crates.iobb-flasher-sd
lib.rsbb-flasher-sd
version1.0.0
created_at2025-03-07 17:51:22.941432+00
updated_at2025-03-29 10:28:57.330486+00
descriptionA library to flash OS images to SD Card
homepage
repositoryhttps://openbeagle.org/ayush1325/bb-imager-rs
max_upload_size
id1583400
size75,711
Ayush (Ayush1325)

documentation

README

SD Card Flasher

Library to flash SD cards with OS images. Powers sd card flashing in BeagleBoard Imager.

Also allows optional extra Customization for BeagleBoard images. Currently only supports sysconf based post-install configuration.

Platform Support

  • Linux
  • Windows
  • MacOS

Features

  • udev: Dynamic permissions on Linux. Mostly useful for GUI and flatpaks
  • macos_authopen: Dynamic permissions on MacOS.

Usage

use std::path::Path;
use std::fs::File;

fn main() {
    let dst = Path::new("/tmp/dummy");
    let img = || {
        Ok((File::open("/tmp/image")?, 1024))
    };
    let (tx, rx) = futures::channel::mpsc::channel(20);

    let flash_thread = std::thread::spawn(move || {
        bb_flasher_sd::flash(
            img,
            dst,
            Some(tx),
            None,
            None
        )
    });

    let msgs = futures::executor::block_on_stream(rx);
    for m in msgs {
        println!("{:?}", m);
    }

    flash_thread.join().unwrap().unwrap()
}
Commit count: 0

cargo fmt