Skip to content

Commit c77c31a

Browse files
Merge pull request #28 from 23xvx/add-support-platform-termux
Fix errors with proot in Termux
2 parents 60df6ef + 30ed0e6 commit c77c31a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

Diff for: plugins/envsetup

+7-5
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ includes_packages() {
234234
export includes
235235
x=0
236236
for item in $includes; do
237-
include_final="$item"
237+
#include_final="$item"
238238
((x = x + 1))
239239
done
240240
shout "$x includes processed "
@@ -304,7 +304,7 @@ do_build() {
304304
$FOREIGN \
305305
--arch="$arch" \
306306
--no-check-gpg \
307-
--include="${include_final}" \
307+
--include="${includes}" \
308308
"$suite" \
309309
"$target_dir" \
310310
$MIRROR
@@ -380,7 +380,6 @@ do_chroot_proot_ae() {
380380
shift
381381
local cmd_string=$*
382382
local root_fs_path=${chroot_dir}
383-
local container_user=root
384383

385384
unset LD_PRELOAD
386385
proot \
@@ -404,15 +403,13 @@ do_chroot_proot_ae() {
404403
--root-id \
405404
--cwd=/root -L \
406405
--kernel-release=5.4.0-faked \
407-
--kill-on-exit \
408406
--rootfs="${root_fs_path}" \
409407
-w /root \
410408
/usr/bin/env -i \
411409
HOME=/root \
412410
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
413411
TERM="$TERM" \
414412
LANG=C.UTF-8 \
415-
/bin/su -l $container_user \
416413
$cmd_string
417414

418415
}
@@ -546,6 +543,11 @@ banner
546543

547544
export BUILD_PALTFORM="linux"
548545

546+
#Check if environment is Termux
547+
if [ "$(uname -o)" = "Android" ]; then
548+
export FS_COOK_PLATFORM="termux"
549+
fi
550+
549551
if [ "$FS_COOK_PLATFORM" == "termux" ]; then
550552
lshout "Running on termux"
551553
BUILD_PALTFORM="termux"

Diff for: plugins/gz-packer.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
target=$1
44

55
tar \
6-
--exclude={/dev,/apex,/vendor,/system,/sdcard} \
6+
--exclude={/data,/dev,/apex,/vendor,/system,/sdcard} \
77
--exclude={/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \
88
--exclude="*.l2s.*" \
99
--exclude=/${0} \
@@ -13,4 +13,4 @@ tar \
1313
-cpf \
1414
- / -P \
1515
| pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\
16-
gzip --best > "${target}".tar.gz
16+
gzip --best > /"${target}".tar.gz

Diff for: plugins/j-packer.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
target=$1
44

55
tar \
6-
--exclude={/dev,/apex,/vendor,/system,/sdcard} \
6+
--exclude={/data,/dev,/apex,/vendor,/system,/sdcard} \
77
--exclude={/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \
88
--exclude="*.l2s.*" \
99
--exclude=/${0} \
@@ -13,4 +13,4 @@ tar \
1313
-cpf \
1414
- / -P \
1515
| pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\
16-
bzip2 --best > "${target}".tar.xz
16+
bzip2 --best > /"${target}".tar.xz

Diff for: plugins/lz-packer.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
target=$1
44

55
tar \
6-
--exclude={/dev,/apex,/vendor,/system,/sdcard} \
6+
--exclude={/data,/dev,/apex,/vendor,/system,/sdcard} \
77
--exclude={/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \
88
--exclude="*.l2s.*" \
99
--exclude=/${0} \
@@ -13,4 +13,4 @@ tar \
1313
-cpf \
1414
- / -P \
1515
| pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\
16-
lz4 -9 > "${target}".tar.lz # use high compression
16+
lz4 -9 > /"${target}".tar.lz # use high compression

0 commit comments

Comments
 (0)