fitimage.bbclass: error-out for empty configurations

Otherwise mkimage will, but with a way less helpful error message.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
This commit is contained in:
Enrico Jörns 2024-11-18 08:40:58 +01:00 committed by Khem Raj
parent 5bff8f5b3b
commit 24dd46daf8
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -462,6 +462,7 @@ python write_manifest() {
# Step 5: Prepare a configurations section
#
fitimage_emit_section_start(d, fd, 'configurations')
confcount = 0
dtbcount = 1
for dtb in (DTBS or "").split():
import subprocess
@ -474,6 +475,7 @@ python write_manifest() {
dtb_path, dtb_file = os.path.split(dtb)
fitimage_emit_section_config(d, fd, dtb_file, kernelcount, ramdiskcount, setupcount, bootscriptid, compatible, dtbcount)
dtbcount += 1
confcount += 1
for dtb in (DTBOS or "").split():
import subprocess
try:
@ -485,8 +487,13 @@ python write_manifest() {
dtb_path, dtb_file = os.path.split(dtb)
fitimage_emit_section_config_fdto(d, fd, dtb_file, compatible)
confcount += 1
fitimage_emit_section_end(d, fd)
if confcount == 0:
bb.fatal("Empty 'configurations' node generated! At least one 'fdt' or 'fdto' type is required.")
fitimage_emit_fit_footer(d, fd)
}