Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat start-ubuntu.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 ubuntu-fs"
- if [ -n "$(ls -A ubuntu-binds)" ]; then
- for f in ubuntu-binds/* ;do
- . $f
- done
- fi
- command+=" -b /dev"
- command+=" -b /proc"
- command+=" -b ubuntu-fs/root:/dev/shm"
- command+=" -b $(pwd)/linhome:/linhome"
- # Fake files needed for some programs
- command+=" -b $(pwd)/fakeproc/uptime:/proc/uptime"
- command+=" -b $(pwd)/fakeproc/stat:/proc/stat"
- command+=" -b $(pwd)/fakeproc/version:/proc/version"
- commamd+=" -b $(pwd)/fakeproc/filesystems:/proc/filesystems"
- ## Experimental stuff
- # command+=" -b $(pwd)/fakeproc/self/oom_score_adj:/proc/self/oom_score_adj"
- ## 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+=" -b /storage"
- # This may be device specific
- command+=" -b /storage/emulated/0:/internalStorage"
- command+=" -b /data/data/com.termux/files/home/storage/external-1:/externalStorage"
- 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"
- # This line may differ after you use AnLinux
- # Having this here implies that you created an non-root user
- command+=" /bin/bash --login"
- com="$@"
- if [ -z "$1" ];then
- exec $command
- else
- $command -c "$com"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement