From f665490a4d8bce26c2b70fba94731c60c581ddbd Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Wed, 28 Apr 2021 07:50:15 -0400 Subject: [PATCH] Support 16 bit device numbers --- citadel-tool/src/boot/disks.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/citadel-tool/src/boot/disks.rs b/citadel-tool/src/boot/disks.rs index 7ab2734..cd1386e 100644 --- a/citadel-tool/src/boot/disks.rs +++ b/citadel-tool/src/boot/disks.rs @@ -10,8 +10,8 @@ use libcitadel::{Result, util}; #[derive(Debug)] pub struct DiskPartition { path: PathBuf, - major: u8, - minor: u8, + major: u16, + minor: u16, blocks: usize, } @@ -55,15 +55,15 @@ impl DiskPartition { bail!("could not parse"); } Ok(DiskPartition::from_line_components( - v[0].parse::()?, // Major - v[1].parse::()?, // Minor + v[0].parse::()?, // Major + v[1].parse::()?, // Minor v[2].parse::()?, // number of blocks v[3], )) // device name } // create a new `DiskPartion` from parsed components of line from /proc/partitions - fn from_line_components(major: u8, minor: u8, blocks: usize, name: &str) -> DiskPartition { + fn from_line_components(major: u16, minor: u16, blocks: usize, name: &str) -> DiskPartition { DiskPartition { path: PathBuf::from("/dev").join(name), major,