While we have proot, it is based on ptrace and a significant performance penalty is observed.
Thus it maybe worth adding fakeroot & fakechroot seperately, or a wrapper package that simplifies the task (Like pseudo).
I hope, since these are library shims, will work without much performance penalties.
Edit: As @xeffyr mentioned, we may need to build a TCP variant.
Also fakechroot may be useful, just without faked root privileges.
fakeroot
SysV IPC is not present on most devices, that's why it still is not added.
Fakeroot has a tcp variant though.
fakeroot-tcp requires a little patching, but seems it works:
```
$ touch a b c
$ ls -l
total 0
-rw------- 1 u0_a340 u0_a340 0 Oct 1 17:13 a
-rw------- 1 u0_a340 u0_a340 0 Oct 1 17:13 b
-rw------- 1 u0_a340 u0_a340 0 Oct 1 17:13 c
$ fakeroot
total 0
-rw------- 1 root root 0 Oct 1 17:13 a
-rw------- 1 root root 0 Oct 1 17:13 b
-rw------- 1 root root 0 Oct 1 17:13 c
total 0
-rw------- 1 system system 0 Oct 1 17:13 a
-rw------- 1 shell shell 0 Oct 1 17:13 b
-rw------- 1 root root 0 Oct 1 17:13 c
I have opened a PR for fakeroot (tcp).
A fakeroot package is now available for installation - install it with pkg in fakeroot!
I wish to reopen the issue if maintainers have time.
https://github.com/dex4er/fakechroot/wiki
With fakechroot + fakeroot it is possible to get an alternative (and perhaps faster since no ptrace), way of running other distribution rootfs.
before last 2 commits, travis-ci build has passed. And debian as well as other distributions has fakechroot package. I think KBOX project used the same lib as well.
Also, what about yocto project's pseudo?
@projectextremum I will look at fakechroot. But note that it will be useless for those who has Android 8 or higher as it doesn't replace forbidden syscalls (to do this, ptrace() is required).
before last 2 commits, travis-ci build has passed.
These travis-ci builds are useless. A build should be done in termux-packages docker image and not somewhere else.
We don't have fakechroot in Termux because of
CC ftw.lo
/home/builder/.termux-build/fakechroot/src/src/ftw.c:253:3: error: unknown type name '__nftw_func_t'
NFTW_FUNC_T func;
^
/home/builder/.termux-build/fakechroot/src/src/ftw.c:198:22: note: expanded from macro 'NFTW_FUNC_T'
# define NFTW_FUNC_T __nftw_func_t
^
/home/builder/.termux-build/fakechroot/src/src/ftw.c:525:22: error: use of undeclared identifier 'FTW_ACTIONRETVAL'
if ((data->flags & FTW_ACTIONRETVAL) && result == FTW_SKIP_SUBTREE)
^
/home/builder/.termux-build/fakechroot/src/src/ftw.c:525:53: error: use of undeclared identifier 'FTW_SKIP_SUBTREE'
if ((data->flags & FTW_ACTIONRETVAL) && result == FTW_SKIP_SUBTREE)
Android's implementation of FTW (file tree walk) is not the same as in GNU libc.
I know I am asking too much. But is it possible to implement glibc's FTW as a seperate loadable Library through mechanisms like LD_PRELOAD? Or override it in any other way like static linking?
http://www.kevinboone.net/kbox.html
This old project has used fakechroot apparently.