Skip to content

Commit

Permalink
Merge pull request #28 from 23xvx/add-support-platform-termux
Browse files Browse the repository at this point in the history
Fix errors with proot in Termux
  • Loading branch information
SaicharanKandukuri authored Dec 6, 2023
2 parents 60df6ef + 30ed0e6 commit c77c31a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions plugins/envsetup
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ includes_packages() {
export includes
x=0
for item in $includes; do
include_final="$item"
#include_final="$item"
((x = x + 1))
done
shout "$x includes processed "
Expand Down Expand Up @@ -304,7 +304,7 @@ do_build() {
$FOREIGN \
--arch="$arch" \
--no-check-gpg \
--include="${include_final}" \
--include="${includes}" \
"$suite" \
"$target_dir" \
$MIRROR
Expand Down Expand Up @@ -380,7 +380,6 @@ do_chroot_proot_ae() {
shift
local cmd_string=$*
local root_fs_path=${chroot_dir}
local container_user=root

unset LD_PRELOAD
proot \
Expand All @@ -404,15 +403,13 @@ do_chroot_proot_ae() {
--root-id \
--cwd=/root -L \
--kernel-release=5.4.0-faked \
--kill-on-exit \
--rootfs="${root_fs_path}" \
-w /root \
/usr/bin/env -i \
HOME=/root \
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
TERM="$TERM" \
LANG=C.UTF-8 \
/bin/su -l $container_user \
$cmd_string

}
Expand Down Expand Up @@ -546,6 +543,11 @@ banner

export BUILD_PALTFORM="linux"

#Check if environment is Termux
if [ "$(uname -o)" = "Android" ]; then
export FS_COOK_PLATFORM="termux"
fi

if [ "$FS_COOK_PLATFORM" == "termux" ]; then
lshout "Running on termux"
BUILD_PALTFORM="termux"
Expand Down
4 changes: 2 additions & 2 deletions plugins/gz-packer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
target=$1

tar \
--exclude={/dev,/apex,/vendor,/system,/sdcard} \
--exclude={/data,/dev,/apex,/vendor,/system,/sdcard} \
--exclude={/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \
--exclude="*.l2s.*" \
--exclude=/${0} \
Expand All @@ -13,4 +13,4 @@ tar \
-cpf \
- / -P \
| pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\
gzip --best > "${target}".tar.gz
gzip --best > /"${target}".tar.gz
4 changes: 2 additions & 2 deletions plugins/j-packer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
target=$1

tar \
--exclude={/dev,/apex,/vendor,/system,/sdcard} \
--exclude={/data,/dev,/apex,/vendor,/system,/sdcard} \
--exclude={/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found/*} \
--exclude="*.l2s.*" \
--exclude=/${0} \
Expand All @@ -13,4 +13,4 @@ tar \
-cpf \
- / -P \
| pv -s $(($(du -skx / | awk '{print $1}') * 1024)) |\
bzip2 --best > "${target}".tar.xz
bzip2 --best > /"${target}".tar.xz
4 changes: 2 additions & 2 deletions plugins/lz-packer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
target=$1

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

0 comments on commit c77c31a

Please sign in to comment.