Skip to content

Commit 3e996b5

Browse files
Merge pull request #36 from 23xvx/master
Keep Updating
2 parents e75fe5d + 7e7aa94 commit 3e996b5

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

plugins/envsetup

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ if [ "$(id -u)" != "0" ]; then
5656
fi
5757
fi
5858

59-
if [ -z $ENABLE_USER_SETUP ]; then
60-
export ENABLE_USER_SETUP=false
61-
fi
62-
6359
ROOT_DIR="$(git rev-parse --show-toplevel)"
6460

6561
trim_quotes() {
@@ -220,8 +216,11 @@ see_for_directory() {
220216

221217
no_to_directory() {
222218
dir="$1"
219+
if [ -z $NO_DIR_CHECK_OVERRIDE ]; then
220+
export NO_DIR_CHECK_OVERRIDE=false
221+
fi
223222
if [ -d "$dir" ]; then
224-
if [ "$NO_DIR_CHECK_OVERRIDE" == "true" ]; then
223+
if $NO_DIR_CHECK_OVERRIDE; then
225224
return 0
226225
else
227226
die "directory exits: $dir"
@@ -248,7 +247,6 @@ includes_packages() {
248247
export includes
249248
x=0
250249
for item in $includes; do
251-
#include_final="$item"
252250
((x = x + 1))
253251
done
254252
shout "$x includes processed "
@@ -261,13 +259,13 @@ do_build() {
261259

262260
local NO_COMPRESSION
263261

264-
if [ -z "$DISABLE_USER_SETUP" ]; then
265-
export DISABLE_USER_SETUP=false
262+
if [ -z $ENABLE_USER_SETUP ]; then
263+
export ENABLE_USER_SETUP=false
266264
fi
267265

268266
foreign_arch "$arch"
269267

270-
#Disable cross architecture building in Termux
268+
# disable cross architecture building in Termux
271269
if [ "$BUILD_PLATFORM" == "termux" ]; then
272270
case $worker_arch in
273271
aarch64) termux_arch="arm64" ;;
@@ -280,6 +278,7 @@ do_build() {
280278
return 0
281279
else
282280
lshout "Building on Termux"
281+
dpkg_depends_on debootstrap
283282
fi
284283
fi
285284

@@ -335,7 +334,6 @@ do_build() {
335334
fi
336335

337336
if [ "$BUILD_PLATFORM" == "termux" ]; then
338-
dpkg_depends_on debootstrap
339337
_debootstrap="$(which debootstrap)"
340338
FOREIGN=""
341339
fi
@@ -362,7 +360,7 @@ do_build() {
362360
fi
363361
fi
364362

365-
if [ "$ENABLE_USER_SETUP" == "true" ]; then
363+
if $ENABLE_USER_SETUP; then
366364
setup_user
367365
fi
368366

@@ -427,12 +425,19 @@ do_qemu_user_emulation() {
427425

428426
setup_user() {
429427
shout "Setting up user"
428+
[[ -z $FS_USER ]] && warn "no username provided, skipping user setup.." && return 0
429+
[[ -z $FS_PASS ]] && warn "no password provided, skipping user setup.." && return 0
430430
cp plugins/setup-user.sh $chroot_dir
431431
sed -i s/'$FS_USER'/$FS_USER/g $chroot_dir/setup-user.sh
432432
sed -i s/'$FS_PASS'/$FS_PASS/g $chroot_dir/setup-user.sh
433433
run_cmd "chmod +x /setup-user.sh"
434434
run_cmd "/bin/bash /setup-user.sh"
435435
run_cmd "rm -rf /setup-user.sh"
436+
if $(ls $chroot_dir/home/$FS_USER); then
437+
shout "User created : $FS_USER"
438+
else
439+
shout "User create failed..."
440+
fi
436441
}
437442

438443
do_chroot_proot_ae() {

0 commit comments

Comments
 (0)