]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: extend error message when section is too small
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 18 Aug 2025 19:42:10 +0000 (21:42 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Aug 2025 08:46:36 +0000 (10:46 +0200)
src/ukify/ukify.py

index a09ea09f9ed9537beafcb90c963b9c1993418428..5cd902bd9dba7f2d6b38013f940db4893cf7f287 100755 (executable)
@@ -1045,7 +1045,10 @@ def pe_add_sections(opts: UkifyConfig, uki: UKI, output: str) -> None:
         for i, s in enumerate(pe.sections[:n_original_sections]):
             if pe_strip_section_name(s.Name) == section.name and section.name != '.dtbauto':
                 if new_section.Misc_VirtualSize > s.SizeOfRawData:
-                    raise PEError(f'Not enough space in existing section {section.name} to append new data')
+                    raise PEError(
+                        f'Not enough space in existing section {section.name} to append new data'
+                        f' (need {new_section.Misc_VirtualSize}, have {s.SizeOfRawData})'
+                    )
 
                 padding = bytes(new_section.SizeOfRawData - new_section.Misc_VirtualSize)
                 pe.__data__ = (