Crates.io | liblitho |
lib.rs | liblitho |
version | 0.1.0 |
source | src |
created_at | 2024-06-02 19:39:03.422271 |
updated_at | 2024-06-02 19:39:03.422271 |
description | cli tool to flash/clone the images to storage devices |
homepage | |
repository | https://github.com/girish946/litho |
max_upload_size | |
id | 1259439 |
size | 50,437 |
A simple and lightweight library and CLI tool to write images to block devices.
litho clone --help
Usage: litho clone [OPTIONS] --file <FILE> --device <DEVICE>
Options:
-f, --file <FILE> file to which device should be cloned
-d, --device <DEVICE> device
-b, --block-size <BLOCK_SIZE> block size
-s, --silent <SILENT> message to be published [possible values: true, false]
-h, --help Print help
litho flash --help
Usage: litho flash [OPTIONS] --file <FILE> --device <DEVICE>
Options:
-f, --file <FILE> file to be written to the device
-d, --device <DEVICE> device
-b, --block-size <BLOCK_SIZE> block size
-s, --silent <SILENT> message to be published [possible values: true, false]
-h, --help Print help
use litho::clone;
let image = "/home/user/image-file.img".to_string();
let device = "/dev/sda".to_string();
let block_size = 4096;
fn callback_fn(percentage: f64) {
println!("{percentage}%");
}
litho::clone(image, device, block_size as usize, false, callback);
use litho::flash
let image = "/home/user/image-file.img".to_string();
let device = "/dev/sda".to_string();
let block_size = 4096;
fn callback_fn(percentage: f64) {
println!("{percentage}%");
}
litho::flash(image, device, block_size as usize, false, callback);