On Fri, May 29, 2015 at 02:52:50PM +0000, Joakim Tjernlund wrote:
> Ah, I will try that. But wait, what if you install new progs into /bin then ?
Note: usually, I assume PRoot is *not* running as *real* root, which
is the recommended way.
Regarding your first question; this will fail and report a "permission
denied" error. For example:
user@host-shell$ proot -b /bin/true -q [...]
user@guest-shell$ cp whatever /bin/true
cp: cannot create regular file ‘/bin/true’: Permission denied
even when faking root privileges:
user@host-shell$ proot -b /bin/true -q [...] -0
root@guest-shell# cp whatever /bin/true
cp: cannot create regular file ‘/bin/true’: Permission denied
So no worry for the host system. By the way, files created for
packages are usually installed in a temporary directory.
> Perhaps they set ROOT=/somewhereelse ?
Yes (ex. RPM_BUILD_ROOT for RPM).
> Would be great if you could share the g++ bindings too:)
I can't find the script that contains these bindings anymore. Anyway
you should be able to deduce them before I get my hands on this lost
script :)
> What about perl and python ? Can they be bound too so autotools/emerge go faster?
That's a good idea (I tested something like that with success a long
time ago), and it is quite easy:
proot -b $(which perl) $(perl -e 'foreach (@INC) { print " -b $_" }') [...]
> Instead of
> ln -s / /usr/powerpc-g2.19-linux-gnu
> I tried passing -b /usr/powerpc-g2.19-linux-gnu/:/ but that confuse proot, should it?
As of my understanding your guest rootfs lies in
"/usr/powerpc-g2.19-linux-gnu" too (from the host point-of-view), and
you have to do such a link because croos-tools use a hard-coded
sysroot ("/usr/powerpc-g2.19-linux-gnu"). There are two solutions:
- either specify --sysroot=/ to cross-tools (compiler, linker, ...)
- or bind "/usr/powerpc-g2.19-linux-gnu/" exactly to the same
location, ie: "-b /usr/powerpc-g2.19-linux-gnu/"
Note: technically "-b /usr/powerpc-g2.19-linux-gnu/:/ is exactly the
same as "-r /usr/powerpc-g2.19-linux-gnu/", so maybe the
confusion is expected ;)
Cédric.