termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
783 stars 160 forks source link

proot warning: can't chdir #65

Closed QkiZMR closed 5 years ago

QkiZMR commented 5 years ago

Termux on Android Pie. I'm trying to proot /data/data/com.termux/files/ like it was working earlier but now no success.

u0_a164@localhost ~> proot -r /data/data/com.termux/files/ -q /usr/bin/fish
proot warning: can't chdir("/data/data/com.termux/files/home/./.") in the guest rootfs: No such file or directory
proot info: default working directory is now "/"
proot error: '/bin/sh' not found (root = /data/data/com.termux/files, cwd = /, $PATH=(null))
fatal error: see `proot --help`.

/data/data/com.termux/files/ exists so warning is unreliable.

ghost commented 5 years ago

/data/data/com.termux/files/ exists so warning is unreliable.

It doesn't exist inside proot. By proot'ing into /data/data/com.termux/files/, it became / (rootfs) and /data/data/com.termux/files/home is no longer available.

ghost commented 5 years ago

And if you really need to execute proot -r /data/data/com.termux/files/ -q /usr/bin/fish, the correct command will be:

proot -b /data:/data -b /proc:/proc -b /system:/system -b /dev:/dev -r /data/data/com.termux/files/ /usr/bin/fish

Mountpoints /data, /proc, /system are required in order to execute Termux programs. Also, the switch -q was misused - it is for qemu-user and should not be used standalone.

Mountpoint /dev is optional, but still required in order to use many programs.

QkiZMR commented 5 years ago

Thx, it works with all -b options. I dont know how it works earlier.