Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | None | 0 0
  1. $ cat start-ubuntu.sh
  2. #!/data/data/com.termux/files/usr/bin/bash
  3. cd $(dirname $0)
  4. ## unset LD_PRELOAD in case termux-exec is installed
  5. unset LD_PRELOAD
  6. command="proot"
  7. command+=" --link2symlink"
  8. command+=" -0"
  9. command+=" -r ubuntu-fs"
  10. if [ -n "$(ls -A ubuntu-binds)" ]; then
  11.     for f in ubuntu-binds/* ;do
  12.       . $f
  13.     done
  14. fi
  15. command+=" -b /dev"
  16. command+=" -b /proc"
  17. command+=" -b ubuntu-fs/root:/dev/shm"
  18. command+=" -b $(pwd)/linhome:/linhome"
  19. # Fake files needed for some programs
  20. command+=" -b $(pwd)/fakeproc/uptime:/proc/uptime"
  21. command+=" -b $(pwd)/fakeproc/stat:/proc/stat"
  22. command+=" -b $(pwd)/fakeproc/version:/proc/version"
  23. commamd+=" -b $(pwd)/fakeproc/filesystems:/proc/filesystems"
  24. ## Experimental stuff
  25. # command+=" -b $(pwd)/fakeproc/self/oom_score_adj:/proc/self/oom_score_adj"
  26. ## uncomment the following line to have access to the home directory of termux
  27. #command+=" -b /data/data/com.termux/files/home:/root"
  28. ## uncomment the following line to mount /sdcard directly to /
  29. #command+=" -b /sdcard"
  30. command+=" -b /storage"
  31. # This may be device specific
  32. command+=" -b /storage/emulated/0:/internalStorage"
  33. command+=" -b /data/data/com.termux/files/home/storage/external-1:/externalStorage"
  34. command+=" -w /root"
  35. command+=" /usr/bin/env -i"
  36. command+=" HOME=/root"
  37. command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
  38. command+=" TERM=$TERM"
  39. command+=" LANG=C.UTF-8"
  40. # This line may differ after you use AnLinux
  41. # Having this here implies that you created an non-root user
  42. command+=" /bin/bash --login"
  43. com="$@"
  44. if [ -z "$1" ];then
  45.     exec $command
  46. else
  47.     $command -c "$com"
  48. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement