MCPcopy Create free account
hub / github.com/bootc-dev/bootc / list_dev

Function list_dev

crates/blockdev/src/blockdev.rs:457–470  ·  view source on GitHub ↗
(dev: &Utf8Path)

Source from the content-addressed store, hash-verified

455
456#[context("Listing device {dev}")]
457pub fn list_dev(dev: &Utf8Path) -> Result<Device> {
458 let mut devs: DevicesOutput = Command::new("lsblk")
459 .args(["-J", "-b", "-O"])
460 .arg(dev)
461 .log_debug()
462 .run_and_parse_json()?;
463 for dev in devs.blockdevices.iter_mut() {
464 dev.backfill_missing()?;
465 }
466 devs.blockdevices
467 .into_iter()
468 .next()
469 .ok_or_else(|| anyhow!("no device output from lsblk for {dev}"))
470}
471
472#[context("Finding block device for ZFS dataset {dataset}")]
473fn list_dev_for_zfs_dataset(dataset: &str) -> Result<Device> {

Callers 9

install_via_ziplFunction · 0.85
install_to_filesystemFunction · 0.85
run_from_optFunction · 0.85
mkfsFunction · 0.85
install_create_rootfsFunction · 0.85
refreshMethod · 0.85
find_all_rootsMethod · 0.85
list_dev_for_zfs_datasetFunction · 0.85
list_dev_by_dirFunction · 0.85

Calls 7

run_and_parse_jsonMethod · 0.80
log_debugMethod · 0.80
argMethod · 0.80
argsMethod · 0.80
backfill_missingMethod · 0.80
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected