termux / proot

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

Error running sh in MIUI 11 #86

Open LucasMello01 opened 4 years ago

LucasMello01 commented 4 years ago

I have an xiaomi mi 9 in MIUI 11, and i cant run the sh for running Ubuntu. I got this error:

$ ./start-ubuntu19.sh
proot error: execve("/usr/bin/env"): Function not implem
ented
proot info: possible causes:
* the program is a script but its interpreter (eg. /bin/sh) was not found;
* the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
* the program is a foreign binary but qemu was not specified;                                                * qemu does not work correctly (if specified);
* the loader was not found or doesn't work.           
fatal error: see `proot --help`.
proot error: can't chmod '/data/data/com.termux/files/us
r/tmp/proot-10367-0Pn4i4': Function not implemented
proot error: can't chdir to '/root': Function not implemented
oxr463 commented 4 years ago

Can you provide the contents of your script for debugging purposes?

LucasMello01 commented 4 years ago

@oxr463, It is an application called AndroNix that provides linux installation codes using termux terminal, and my phone system is miui 11 (android 10), does termux support android 10?

the content of the script 'start-ubuntu19.sh':

cat start-ubuntu19.sh

#!/data/data/com.termux/files/usr/bin/bash
cd $(dirname $0)
# # unset LD_PRELOAD in case termux-exec is installed
unset LD_PRELOAD
command="proot"
command+=" --link2symlink"
command+=" -0"
command+=" -r ubuntu19-fs"
if [ -n "$(ls -A ubuntu19-binds)" ]; then
    for f in ubuntu19-binds/* ;do
      . $f
    done
fi
command+=" -b /dev"
command+=" -b /proc"
command+=" -b ubuntu19-fs/root:/dev/shm"
# # uncomment the following line to have access to the home directory of termux
#command+=" -b /data/data/com.termux/files/home:/root"
# # uncomment the following line to mount /sdcard directly to /
#command+=" -b /sdcard"
command+=" -w /root"
command+=" /usr/bin/env -i"command+=" HOME=/root"
 command+="PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
command+=" TERM=$TERM"
command+=" LANG=C.UTF-8"
command+=" /bin/bash --login"
com="$@"
if [ -z "$1" ];then
    exec $command
else
   $command -c "$com"
fi