[librechroot] Support using proot to call QEMU for foreign architectures
Merge PRoot project to libretools for easy compiling multiple architecture
PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc. This means that users don't need any privileges or setup to do things like using an arbitrary directory as the new root filesystem, making files accessible somewhere else in the filesystem hierarchy, or executing programs built for another CPU architecture transparently through QEMU user-mode. Also, developers can use PRoot as a generic GNU/Linux process instrumentation engine thanks to its extension mechanism, see CARE for an example. Technically PRoot relies on ptrace, an unprivileged system-call available in every Linux kernel.Example:
- mount -o rbind /dev <chroot-dir>/dev
- mount -o bind /sys <chroot-dir>/sys
- mount -o bind /tmp <chroot-dir>/tmp
- mount -t proc none <chroot-dir>/proc
- proot -0 -q /usr/bin/qemu-arm -r <chroot-dir>
Note: "-0" means root user access.
Updated by lukeshu over 7 years ago
proot whigs out when the child process does certain things with unshare.
I think what's going on is that the child unshares, then forks a new (ARM) process, then proot directly calls qemu, so proot+qemu don't know about the new namespace.
I think this blocks using proot with systemd-nspawn.
There's ~0% chance that I'm switching libretools away from systemd-nspawn (or a derivative).
So, I guess I'm waiting for coadde's build of a static qemu, so I tackle #987 instead.