Binman is a project that is used to pack firmware images. It may be suitable for replacing some of the hairy parts of our build system. https://github.com/u-boot/u-boot/tree/master/tools/binman