File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,7 @@ impl Component for Efi {
322322 } )
323323 }
324324
325- // TODO: Remove dest_root; it was never actually used
325+ // For installation, only support single ESP now
326326 fn install (
327327 & self ,
328328 src_root : & openat:: Dir ,
@@ -336,9 +336,17 @@ impl Component for Efi {
336336 log:: debug!( "Found metadata {}" , meta. version) ;
337337 let srcdir_name = component_updatedirname ( self ) ;
338338 let ft = crate :: filetree:: FileTree :: new_from_dir ( & src_root. sub_dir ( & srcdir_name) ?) ?;
339- let destdir = & self . ensure_mounted_esp ( Path :: new ( dest_root) ) ?;
339+ let destdir = if let Some ( destdir) = self . get_mounted_esp ( dest_root) ? {
340+ destdir
341+ } else {
342+ let esp_device = self
343+ . get_esp_device ( )
344+ . ok_or_else ( || anyhow:: anyhow!( "Failed to find ESP device" ) ) ?;
345+ let esp_device = esp_device. to_str ( ) . unwrap ( ) ;
346+ self . ensure_mounted_esp ( dest_root, esp_device) ?
347+ } ;
340348
341- let destd = & openat:: Dir :: open ( destdir)
349+ let destd = & openat:: Dir :: open ( & destdir)
342350 . with_context ( || format ! ( "opening dest dir {}" , destdir. display( ) ) ) ?;
343351 validate_esp_fstype ( destd) ?;
344352
You can’t perform that action at this time.
0 commit comments