Backend: clean up old style tic
This commit is contained in:
1 file changed
+24
-24
@@ -12,9 +12,9 @@ $BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMO
|
||||
DIR=/sdcard;
|
||||
$BOOTMODE || DIR=$(dirname "$ZIPFILE");
|
||||
|
||||
test -d /postinstall/tmp && POSTINSTALL=/postinstall;
|
||||
test "$AKHOME" || AKHOME=$POSTINSTALL/tmp/anykernel;
|
||||
test "$ANDROID_ROOT" || ANDROID_ROOT=/system;
|
||||
[ -d /postinstall/tmp ] && POSTINSTALL=/postinstall;
|
||||
[ "$AKHOME" ] || AKHOME=$POSTINSTALL/tmp/anykernel;
|
||||
[ "$ANDROID_ROOT" ] || ANDROID_ROOT=/system;
|
||||
|
||||
ui_print() {
|
||||
until [ ! "$1" ]; do
|
||||
@@ -32,16 +32,16 @@ show_progress() { echo "progress $1 $2" >> $OUTFD; }
|
||||
file_getprop() { $BB grep "^$2=" "$1" | $BB cut -d= -f2-; }
|
||||
find_slot() {
|
||||
local slot=$(getprop ro.boot.slot_suffix 2>/dev/null);
|
||||
test "$slot" || slot=$($BB grep -o 'androidboot.slot_suffix=.*$' /proc/cmdline | $BB cut -d\ -f1 | $BB cut -d= -f2);
|
||||
[ "$slot" ] || slot=$($BB grep -o 'androidboot.slot_suffix=.*$' /proc/cmdline | $BB cut -d\ -f1 | $BB cut -d= -f2);
|
||||
if [ ! "$slot" ]; then
|
||||
slot=$(getprop ro.boot.slot 2>/dev/null);
|
||||
test "$slot" || slot=$($BB grep -o 'androidboot.slot=.*$' /proc/cmdline | $BB cut -d\ -f1 | $BB cut -d= -f2);
|
||||
test "$slot" && slot=_$slot;
|
||||
[ "$slot" ] || slot=$($BB grep -o 'androidboot.slot=.*$' /proc/cmdline | $BB cut -d\ -f1 | $BB cut -d= -f2);
|
||||
[ "$slot" ] && slot=_$slot;
|
||||
fi;
|
||||
test "$slot" && echo "$slot";
|
||||
[ "$slot" ] && echo "$slot";
|
||||
}
|
||||
setup_mountpoint() {
|
||||
test -L $1 && $BB mv -f $1 ${1}_link;
|
||||
[ -L $1 ] && $BB mv -f $1 ${1}_link;
|
||||
if [ ! -d $1 ]; then
|
||||
rm -f $1;
|
||||
mkdir -p $1;
|
||||
@@ -49,15 +49,15 @@ setup_mountpoint() {
|
||||
}
|
||||
is_mounted() { $BB mount | $BB grep -q " $1 "; }
|
||||
mount_apex() {
|
||||
test -d /system_root/system/apex || return 1;
|
||||
[ -d /system_root/system/apex ] || return 1;
|
||||
local apex dest loop minorx num;
|
||||
setup_mountpoint /apex;
|
||||
minorx=1;
|
||||
test -e /dev/block/loop1 && minorx=$($BB ls -l /dev/block/loop1 | $BB awk '{ print $6 }');
|
||||
[ -e /dev/block/loop1 ] && minorx=$($BB ls -l /dev/block/loop1 | $BB awk '{ print $6 }');
|
||||
num=0;
|
||||
for apex in /system_root/system/apex/*; do
|
||||
dest=/apex/$($BB basename $apex .apex);
|
||||
test "$dest" == /apex/com.android.runtime.release && dest=/apex/com.android.runtime;
|
||||
[ "$dest" == /apex/com.android.runtime.release ] && dest=/apex/com.android.runtime;
|
||||
$BB mkdir -p $dest;
|
||||
case $apex in
|
||||
*.apex)
|
||||
@@ -86,7 +86,7 @@ mount_apex() {
|
||||
export BOOTCLASSPATH=/apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/system/framework/telephony-ext.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar;
|
||||
}
|
||||
umount_apex() {
|
||||
test -d /apex || return 1;
|
||||
[ -d /apex ] || return 1;
|
||||
local dest loop;
|
||||
for dest in $($BB find /apex -type d -mindepth 1 -maxdepth 1); do
|
||||
if [ -f $dest.img ]; then
|
||||
@@ -124,11 +124,11 @@ mount_all() {
|
||||
($BB umount /system;
|
||||
$BB umount -l /system) 2>/dev/null;
|
||||
if [ -d /dev/block/mapper ]; then
|
||||
test -e /dev/block/mapper/system || local slot=$(find_slot);
|
||||
[ -e /dev/block/mapper/system ] || local slot=$(find_slot);
|
||||
$BB mount -o ro -t auto /dev/block/mapper/vendor$slot /vendor;
|
||||
$BB mount -o ro -t auto /dev/block/mapper/system$slot /system_root;
|
||||
else
|
||||
test -e /dev/block/bootdevice/by-name/system || local slot=$(find_slot);
|
||||
[ -e /dev/block/bootdevice/by-name/system ] || local slot=$(find_slot);
|
||||
$BB mount -o ro -t auto /dev/block/bootdevice/by-name/vendor$slot /vendor 2>/dev/null;
|
||||
$BB mount -o ro -t auto /dev/block/bootdevice/by-name/system$slot /system_root;
|
||||
fi;
|
||||
@@ -211,11 +211,11 @@ restore_env() {
|
||||
$BOOTMODE && return 1;
|
||||
local dir;
|
||||
unset -f getprop;
|
||||
test "$OLD_LD_PATH" && export LD_LIBRARY_PATH=$OLD_LD_PATH;
|
||||
test "$OLD_LD_PRE" && export LD_PRELOAD=$OLD_LD_PRE;
|
||||
test "$OLD_LD_CFG" && export LD_CONFIG_FILE=$OLD_LD_CFG;
|
||||
[ "$OLD_LD_PATH" ] && export LD_LIBRARY_PATH=$OLD_LD_PATH;
|
||||
[ "$OLD_LD_PRE" ] && export LD_PRELOAD=$OLD_LD_PRE;
|
||||
[ "$OLD_LD_CFG" ] && export LD_CONFIG_FILE=$OLD_LD_CFG;
|
||||
umount_all;
|
||||
test -L /etc_link && $BB rm -rf /etc/*;
|
||||
[ -L /etc_link ] && $BB rm -rf /etc/*;
|
||||
(for dir in /apex /system /system_root /etc; do
|
||||
if [ -L "${dir}_link" ]; then
|
||||
rmdir $dir;
|
||||
@@ -228,7 +228,7 @@ debugging() {
|
||||
case $(basename "$ZIPFILE" .zip) in
|
||||
*-debugging)
|
||||
ui_print " " "Creating debugging archive in $DIR...";
|
||||
test -f /tmp/recovery.log && local log=/tmp/recovery.log;
|
||||
[ -f /tmp/recovery.log ] && local log=/tmp/recovery.log;
|
||||
$BB tar -czf "$DIR/anykernel3-$(date +%Y-%m-%d_%H%M%S)-debug.tgz" $AKHOME $log;
|
||||
;;
|
||||
esac;
|
||||
@@ -247,7 +247,7 @@ abort() {
|
||||
exit 1;
|
||||
}
|
||||
do_devicecheck() {
|
||||
test "$(file_getprop anykernel.sh do.devicecheck)" == 1 || return 1;
|
||||
[ "$(file_getprop anykernel.sh do.devicecheck)" == 1 ] || return 1;
|
||||
local device devicename match product testname vendordevice vendorproduct;
|
||||
ui_print "Checking device...";
|
||||
device=$(getprop ro.product.device 2>/dev/null);
|
||||
@@ -277,7 +277,7 @@ int2ver() {
|
||||
fi;
|
||||
}
|
||||
do_versioncheck() {
|
||||
test "$(file_getprop anykernel.sh supported.versions)" || return 1;
|
||||
[ "$(file_getprop anykernel.sh supported.versions)" ] || return 1;
|
||||
local android_ver hi_ver lo_ver parsed_ver supported supported_ver;
|
||||
ui_print "Checking Android version...";
|
||||
supported_ver=$(file_getprop anykernel.sh supported.versions | $BB tr -d '[:space:]');
|
||||
@@ -304,7 +304,7 @@ do_versioncheck() {
|
||||
fi;
|
||||
}
|
||||
do_levelcheck() {
|
||||
test "$(file_getprop anykernel.sh supported.patchlevels)" || return 1;
|
||||
[ "$(file_getprop anykernel.sh supported.patchlevels)" ] || return 1;
|
||||
local android_lvl hi_lvl lo_lvl parsed_lvl supported_lvl;
|
||||
ui_print "Checking Android security patch level...";
|
||||
supported_lvl=$(file_getprop anykernel.sh supported.patchlevels | $BB grep -oE '[0-9]{4}-[0-9]{2}|-');
|
||||
@@ -345,7 +345,7 @@ fi;
|
||||
EOF
|
||||
}
|
||||
do_modules() {
|
||||
test "$(file_getprop anykernel.sh do.modules)" == 1 || return 1;
|
||||
[ "$(file_getprop anykernel.sh do.modules)" == 1 ] || return 1;
|
||||
local block modcon moddir modtarget module slot umask;
|
||||
if [ "$(file_getprop anykernel.sh do.systemless)" == 1 ]; then
|
||||
cd $AKHOME/modules;
|
||||
@@ -460,7 +460,7 @@ do_levelcheck;
|
||||
|
||||
ui_print "Installing...";
|
||||
CORE=$($BB grep -oE 'ak.*core.sh' anykernel.sh);
|
||||
test -f tools/$CORE || $BB ln -s $AKHOME/tools/ak*-core.sh $AKHOME/tools/$CORE;
|
||||
[ -f tools/$CORE ] || $BB ln -s $AKHOME/tools/ak*-core.sh $AKHOME/tools/$CORE;
|
||||
PATH="$AKHOME/bin:$PATH" home=$AKHOME $BB ash anykernel.sh $2;
|
||||
if [ $? != 0 ]; then
|
||||
abort;
|
||||
|
||||
Reference in new issue
Block a user