@@ -319,10 +319,20 @@ impl Component for Efi {
319
319
return Ok ( None ) ;
320
320
} ;
321
321
322
+ let updated_path = {
323
+ let efilib_path = rootcxt. path . join ( EFILIB ) ;
324
+ if efilib_path. exists ( ) && get_efi_component_from_usr ( & rootcxt. path , EFILIB ) ?. is_some ( )
325
+ {
326
+ PathBuf :: from ( EFILIB )
327
+ } else {
328
+ component_updatedirname ( self )
329
+ }
330
+ } ;
331
+
322
332
let updated = rootcxt
323
333
. sysroot
324
- . sub_dir ( & component_updatedirname ( self ) )
325
- . context ( "opening update dir" ) ?;
334
+ . sub_dir ( & updated_path )
335
+ . with_context ( || format ! ( "opening update dir {}" , updated_path . display ( ) ) ) ?;
326
336
let updatef = filetree:: FileTree :: new_from_dir ( & updated) . context ( "reading update dir" ) ?;
327
337
328
338
let esp_devices = esp_devices. unwrap_or_default ( ) ;
@@ -450,9 +460,22 @@ impl Component for Efi {
450
460
. ok_or_else ( || anyhow:: anyhow!( "No filetree for installed EFI found!" ) ) ?;
451
461
let sysroot_dir = & rootcxt. sysroot ;
452
462
let updatemeta = self . query_update ( sysroot_dir) ?. expect ( "update available" ) ;
453
- let updated = sysroot_dir
454
- . sub_dir ( & component_updatedirname ( self ) )
455
- . context ( "opening update dir" ) ?;
463
+
464
+ let updated_path = {
465
+ let efilib_path = rootcxt. path . join ( EFILIB ) ;
466
+ if efilib_path. exists ( ) && get_efi_component_from_usr ( & rootcxt. path , EFILIB ) ?. is_some ( )
467
+ {
468
+ PathBuf :: from ( EFILIB )
469
+ } else {
470
+ component_updatedirname ( self )
471
+ }
472
+ } ;
473
+
474
+ let updated = rootcxt
475
+ . sysroot
476
+ . sub_dir ( & updated_path)
477
+ . with_context ( || format ! ( "opening update dir {}" , updated_path. display( ) ) ) ?;
478
+
456
479
let updatef = filetree:: FileTree :: new_from_dir ( & updated) . context ( "reading update dir" ) ?;
457
480
let diff = currentf. diff ( & updatef) ?;
458
481
0 commit comments