Skip to content

Fix errors with proot in Termux #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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