Skip to content
Merged
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
27 changes: 16 additions & 11 deletions plugins/envsetup
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ if [ "$(id -u)" != "0" ]; then
fi
fi

if [ -z $ENABLE_USER_SETUP ]; then
export ENABLE_USER_SETUP=false
fi

ROOT_DIR="$(git rev-parse --show-toplevel)"

trim_quotes() {
Expand Down Expand Up @@ -220,8 +216,11 @@ see_for_directory() {

no_to_directory() {
dir="$1"
if [ -z $NO_DIR_CHECK_OVERRIDE ]; then
export NO_DIR_CHECK_OVERRIDE=false
fi
if [ -d "$dir" ]; then
if [ "$NO_DIR_CHECK_OVERRIDE" == "true" ]; then
if $NO_DIR_CHECK_OVERRIDE; then
return 0
else
die "directory exits: $dir"
Expand All @@ -248,7 +247,6 @@ includes_packages() {
export includes
x=0
for item in $includes; do
#include_final="$item"
((x = x + 1))
done
shout "$x includes processed "
Expand All @@ -261,13 +259,13 @@ do_build() {

local NO_COMPRESSION

if [ -z "$DISABLE_USER_SETUP" ]; then
export DISABLE_USER_SETUP=false
if [ -z $ENABLE_USER_SETUP ]; then
export ENABLE_USER_SETUP=false
fi

foreign_arch "$arch"

#Disable cross architecture building in Termux
# disable cross architecture building in Termux
if [ "$BUILD_PLATFORM" == "termux" ]; then
case $worker_arch in
aarch64) termux_arch="arm64" ;;
Expand All @@ -280,6 +278,7 @@ do_build() {
return 0
else
lshout "Building on Termux"
dpkg_depends_on debootstrap
fi
fi

Expand Down Expand Up @@ -335,7 +334,6 @@ do_build() {
fi

if [ "$BUILD_PLATFORM" == "termux" ]; then
dpkg_depends_on debootstrap
_debootstrap="$(which debootstrap)"
FOREIGN=""
fi
Expand All @@ -362,7 +360,7 @@ do_build() {
fi
fi

if [ "$ENABLE_USER_SETUP" == "true" ]; then
if $ENABLE_USER_SETUP; then
setup_user
fi

Expand Down Expand Up @@ -427,12 +425,19 @@ do_qemu_user_emulation() {

setup_user() {
shout "Setting up user"
[[ -z $FS_USER ]] && warn "no username provided, skipping user setup.." && return 0
[[ -z $FS_PASS ]] && warn "no password provided, skipping user setup.." && return 0
cp plugins/setup-user.sh $chroot_dir
sed -i s/'$FS_USER'/$FS_USER/g $chroot_dir/setup-user.sh
sed -i s/'$FS_PASS'/$FS_PASS/g $chroot_dir/setup-user.sh
run_cmd "chmod +x /setup-user.sh"
run_cmd "/bin/bash /setup-user.sh"
run_cmd "rm -rf /setup-user.sh"
if $(ls $chroot_dir/home/$FS_USER); then
shout "User created : $FS_USER"
else
shout "User create failed..."
fi
}

do_chroot_proot_ae() {
Expand Down