Skip to content

Commit 11ef15a

Browse files
committed
Fix errors in Termux
1 parent 30ed0e6 commit 11ef15a

File tree

1 file changed

+35
-28
lines changed

1 file changed

+35
-28
lines changed

plugins/envsetup

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@
2424
# SOFTWARE.
2525

2626
export ROOT_DIR
27+
export BUILD_PALTFORM="linux"
28+
29+
#Check if environment is Termux
30+
if [ "$(uname -o)" = "Android" ]; then
31+
export FS_COOK_PLATFORM="termux"
32+
fi
33+
34+
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
35+
lshout "Running on termux"
36+
BUILD_PALTFORM="termux"
37+
fi
2738

2839
if [ -z $ENABLE_USER_SETUP ]; then
2940
export ENABLE_USER_SETUP=false
@@ -105,24 +116,28 @@ do_mount() {
105116

106117
do_unmount()
107118
{
108-
local chroot_dir=$1
109-
points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc"
110-
see_for_directory "$points"
111-
if is_mounted "$chroot_dir/dev"; then
112-
shout "unmounting: $chroot_dir/dev"
113-
$SUDO umount "$chroot_dir"/dev/pts
114-
$SUDO umount "$chroot_dir"/dev
115-
fi
116-
117-
if is_mounted "$chroot_dir"/proc; then
118-
shout "unmounting: $chroot_dir/proc"
119-
$SUDO umount $chroot_dir/proc
120-
fi
121-
122-
if is_mounted "$chroot_dir"/sys; then
123-
shout "unmounting: $chroot_dir/sys"
124-
$SUDO umount "$chroot_dir"/sys
125-
fi
119+
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
120+
lshout "Skipping unmount for termux"
121+
else
122+
local chroot_dir=$1
123+
points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc"
124+
see_for_directory "$points"
125+
if is_mounted "$chroot_dir/dev"; then
126+
shout "unmounting: $chroot_dir/dev"
127+
$SUDO umount "$chroot_dir"/dev/pts
128+
$SUDO umount "$chroot_dir"/dev
129+
fi
130+
131+
if is_mounted "$chroot_dir"/proc; then
132+
shout "unmounting: $chroot_dir/proc"
133+
$SUDO umount $chroot_dir/proc
134+
fi
135+
136+
if is_mounted "$chroot_dir"/sys; then
137+
shout "unmounting: $chroot_dir/sys"
138+
$SUDO umount "$chroot_dir"/sys
139+
fi
140+
fi
126141
}
127142

128143
is_mounted() {
@@ -255,6 +270,7 @@ do_build() {
255270
foreign_arch "$arch"
256271
no_to_directory "$target_dir"
257272

273+
258274
export chroot_dir
259275
chroot_dir=$target_dir
260276

@@ -312,6 +328,7 @@ do_build() {
312328

313329
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
314330
lshout "Skipping second stage for termux"
331+
arch_translate "$arch"
315332
else
316333
do_second_stage "$target_dir" "$arch"
317334
fi
@@ -541,14 +558,4 @@ install_pkg()
541558

542559
banner
543560

544-
export BUILD_PALTFORM="linux"
545-
546-
#Check if environment is Termux
547-
if [ "$(uname -o)" = "Android" ]; then
548-
export FS_COOK_PLATFORM="termux"
549-
fi
550561

551-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
552-
lshout "Running on termux"
553-
BUILD_PALTFORM="termux"
554-
fi

0 commit comments

Comments
 (0)