]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
stub: Use log_debug if addons has no applicable sections
authorVivian Wang <wangruikang@iscas.ac.cn>
Wed, 17 Dec 2025 06:03:30 +0000 (14:03 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Dec 2025 09:37:49 +0000 (18:37 +0900)
This can happen expectedly if an addon purely provides .dtbauto
sections, and there's no match for this machine. Reduce the log message
of this case to "debug" level.

src/boot/stub.c

index d45eead2790801397d409b8d0fa6bbae36fda7bb..06ecbc7d18fb426957b92cfd0758bfe2d6a96b5c 100644 (file)
@@ -627,20 +627,23 @@ static EFI_STATUS load_addons(
                         return log_error_status(err, "Failed to find protocol in %ls: %m", items[i]);
 
                 err = pe_memory_locate_sections(loaded_addon->ImageBase, unified_sections, sections);
-                if (err != EFI_SUCCESS ||
-                    (!PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_CMDLINE) &&
-                     !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_DTB) &&
-                     !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_DTBAUTO) &&
-                     !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_INITRD) &&
-                     !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_UCODE))) {
-                        if (err == EFI_SUCCESS)
-                                err = EFI_NOT_FOUND;
+                if (err != EFI_SUCCESS) {
                         log_error_status(err,
                                          "Unable to locate embedded .cmdline/.dtb/.dtbauto/.initrd/.ucode sections in %ls, ignoring: %m",
                                          items[i]);
                         continue;
                 }
 
+                if (!PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_CMDLINE) &&
+                    !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_DTB) &&
+                    !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_DTBAUTO) &&
+                    !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_INITRD) &&
+                    !PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_UCODE)) {
+                        log_debug("No applicable .cmdline/.dtb/.dtbauto/.initrd/.ucode sections found in %ls, ignoring.",
+                                  items[i]);
+                        continue;
+                }
+
                 /* We want to enforce that addons are not UKIs, i.e.: they must not embed a kernel. */
                 if (PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_LINUX)) {
                         log_error("%ls is a UKI, not an addon, ignoring.", items[i]);