Backend: move busybox bin setup to setup_bb function, add tools to PATH
This commit is contained in:
2 files changed
+24
-20
No files matched your search
@@ -237,6 +237,24 @@ restore_env() {
|
||||
done;
|
||||
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() {
|
||||
local debug log path;
|
||||
case $(basename "$ZIPFILE" .zip) in
|
||||
@@ -252,7 +270,7 @@ debugging() {
|
||||
fi;
|
||||
}
|
||||
cleanup() {
|
||||
cd $(dirname $AKHOME);
|
||||
cd $AKHOME/../;
|
||||
rm -rf $AKHOME;
|
||||
}
|
||||
abort() {
|
||||
@@ -441,26 +459,12 @@ unzip -o "$ZIPFILE";
|
||||
if [ $? != 0 -o ! "$(ls tools)" ]; then
|
||||
abort "Unzip failed. Aborting...";
|
||||
fi;
|
||||
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;
|
||||
setup_bb;
|
||||
if [ $? != 0 -o -z "$(ls bin)" ]; then
|
||||
abort "Busybox setup failed. Aborting...";
|
||||
fi;
|
||||
OLD_PATH="$PATH";
|
||||
export PATH="$AKHOME/bin:$PATH";
|
||||
export PATH="$AKHOME/bin:$AKHOME/tools:$PATH";
|
||||
|
||||
if [ -f banner ]; then
|
||||
ui_printfile banner;
|
||||
@@ -499,10 +503,10 @@ debugging;
|
||||
ui_print " ";
|
||||
restore_env;
|
||||
|
||||
export PATH="$OLD_PATH";
|
||||
unset OLD_PATH;
|
||||
if [ "$(file_getprop anykernel.sh do.cleanup)" == 1 ]; then
|
||||
cleanup;
|
||||
fi;
|
||||
|
||||
ui_print " " "Done!";
|
||||
export PATH="$OLD_PATH";
|
||||
unset OLD_PATH OUTFD ZIPFILE;
|
||||
@@ -3,4 +3,4 @@
|
||||
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
||||
#
|
||||
#
|
||||
# AK_BASE_VERSION=20230504
|
||||
# AK_BASE_VERSION=20230506
|
||||
Reference in new issue
Block a user