From ce87757fd1041fc4af8facee235e6211424241dd Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Tue, 5 Nov 2024 09:28:34 -0500 Subject: [PATCH] patch/boot: Avoid loading boot images when there are no patchers Signed-off-by: Andrew Gunnerson --- avbroot/src/patch/boot.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/avbroot/src/patch/boot.rs b/avbroot/src/patch/boot.rs index ccb19fd..597c294 100644 --- a/avbroot/src/patch/boot.rs +++ b/avbroot/src/patch/boot.rs @@ -1134,6 +1134,11 @@ pub fn patch_boot_images<'a>( ) -> Result> { 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)?;