Skip to content

Commit f50c7f9

Browse files
committed
Improve environment for termux
1 parent 7368679 commit f50c7f9

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

plugins/envsetup

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ do_mount() {
112112
do_unmount()
113113
{
114114
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
115-
lshout "Skipping unmount for termux"
115+
lshout "Skip unmount for termux"
116116
else
117117
local chroot_dir=$1
118118
points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc"
@@ -263,10 +263,26 @@ do_build() {
263263
export DISABLE_USER_SETUP=false
264264
fi
265265

266-
includes_packages
267266
foreign_arch "$arch"
268-
no_to_directory "$target_dir"
269267

268+
#Disable cross architecture building in Termux
269+
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
270+
case $worker_arch in
271+
aarch64) termux_arch="arm64" ;;
272+
arm*) termux_arch="armhf" ;;
273+
amd64|x86_64) termux_arch="amd64" ;;
274+
*) die "Unknown architecture" ;;
275+
esac
276+
if [ "$termux_arch" != "$arch" ]; then
277+
lshout "Skip building $target_dir for termux"
278+
return 0
279+
else
280+
lshout "Building on Termux"
281+
fi
282+
fi
283+
284+
includes_packages
285+
no_to_directory "$target_dir"
270286

271287
export chroot_dir
272288
chroot_dir=$target_dir
@@ -289,22 +305,6 @@ do_build() {
289305
suite="jammy"
290306
fi
291307

292-
#Disable cross architecture building in Termux
293-
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
294-
case $worker_arch in
295-
aarch64) termux_arch="arm64" ;;
296-
arm*) termux_arch="armhf" ;;
297-
amd64|x86_64) termux_arch="amd64" ;;
298-
*) die "Unknown architecture" ;;
299-
esac
300-
if [ "$termux_arch" != "$arch" ]; then
301-
lshout "Skipping cross architecture building for termux"
302-
return 0
303-
else
304-
lshout "Building on Termux"
305-
fi
306-
fi
307-
308308
shout "debootstraping $suite to $target_dir"
309309

310310
if [[ -n $OVERRIDER_MIRROR ]]; then
@@ -434,7 +434,6 @@ do_chroot_proot_ae() {
434434
--cwd=/root -L \
435435
--kernel-release=5.4.0-faked \
436436
--rootfs="${root_fs_path}" \
437-
-w /root \
438437
/usr/bin/env -i \
439438
HOME=/root \
440439
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
@@ -474,7 +473,7 @@ do_compress() {
474473

475474
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
476475
if [ ! -d "$chroot_dir" ]; then
477-
lshout "skip compressing $chroot_dir "
476+
lshout "Skip compressing $chroot_dir "
478477
return 0
479478
fi
480479
fi

0 commit comments

Comments
 (0)