Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
olegos2 authored Jun 8, 2023
1 parent beb84a7 commit cea680d
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
7 changes: 7 additions & 0 deletions box
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

export Rootfs="$HOME/Box4Droid/ubuntu-fs/"
termux-x11 :1 &>/dev/null & pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
cd $HOME/Box4Droid/
./start-ubuntu.sh
pkill -f "app_process / com.termux.x11"
50 changes: 50 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
echo ""
echo "Сlick on allow to proceed"
termux-setup-storage & sleep 3 &>/dev/null
while true; do
if [ -e storage ]; then
rm -rf storage/shared/Box4Droid
break
else
echo "If you denied permission, change it manually in termux app settings now"
fi
sleep 1
done
echo ""
echo "Installing packages"
pkg update -y
pkg install x11-repo pulseaudio xwayland proot wget -y &>/dev/null
mkdir -p $HOME/Box4Droid
cd $HOME/Box4Droid
wget https://github.com/olegos2/a/raw/main/termux-x11-1.02.07-0-all.deb
dpkg -i termux-x11-1.02.07-0-all.deb &>/dev/null
rm -rf termux-x11-1.02.07-0-all.deb

echo ""
echo "Downloading preconfigured Rootfs..."
cd $HOME/Box4Droid
wget https://github.com/olegos2/a/releases/download/0.0.1-alpha/rootfs.tar.xz

echo ""
echo "Unzipping Rootfs"
tar -xf rootfs.tar.xz
rm -rf rootfs.tar.xz

echo ""
echo "Installing scripts"
cd $HOME/Box4Droid/ubuntu-fs/opt
wget https://github.com/olegos2/a/raw/main/scripts.tar.gz
tar -xvf scripts.tar.gz
rm -rf scripts.tar.gz

cd $HOME/Box4Droid/
wget https://github.com/olegos2/a/raw/main/box
wget https://github.com/olegos2/a/raw/main/start-ubuntu.sh
chmod +x box
mv box $PREFIX/bin/
chmod +x start-ubuntu.sh

echo ""
echo "Done. Type 'box' to start"

rm -rf $HOME/install
Binary file added scripts.tar.gz
Binary file not shown.
38 changes: 38 additions & 0 deletions start-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/data/data/com.termux/files/usr/bin/bash
cd $(dirname $0)
pulseaudio --start
## For rooted user: pulseaudio --start --system
## 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 /sys"
command+=" -b ubuntu-fs/root:/dev/shm"
## uncomment the following line to have access to the home directory of termux
command+=" -b /data/data/com.termux/files/usr/tmp/.virgl_test:/tmp/.virgl_test"
command+=" -b /data/data/com.termux/files/usr/tmp/.X11-unix/:/tmp/.X11-unix/"
command+=" -b /data/data/com.termux/files/usr/tmp/.X1-lock:/tmp/.X1-lock"
## 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
Binary file added termux-x11-1.02.07-0-all.deb
Binary file not shown.

0 comments on commit cea680d

Please sign in to comment.