]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pe-binary: .initrd section is optional for UKI
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 May 2024 21:08:27 +0000 (06:08 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 16 May 2024 10:56:22 +0000 (12:56 +0200)
.osrel is also optional, but sd-boot and bootctl requires it.
So, let's keep .osrel section at least now.

Fixes #32774.

src/shared/pe-binary.c

index 4c05323d951a5286ac812014f7dc49823f84ff01..997e0e49a611fe54c2834f1dbec2e4c213875c23 100644 (file)
@@ -234,8 +234,9 @@ bool pe_is_uki(const PeHeader *pe_header, const IMAGE_SECTION_HEADER *sections)
         if (le16toh(pe_header->optional.Subsystem) != IMAGE_SUBSYSTEM_EFI_APPLICATION)
                 return false;
 
+        /* Note that the UKI spec only requires .linux, but we are stricter here, and require .osrel too,
+         * since for sd-boot it just doesn't make sense to not have that. */
         return
                 pe_header_find_section(pe_header, sections, ".osrel") &&
-                pe_header_find_section(pe_header, sections, ".linux") &&
-                pe_header_find_section(pe_header, sections, ".initrd");
+                pe_header_find_section(pe_header, sections, ".linux");
 }