Skip to content

Commit 9e3c384

Browse files
committed
lib/blockdev: Handle devicemapper path
Bootc install to-disk command fails to recognize correct path of device-mapper devices. As a result bootc install command on device-mapper fails with Wiping /dev/mpathe1 Wiping device /dev/mpathe1 wipefs: error: /dev/mpathe1: probing initialization failed: No such file or directory ERROR Installing to disk: Creating rootfs: Failed to wipe /dev/mpathe1: Task Wiping device /dev/mpathe1 failed: ExitStatus(unix_wait_status(256)) Make sure the device name is captured correctly. Results with the fix: Wiping /dev/mapper/mpathe1 Wiping device /dev/mapper/mpathe1 Wiping /dev/mapper/mpathe2 Wiping device /dev/mapper/mpathe2 Wiping /dev/mapper/mpathe Wiping device /dev/mapper/mpathe Thanks to Dharaneeshwaran for debugging the problem. Signed-off-by: Sachin Sant <[email protected]>
1 parent affc8b9 commit 9e3c384

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/blockdev.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ pub(crate) struct Device {
3737
// Filesystem-related properties
3838
pub(crate) label: Option<String>,
3939
pub(crate) fstype: Option<String>,
40+
pub(crate) path: Option<String>,
4041
}
4142

4243
impl Device {
4344
#[allow(dead_code)]
4445
// RHEL8's lsblk doesn't have PATH, so we do it
4546
pub(crate) fn path(&self) -> String {
46-
format!("/dev/{}", &self.name)
47+
self.path.clone().unwrap_or(format!("/dev/{}", &self.name))
4748
}
4849

4950
pub(crate) fn has_children(&self) -> bool {

0 commit comments

Comments
 (0)