Skip to content

Commit

Permalink
patch/boot: Avoid loading boot images when there are no patchers
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Nov 5, 2024
1 parent 10c425d commit ce87757
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions avbroot/src/patch/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,11 @@ pub fn patch_boot_images<'a>(
) -> Result<HashSet<&'a str>> {
let parent_span = Span::current();

if patchers.is_empty() {
debug!("Skip loading boot images; nothing to patch");
return Ok(HashSet::new());
}

// Preparse all images. Some patchers need to inspect every candidate.
let mut images = load_boot_images(names, open_input)?;

Expand Down

0 comments on commit ce87757

Please sign in to comment.