Backend: move busybox bin setup to setup_bb function, add tools to PATH

This commit is contained in:
osm0sis committed 2023-05-06 15:21:34 -03:00
1 parent 68564baf10
commit 8055e75b8e
2 files changed
+24 -20

No files matched your search

+23 -19
View File
@@ -237,6 +237,24 @@ restore_env() {
done; done;
umount -l /dev/random) 2>/dev/null; umount -l /dev/random) 2>/dev/null;
} }
setup_bb() {
local arch32 bb;
for arch32 in x86 arm; do
if [ -d $AKHOME/tools/$arch32 ]; then
bb=$AKHOME/tools/$arch32/busybox;
chmod 755 $bb;
$bb >/dev/null 2>&1;
if [ $? == 0 ]; then
$bb mv -f $AKHOME/tools/$arch32/* $AKHOME/tools;
break;
fi;
fi;
done;
bb=$AKHOME/tools/busybox;
chmod 755 $bb;
$bb chmod -R 755 tools bin;
$bb --install -s bin;
}
debugging() { debugging() {
local debug log path; local debug log path;
case $(basename "$ZIPFILE" .zip) in case $(basename "$ZIPFILE" .zip) in
@@ -252,7 +270,7 @@ debugging() {
fi; fi;
} }
cleanup() { cleanup() {
cd $(dirname $AKHOME); cd $AKHOME/../;
rm -rf $AKHOME; rm -rf $AKHOME;
} }
abort() { abort() {
@@ -441,26 +459,12 @@ unzip -o "$ZIPFILE";
if [ $? != 0 -o ! "$(ls tools)" ]; then if [ $? != 0 -o ! "$(ls tools)" ]; then
abort "Unzip failed. Aborting..."; abort "Unzip failed. Aborting...";
fi; fi;
for ARCH32 in x86 arm; do setup_bb;
if [ -d $AKHOME/tools/$ARCH32 ]; then
BB=$AKHOME/tools/$ARCH32/busybox;
chmod 755 $BB;
$BB >/dev/null 2>&1;
if [ $? == 0 ]; then
$BB mv -f $AKHOME/tools/$ARCH32/* $AKHOME/tools;
break;
fi;
fi;
done;
BB=$AKHOME/tools/busybox;
chmod 755 $BB;
$BB chmod -R 755 tools bin;
$BB --install -s bin;
if [ $? != 0 -o -z "$(ls bin)" ]; then if [ $? != 0 -o -z "$(ls bin)" ]; then
abort "Busybox setup failed. Aborting..."; abort "Busybox setup failed. Aborting...";
fi; fi;
OLD_PATH="$PATH"; OLD_PATH="$PATH";
export PATH="$AKHOME/bin:$PATH"; export PATH="$AKHOME/bin:$AKHOME/tools:$PATH";
if [ -f banner ]; then if [ -f banner ]; then
ui_printfile banner; ui_printfile banner;
@@ -499,10 +503,10 @@ debugging;
ui_print " "; ui_print " ";
restore_env; restore_env;
export PATH="$OLD_PATH";
unset OLD_PATH;
if [ "$(file_getprop anykernel.sh do.cleanup)" == 1 ]; then if [ "$(file_getprop anykernel.sh do.cleanup)" == 1 ]; then
cleanup; cleanup;
fi; fi;
ui_print " " "Done!"; ui_print " " "Done!";
export PATH="$OLD_PATH";
unset OLD_PATH OUTFD ZIPFILE;
+1 -1
View File
@@ -3,4 +3,4 @@
# Dummy file; update-binary is a shell script (DO NOT CHANGE) # Dummy file; update-binary is a shell script (DO NOT CHANGE)
# #
# #
# AK_BASE_VERSION=20230504 # AK_BASE_VERSION=20230506