fitimage.bbclass: fix error handling for missing recipe

The 'image' name should be printed rather than the (unset) 'recipe'.
Also use f-strings for better readability.

Since a missing recipe configuration is fatal to a proper generation,
abort the parsing with bb.fatal instead of continuing with a broken
configuration.

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
This commit is contained in:
Enrico Jörns 2024-11-15 13:19:12 +01:00 committed by Khem Raj
parent 0573c4c996
commit 71e6160da0
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -106,7 +106,7 @@ python __anonymous() {
recipe = d.getVar('FITIMAGE_IMAGE_%s' % image)
if not recipe:
bb.error("No recipe set for image '%s'. Specify via 'FITIMAGE_IMAGE_%s = \"<recipe-name>\"'" % (recipe, image))
bb.fatal(f"No recipe set for image '{image}'. Specify via 'FITIMAGE_IMAGE_{image} = \"<recipe-name>\"'")
return
d.appendVarFlag('do_unpack', 'vardeps', ' FITIMAGE_IMAGE_%s' % image)