Skip to content

Commit e7eb213

Browse files
Upgraded Ubuntu & Ubuntu-Xfce
1 parent e57c565 commit e7eb213

File tree

3 files changed

+231
-91
lines changed

3 files changed

+231
-91
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

Installer/Ubuntu/ubuntu-xfce.sh

Lines changed: 120 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,117 @@
11
#!/data/data/com.termux/files/usr/bin/bash
2-
pkg install wget -y
3-
folder=ubuntu-fs
4-
dlink="https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/APT"
5-
if [ -d "$folder" ]; then
6-
first=1
7-
echo "skipping downloading"
8-
fi
9-
tarball="ubuntu-rootfs.tar.xz"
10-
if [ "$first" != 1 ];then
11-
if [ ! -f $tarball ]; then
12-
echo "Download Rootfs, this may take a while base on your internet speed."
13-
case `dpkg --print-architecture` in
14-
aarch64)
15-
archurl="arm64" ;;
16-
arm)
17-
archurl="armhf" ;;
18-
amd64)
19-
archurl="amd64" ;;
20-
x86_64)
21-
archurl="amd64" ;;
22-
i*86)
23-
archurl="i386" ;;
24-
x86)
25-
archurl="i386" ;;
26-
*)
27-
echo "unknown architecture"; exit 1 ;;
28-
esac
29-
wget "https://github.com/Techriz/AndronixOrigin/blob/master/Rootfs/Ubuntu/${archurl}/ubuntu-rootfs-${archurl}.tar.xz?raw=true" -O $tarball
2+
3+
# Variables
4+
BLUE="\e[34m" # Blue Color
5+
GREEN="\e[32m" # Red Color
6+
NO_COLOR="\e[39m" # No Color
7+
isFsPresent=0 # Handles if the tarball is downloaded or skipped (overridden by -f)
8+
distroName="Ubuntu" # Name of the concerned distro
9+
name="ubuntu" # Name of the concerned distro
10+
rootfsFolder=$name-fs # RootFS folder name
11+
bindsFolder=$name-fs # Bind folder name
12+
dlink="https://raw.githubusercontent.com/AndronixApp/AndronixOrigin/master/APT" # Download Link
13+
tarball="${name}-rootfs.tar.xz"
14+
folderSize=$(stat -c%s $rootfsFolder)
15+
16+
# Function used for sending updates to Andronix App
17+
function sendUpdates() {
18+
message=$(echo "$1" | sed 's/ /\\ /g')
19+
am broadcast --user 0 -a app.andronix.PROGRESS --es app.andronix.PROGRESS_STATUS "$message" >/dev/null
20+
}
21+
22+
#Welcome
23+
echo "
24+
___ __ _
25+
/ | ____ ____/ / _____ ____ ____ (_) _ __
26+
/ /| | / __ \ / __ / / ___/ / __ \ / __ \ / / | |/_/
27+
/ ___ | / / / // /_/ / / / / /_/ / / / / / / / _> <
28+
/_/ |_|/_/ /_/ \__,_/ /_/ \____/ /_/ /_/ /_/ /_/|_|
29+
"
30+
31+
echo -e "\n${BLUE}Welcome to the Andronix ${distroName} installer.${NO_COLOR}"
32+
echo -e "Join Andronix ${BLUE}Discord${NO_COLOR} @ https://chat.andronix.app (giveaways too ;)"
33+
echo -e "Read our ${BLUE}Documentation${NO_COLOR} @ https://docs.andronix.app \n\n"
34+
35+
sendUpdates "Script Detected"
36+
37+
sleep 1
38+
39+
# Getting the -f (force download flag)
40+
while getopts "f" OPTION; do
41+
# shellcheck disable=SC2220
42+
case $OPTION in
43+
f)
44+
echo -e "\nForcing the download..."
45+
rm -rf $rootfsFolder
46+
rm -rf $bindsFolder
47+
isFsPresent=0
48+
;;
49+
esac
50+
done
51+
52+
# Installing basic termux packages
53+
pkg install wget -y
54+
55+
# Checking if the rootfsFolder is present
56+
if [ -d "$rootfsFolder" ] && [ "$folderSize" -gt 6000 ]; then
57+
isFsPresent=1
58+
echo -e "\nRoot Files System already present. Skipping download..."
3059
fi
31-
cur=`pwd`
32-
mkdir -p "$folder"
33-
cd "$folder"
34-
echo "Decompressing Rootfs, please be patient."
35-
proot --link2symlink tar -xJf ${cur}/${tarball}||:
36-
cd "$cur"
60+
61+
if [ "$isFsPresent" != 1 ]; then
62+
if [ ! -f "$tarball" ]; then
63+
echo -e "\nDownloading Rootfs for ${distroName}. Please be patient...\n\n"
64+
case $(dpkg --print-architecture) in
65+
aarch64)
66+
arch="arm64"
67+
;;
68+
arm)
69+
arch="armhf"
70+
;;
71+
amd64)
72+
arch="amd64"
73+
;;
74+
x86_64)
75+
arch="amd64"
76+
;;
77+
i*86)
78+
arch="i386"
79+
;;
80+
x86)
81+
arch="i386"
82+
;;
83+
*)
84+
echo "There was an issue identifying the architecture of your device!"
85+
sendUpdates "Oops! Architecture error."
86+
exit 1
87+
;;
88+
esac
89+
sendUpdates "Downloading the files..."
90+
wget -q --show-progress --progress=bar "https://github.com/Techriz/AndronixOrigin/blob/master/Rootfs/${distroName}/${arch}/ubuntu-rootfs-${arch}.tar.xz?raw=true" -O $tarball
91+
fi
92+
currentDirectory=$(pwd)
93+
mkdir -p "$rootfsFolder"
94+
cd "$rootfsFolder"
95+
sendUpdates "Decompressing the files..."
96+
echo -e "\nDecompressing Rootfs. This can take a while. Please be patient."
97+
proot --link2symlink tar -xJf "${currentDirectory}"/${tarball} || :
98+
cd "$currentDirectory"
3799
fi
38-
mkdir -p ubuntu-binds
100+
101+
mkdir -p $bindsFolder
39102
bin=start-ubuntu.sh
40-
echo "writing launch script"
41-
cat > $bin <<- EOM
103+
echo -e "\nWriting the launch script now! Just a few more steps!"
104+
cat >$bin <<-EOM
42105
#!/bin/bash
43106
cd \$(dirname \$0)
44107
## unset LD_PRELOAD in case termux-exec is installed
45108
unset LD_PRELOAD
46109
command="proot"
47110
command+=" --link2symlink"
48111
command+=" -0"
49-
command+=" -r $folder"
50-
if [ -n "\$(ls -A ubuntu-binds)" ]; then
51-
for f in ubuntu-binds/* ;do
112+
command+=" -r $rootfsFolder"
113+
if [ -n "\$(ls -A $bindsFolder)" ]; then
114+
for f in $bindsFolder/* ;do
52115
. \$f
53116
done
54117
fi
@@ -57,7 +120,7 @@ command+=" -b /proc"
57120
command+=" -b ubuntu-fs/root:/dev/shm"
58121
## uncomment the following line to have access to the home directory of termux
59122
#command+=" -b /data/data/com.termux/files/home:/root"
60-
## uncomment the following line to mount /sdcard directly to /
123+
## uncomment the following line to mount /sdcard directly to /
61124
#command+=" -b /sdcard"
62125
command+=" -w /root"
63126
command+=" /usr/bin/env -i"
@@ -74,20 +137,22 @@ else
74137
fi
75138
EOM
76139

77-
echo "fixing shebang of $bin"
78140
termux-fix-shebang $bin
79-
echo "making $bin executable"
80141
chmod +x $bin
81-
echo "removing image for some space"
142+
echo "Saving some space..."
82143
rm $tarball
83144

145+
sendUpdates "Downloading Desktop Environment!"
146+
147+
wget -q --show-progress --progress=bar $dlink/XFCE4/xfce4_de.sh -O $rootfsFolder/root/xfce4_de.sh
148+
84149
#DE installation addition
85150

86-
wget $dlink/XFCE4/xfce4_de.sh -O $folder/root/xfce4_de.sh
151+
wget $dlink/XFCE4/xfce4_de.sh -O $rootfsFolder/root/xfce4_de.sh
87152
clear
88153
echo "Setting up the installation of XFCE VNC"
89154

90-
echo "APT::Acquire::Retries \"3\";" > $folder/etc/apt/apt.conf.d/80-retries #Setting APT retry count
155+
echo "APT::Acquire::Retries \"3\";" >$rootfsFolder/etc/apt/apt.conf.d/80-retries #Setting APT retry count
91156
echo "#!/bin/bash
92157
apt update -y && apt install sudo wget -y
93158
clear
@@ -107,6 +172,14 @@ fi
107172
if [ ! -f /usr/bin/vncserver ]; then
108173
apt install tigervnc-standalone-server -y
109174
fi
110-
rm -rf ~/.bash_profile" >> ubuntu-fs/root/.bash_profile
175+
rm -rf ~/.bash_profile" >>$rootfsFolder/root/.bash_profile
176+
177+
echo -e "\n\nYay! All done."
178+
echo -e "\n${GREEN}This is the confirmation only regarding the actual distro. Tracking the installation of the Desktop Environment is beyond the present scope. Please contact us on ${BLUE}Discord${GREEN} if you face any issues.${NO_COLOR}\n"
179+
echo "You will then asked to configure some distro specific things."
180+
echo -e "\nProceeding to install the Desktop Environment...\n"
181+
182+
sendUpdates "Installation Success!"
183+
sleep 4
111184

112185
bash $bin

Installer/Ubuntu/ubuntu.sh

Lines changed: 110 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,115 @@
11
#!/data/data/com.termux/files/usr/bin/bash
2-
pkg install wget -y
3-
folder=ubuntu-fs
4-
if [ -d "$folder" ]; then
5-
first=1
6-
echo "skipping downloading"
7-
fi
8-
tarball="ubuntu-rootfs.tar.xz"
9-
if [ "$first" != 1 ];then
10-
if [ ! -f $tarball ]; then
11-
echo "Download Rootfs, this may take a while base on your internet speed."
12-
case `dpkg --print-architecture` in
13-
aarch64)
14-
archurl="arm64" ;;
15-
arm)
16-
archurl="armhf" ;;
17-
amd64)
18-
archurl="amd64" ;;
19-
x86_64)
20-
archurl="amd64" ;;
21-
i*86)
22-
archurl="i386" ;;
23-
x86)
24-
archurl="i386" ;;
25-
*)
26-
echo "unknown architecture"; exit 1 ;;
27-
esac
28-
wget "https://github.com/Techriz/AndronixOrigin/blob/master/Rootfs/Ubuntu/${archurl}/ubuntu-rootfs-${archurl}.tar.xz?raw=true" -O $tarball
2+
3+
# Variables
4+
BLUE="\e[34m" # Blue Color
5+
NO_COLOR="\e[39m" # No Color
6+
isFsPresent=0 # Handles if the tarball is downloaded or skipped (overridden by -f)
7+
distroName="Ubuntu" # Name of the concerned distro
8+
name="ubuntu" # Name of the concerned distro
9+
rootfsFolder=$name-fs # RootFS folder name
10+
bindsFolder=$name-fs # Bind folder name
11+
tarball="${name}-rootfs.tar.xz"
12+
folderSize=$(stat -c%s $rootfsFolder)
13+
14+
# Function used for sending updates to Andronix App
15+
function sendUpdates() {
16+
message=$(echo "$1" | sed 's/ /\\ /g')
17+
am broadcast --user 0 -a app.andronix.PROGRESS --es app.andronix.PROGRESS_STATUS "$message" >/dev/null
18+
}
19+
20+
#Welcome
21+
echo "
22+
___ __ _
23+
/ | ____ ____/ / _____ ____ ____ (_) _ __
24+
/ /| | / __ \ / __ / / ___/ / __ \ / __ \ / / | |/_/
25+
/ ___ | / / / // /_/ / / / / /_/ / / / / / / / _> <
26+
/_/ |_|/_/ /_/ \__,_/ /_/ \____/ /_/ /_/ /_/ /_/|_|
27+
"
28+
29+
echo -e "\n${BLUE}Welcome to the Andronix ${distroName} installer.${NO_COLOR}"
30+
echo -e "Join Andronix ${BLUE}Discord${NO_COLOR} @ https://chat.andronix.app (giveaways too ;)"
31+
echo -e "Read our ${BLUE}Documentation${NO_COLOR} @ https://docs.andronix.app \n\n"
32+
33+
sendUpdates "Script Detected"
34+
35+
sleep 1
36+
37+
# Getting the -f (force download flag)
38+
while getopts "f" OPTION; do
39+
# shellcheck disable=SC2220
40+
case $OPTION in
41+
f)
42+
echo -e "\nForcing the download..."
43+
rm -rf $rootfsFolder
44+
rm -rf $bindsFolder
45+
isFsPresent=0
46+
;;
47+
esac
48+
done
49+
50+
# Installing basic termux packages
51+
pkg install wget -y
52+
53+
# Checking if the rootfsFolder is present
54+
if [ -d "$rootfsFolder" ] && [ "$folderSize" -gt 6000 ]; then
55+
isFsPresent=1
56+
echo -e "\nRoot Files System already present. Skipping download..."
2957
fi
30-
cur=`pwd`
31-
mkdir -p "$folder"
32-
cd "$folder"
33-
echo "Decompressing Rootfs, please be patient."
34-
proot --link2symlink tar -xJf ${cur}/${tarball}||:
35-
cd "$cur"
58+
59+
if [ "$isFsPresent" != 1 ]; then
60+
if [ ! -f "$tarball" ]; then
61+
echo -e "\nDownloading Rootfs for ${distroName}. Please be patient...\n\n"
62+
case $(dpkg --print-architecture) in
63+
aarch64)
64+
arch="arm64"
65+
;;
66+
arm)
67+
arch="armhf"
68+
;;
69+
amd64)
70+
arch="amd64"
71+
;;
72+
x86_64)
73+
arch="amd64"
74+
;;
75+
i*86)
76+
arch="i386"
77+
;;
78+
x86)
79+
arch="i386"
80+
;;
81+
*)
82+
echo "There was an issue identifying the architecture of your device!"
83+
sendUpdates "Oops! Architecture error."
84+
exit 1
85+
;;
86+
esac
87+
sendUpdates "Downloading the files..."
88+
wget -q --show-progress --progress=bar "https://github.com/Techriz/AndronixOrigin/blob/master/Rootfs/${distroName}/${arch}/ubuntu-rootfs-${arch}.tar.xz?raw=true" -O $tarball
89+
fi
90+
currentDirectory=$(pwd)
91+
mkdir -p "$rootfsFolder"
92+
cd "$rootfsFolder"
93+
sendUpdates "Decompressing the files..."
94+
echo -e "\nDecompressing Rootfs. This can take a while. Please be patient."
95+
proot --link2symlink tar -xJf "${currentDirectory}"/${tarball} || :
96+
cd "$currentDirectory"
3697
fi
37-
mkdir -p ubuntu-binds
98+
99+
mkdir -p $bindsFolder
38100
bin=start-ubuntu.sh
39-
echo "writing launch script"
40-
cat > $bin <<- EOM
101+
echo -e "\nWriting the launch script now! Just a few more steps!"
102+
cat >$bin <<-EOM
41103
#!/bin/bash
42104
cd \$(dirname \$0)
43105
## unset LD_PRELOAD in case termux-exec is installed
44106
unset LD_PRELOAD
45107
command="proot"
46108
command+=" --link2symlink"
47109
command+=" -0"
48-
command+=" -r $folder"
49-
if [ -n "\$(ls -A ubuntu-binds)" ]; then
50-
for f in ubuntu-binds/* ;do
110+
command+=" -r $rootfsFolder"
111+
if [ -n "\$(ls -A $bindsFolder)" ]; then
112+
for f in $bindsFolder/* ;do
51113
. \$f
52114
done
53115
fi
@@ -56,7 +118,7 @@ command+=" -b /proc"
56118
command+=" -b ubuntu-fs/root:/dev/shm"
57119
## uncomment the following line to have access to the home directory of termux
58120
#command+=" -b /data/data/com.termux/files/home:/root"
59-
## uncomment the following line to mount /sdcard directly to /
121+
## uncomment the following line to mount /sdcard directly to /
60122
#command+=" -b /sdcard"
61123
command+=" -w /root"
62124
command+=" /usr/bin/env -i"
@@ -73,10 +135,14 @@ else
73135
fi
74136
EOM
75137

76-
echo "fixing shebang of $bin"
77138
termux-fix-shebang $bin
78-
echo "making $bin executable"
79139
chmod +x $bin
80-
echo "removing image for some space"
140+
echo "Saving some space..."
81141
rm $tarball
82-
echo "You can now launch Ubuntu with the ./${bin} script"
142+
echo -e "\n\nYay! All done. You can now start ${distroName} with running ${BLUE}\n./${bin}${NO_COLOR}"
143+
echo "You will then asked to configure some distro specific things."
144+
145+
sendUpdates "Installation Success!"
146+
147+
sleep 1
148+
echo "Exiting...Bye!"

0 commit comments

Comments
 (0)