@@ -30,16 +30,16 @@ pub fn get_devices<P: AsRef<Path>>(target_root: P) -> Result<Vec<String>> {
3030}
3131
3232// Get single device for the target root
33- pub fn get_single_device < P : AsRef < Path > > ( target_root : P ) -> Result < String > {
34- let mut devices = get_devices ( & target_root ) ? . into_iter ( ) ;
33+ pub fn get_single_device ( ) -> Result < String > {
34+ let mut devices = get_parent_devices ( None ) . iter ( ) ;
3535 let Some ( parent) = devices. next ( ) else {
3636 anyhow:: bail!( "Failed to find parent device" ) ;
3737 } ;
3838
3939 if let Some ( next) = devices. next ( ) {
4040 anyhow:: bail!( "Found multiple parent devices {parent} and {next}; not currently supported" ) ;
4141 }
42- Ok ( parent)
42+ Ok ( parent. to_string ( ) )
4343}
4444
4545/// Find esp partition on the same device
@@ -58,11 +58,11 @@ pub fn get_esp_partition(device: &str) -> Result<Option<String>> {
5858 Ok ( None )
5959}
6060
61- /// Find all ESP partitions on the devices with mountpoint boot
61+ /// Find all ESP partitions on the devices
6262#[ allow( dead_code) ]
63- pub fn find_colocated_esps < P : AsRef < Path > > ( target_root : P ) -> Result < Vec < String > > {
63+ pub fn find_colocated_esps ( ) -> Result < Vec < String > > {
6464 // first, get the parent device
65- let devices = get_devices ( & target_root ) . with_context ( || "while looking for colocated ESPs" ) ? ;
65+ let devices = get_parent_devices ( None ) ;
6666
6767 // now, look for all ESPs on those devices
6868 let mut esps = Vec :: new ( ) ;
@@ -89,12 +89,11 @@ pub fn get_bios_boot_partition(device: &str) -> Result<Option<String>> {
8989 Ok ( None )
9090}
9191
92- /// Find all bios_boot partitions on the devices with mountpoint boot
92+ /// Find all bios_boot partitions on the devices
9393#[ allow( dead_code) ]
94- pub fn find_colocated_bios_boot < P : AsRef < Path > > ( target_root : P ) -> Result < Vec < String > > {
94+ pub fn find_colocated_bios_boot ( ) -> Result < Vec < String > > {
9595 // first, get the parent device
96- let devices =
97- get_devices ( & target_root) . with_context ( || "looking for colocated bios_boot parts" ) ?;
96+ let devices = get_parent_devices ( None ) ;
9897
9998 // now, look for all bios_boot parts on those devices
10099 let mut bios_boots = Vec :: new ( ) ;
0 commit comments