Where does PRoot get binding locations from with -B

Showing 1-5 of 5 messages
Where does PRoot get binding locations from with -B Mark Henkelis 5/7/12 3:29 AM
Hi,

When I run PRoot with -B and QEMU for sh4, I see with verbose that
PRoot is creating alternate binding locations to those in the default -
B list (it doesn't remove them afterwards). For example:

    proot -v -q "qemu-sh4 -U QEMU_GDB" -B /home/mark/fs ls

gives:

    proot info: create the binding location "/ramdisk/tmp"
    proot info: create the binding location "/ramdisk/var/run/
resolv.conf"
    proot info: create the binding location "/jffs/hosts"
    proot info: guest rootfs = /home/mark/fs
    proot info: command = ls
    proot info: qemu = /usr/bin/qemu-sh4 -U QEMU_GDB
    proot info: verbose level = 1
    proot info: binding = /:/host-rootfs
    proot info: binding = /etc/host.conf
    proot info: binding = /etc/hosts:/jffs/hosts
    ...

Where does PRoot get these locations from?

Mark.
Re: Where does PRoot get binding locations from with -B Cédric VINCENT 5/7/12 7:36 AM
Some fixes related to bindings were integrated in the latest version of PRoot (v1.8.4 as of this writing).  To be sure, could you specify the version you are using.

Cédric.



Re: Where does PRoot get binding locations from with -B Mark Henkelis 5/7/12 8:02 AM
>
> Some fixes related to bindings were integrated in the latest version of
> PRoot (v1.8.4 as of this writing).  To be sure, could you specify the
> version you are using.
>
> Cédric.

I'm running 1.8.4
Re: Where does PRoot get binding locations from with -B Cédric VINCENT 5/7/12 8:30 AM
Hum.  Please could you check that "/home/mark/fs/etc/hosts" is a
symbolic link to "/jffs/hosts"?  For example I'm able to reproduce the
behavior you reported that way ("-Q" is an alias to "-B -q"):

    $ ls -l /path/to/guest-rootfs/etc/hosts
    lrwxrwxrwx 1 cedric users 11 May  7 17:04
/path/to/guest-rootfs/etc/hosts -> /jffs/hosts

    $ proot -v -Q qemu-arm /path/to/guest-rootfs
    proot info: create the binding location "/jffs/hosts"
    ...
    proot info: binding = /etc/hosts:/jffs/hosts
    ...

In that case, this is an expected behavior: the content of
"/etc/hosts" in the host-rootfs is bound to "/etc/hosts" in the
guest-rootfs, however this latter is a symbolic link to "/jffs/hosts"
and PRoot follows it for the sake of consistency, i.e. the file type
isn't changed.  That way, guest programs can still access "/etc/hosts"
as a symbolic link:

    host_shell$ proot -Q qemu-arm /path/to/guest-rootfs

    guest_shell$ ls -l /etc/hosts
    lrwxrwxrwx 1 cedric users 11 May  7 17:04 /etc/hosts -> /jffs/hosts


Now to reply to the question "Where does PRoot get binding locations
from with -B?", this list of recommended bindings is hard-coded.


> (it doesn't remove them afterwards)

Exact, no clean-up is performed yet.


Cédric.
Re: Where does PRoot get binding locations from with -B Mark Henkelis 5/7/12 9:03 AM

> Hum.  Please could you check that "/home/mark/fs/etc/hosts" is a
> symbolic link to "/jffs/hosts"?

It is indeed. The other binding locations are links too.

> In that case, this is an expected behavior: the content of
> "/etc/hosts" in the host-rootfs is bound to "/etc/hosts" in the
> guest-rootfs, however this latter is a symbolic link to "/jffs/hosts"
> and PRoot follows it for the sake of consistency, i.e. the file type
> isn't changed.  That way, guest programs can still access "/etc/hosts"
> as a symbolic link:

Excellent, thanks, I now understand what is happening.

Mark.