The compiled device tree database file needs to be put into a section
named .dtb. This patch also is in-line with the proposed extension
of the UKI spec to explicitly allow multiple DTB sections.
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
Please note, that I could not test this patch with multiple device
trees due to lack of a suitable board. For a single device tree it
indeed works properly.
Best regards,
Felix Moessbauer
kernel-stub/main.c | 2 +-
tools/bg_gen_unified_kernel | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel-stub/main.c b/kernel-stub/main.c
index 55873e5..425d309 100644
--- a/kernel-stub/main.c
+++ b/kernel-stub/main.c
@@ -144,7 +144,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
kernel_section = section;
} else if (CompareMem(section->Name, ".initrd", 8) == 0) {
initrd_section = section;
- } else if (CompareMem(section->Name, ".dtb-", 5) == 0) {
+ } else if (CompareMem(section->Name, ".dtb", 5) == 0) {
has_dtbs = TRUE;
fdt = (UINT8 *) stub_image->ImageBase +
section->VirtualAddress;
diff --git a/tools/bg_gen_unified_kernel b/tools/bg_gen_unified_kernel
index 1d426e1..c5359d9 100755
--- a/tools/bg_gen_unified_kernel
+++ b/tools/bg_gen_unified_kernel
@@ -286,7 +286,7 @@ def main():
for n in range(len(args.dtb)):
dtb.append(args.dtb[n].read())
sect_size = align(len(dtb[n]), file_align)
- section = Section(bytes('.dtb-{}'.format(n + 1), 'ascii'),
+ section = Section(bytes('.dtb', 'ascii'),
sect_size, dtb_virt, sect_size, current_offs,
Section.IMAGE_SCN_CNT_INITIALIZED_DATA |
Section.IMAGE_SCN_MEM_READ)
--
2.39.2