File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,10 @@ pub fn get_devices<P: AsRef<Path>>(target_root: P) -> Result<Vec<String>> {
3939/// Find esp partition on the same device
4040/// using sfdisk to get partitiontable
4141pub fn get_esp_partition ( device : & str ) -> Result < Option < String > > {
42- const ESP_TYPE_GUID : & str = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" ;
4342 let device_info: PartitionTable =
4443 bootc_internal_blockdev:: partitions_of ( Utf8Path :: new ( device) ) ?;
45- let esp = device_info
46- . partitions
47- . into_iter ( )
48- . find ( |p| p. parttype . as_str ( ) == ESP_TYPE_GUID ) ;
49- if let Some ( esp) = esp {
50- return Ok ( Some ( esp. node ) ) ;
51- }
52- Ok ( None )
44+ let esp = device_info. find_partition_of_esp ( ) ?;
45+ Ok ( esp. map ( |v| v. node . clone ( ) ) )
5346}
5447
5548/// Find all ESP partitions on the devices
You can’t perform that action at this time.
0 commit comments