I recently found out about the 'kas' tool that tries to be a better version of the hacky scripts we all write for this. Here's a link to an example YAML config to give you a taste: https://kas.readthedocs.io/en/1.0/userguide.html#project-con...
Other kas features I love: - Patching 3rd party layers with quilt - Configuration fragments - Chaining together configuration fragments
As another example, here is my kas setup for building rootfs images and container images for various different boards: