In our environment we have linux developer PCs and several embedded boards. The embedded boards are booted from an image. Those image files should be created/modified on the developer PCs. Mounting is no problem:
mount /scratch/image.img /scratch/mounted-image -o loop,user
would be enough.
The problem is users can mount it, but not access files that are belonging to root in the image (the image is usually ext2). What I need is a way that everything in that mounted dir, that belongs to uid 0, is mapped to a different uid and vice-versa.
I googled already for something, but the results where disappointing (e.g. only something like fakeroot, which is not suitable in such a situation; of course sudo is also not possible in this situation).