I am trying to build a disk image as an output from my build system (currently SCons). Creating disk images from a directory structure is very easy to do, for example with genext2fs (http://genext2fs.sourceforge.net/).
But what I would like to do is to create an image that contains several partitions from multiple directories. I am currently having to do this by gluing together dd, losetup, kpartx, mount and copying files over. This requires root access.
Is there any convenient way to do this as a non-root user? Any application out there, suitable for inclusion into a build system that can perform this task efficiently?