pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
305 stars 110 forks source link

Fix Image Environment #193

Closed Bastian-Krause closed 2 years ago

Bastian-Krause commented 2 years ago

A set of image environment variables can be used in exec-pre and exec-post. This "image environment" is specific to the image being generated. image_generate() calls itself recursively to resolve dependencies. Because setenv_image() is called before image_generate(), the set image environment is wrong as soon as image_generate() calls itself.

Fix that by setting the image environment inside image_generate() after the point it might call itself for dependency resolution. This way the image environment is always correct.