| Crates.io | bb-flasher-sd |
| lib.rs | bb-flasher-sd |
| version | 1.0.0 |
| created_at | 2025-03-07 17:51:22.941432+00 |
| updated_at | 2025-03-29 10:28:57.330486+00 |
| description | A library to flash OS images to SD Card |
| homepage | |
| repository | https://openbeagle.org/ayush1325/bb-imager-rs |
| max_upload_size | |
| id | 1583400 |
| size | 75,711 |
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.
udev: Dynamic permissions on Linux. Mostly useful for GUI and flatpaksmacos_authopen: Dynamic permissions on MacOS.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()
}