Backend: add developer option to create a debugging archive

- to make it easier to diagnose issues with patches, image creation or flashing, adding "-debugging" to the end of the AK2 zip filename will enable the creation of a tar.gz of the entire /tmp directory after the installation process (but before cleanup, of course), this includes recovery.log, boot.img, boot-new.img and any other remnants to allow more thorough, direct debugging at a later time
This commit is contained in:
osm0sis committed 2017-05-28 18:44:46 -03:00
1 parent 633e042fc6
commit c4d0ed8f9c
1 file changed
+11 -3
+11 -3
View File
@@ -3,8 +3,8 @@
# osm0sis @ xda-developers
OUTFD=/proc/self/fd/$2;
ZIP="$3";
DIR=`dirname "$ZIP"`;
ZIPFILE="$3";
DIR=`dirname "$ZIPFILE"`;
ui_print() {
until [ ! "$1" ]; do
@@ -37,7 +37,7 @@ ui_print " ";
cleanup;
mkdir -p /tmp/anykernel/bin;
cd /tmp/anykernel;
unzip -o "$ZIP";
unzip -o "$ZIPFILE";
if [ $? != 0 -o -z "$(ls /tmp/anykernel/tools)" ]; then
abort "Unzip failed. Aborting...";
fi;
@@ -89,6 +89,14 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then
mount -o ro,remount -t auto /system;
fi;
case $(basename "$ZIPFILE" .zip) in
*-debugging)
ui_print " ";
ui_print "Creating debugging archive in zip directory...";
$bb tar -czvf "$DIR/anykernel2-$(date +%Y-%m-%d_%H%M%S)-debug.tgz" /tmp/*;
;;
esac;
if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanup)" == 1 ]; then
cleanup;
fi;