Originally created by: labi
Originally owned by: labi
Allow building as non-root user. Currently we need root, as we are using chroot.
After switching to fakechroot, we have the problem of non-native target systems. Then we are using qemu through binfmt, which simply doesn't work in combination with chroot.
The way how fakechroot works is preloading a wrapper library through LD_PRELOAD. So the following scenerio sounds valid:
fakechroot chroot rootfs/ /bin/bash
/bin/bash is a target binary, executed through binfmt.
chroot itself is still a host binary.
fakechroot will fixly preload it's wrapper.
We would need a few things:
Note: We need to check if the permissions on the files will remain the same after we switched from the host to the target library. Because the command is in fact a bit more complex:
fakechroot bash -c "cd ...; tar -xf ...; chroot . ./.trg.sh; ..."
So we have the files created with the host version of libchfakeroot.so and then we execute the target binaries with the target version. Not sure if we can guarantee, that they are seeing the same file permissions, as I don't know where this information is stored.
Diff:
Finally I now used Qemu.
As everything else seemed to make the build more complicated, and therefore more error prone.
I now had already problems with host dependencies. They would have become even more with another non-root solution, like fakechroot.
Additionally: This solution can even run on Windows!!! ;)