4 echo "termux-chroot: Setup a chroot to mimic a normal Linux file system"
6 echo "Execute without arguments to run a chroot with traditional file system"
7 echo "hierarchy (having e.g. the folders /bin, /etc and /usr) within Termux."
11 # For the /system/bin/linker(64) to be found:
12 ARGS
="-b /system:/system"
14 # Bind $PREFIX so Termux programs expecting
15 # to find e.g. configurations files there work.
16 ARGS
="$ARGS -b $PREFIX/..:$PREFIX/.."
18 # Mimic traditional Linux file system hierarchy - /usr:
19 ARGS
="$ARGS -b $PREFIX:/usr"
21 # Mimic traditional Linux file system hierarchy - other Termux dirs:
22 for f
in bin etc lib share tmp var
; do
23 ARGS
="$ARGS -b $PREFIX/$f:/$f"
26 # Mimic traditional Linux file system hierarchy- system dirs:
28 ARGS
="$ARGS -b /$f:/$f"
31 # Set /home as current directory:
32 ARGS
="$ARGS --cwd=/home"
34 # Root of the file system:
35 ARGS
="$ARGS -r $PREFIX/.."
39 if [ -x
$HOME/.termux
/shell
]; then
40 PROGRAM
=`readlink -f $HOME/.termux/shell`
42 ARGS
="$ARGS $PROGRAM -l"
45 $PREFIX/bin
/proot
$ARGS