AK3: fix unset PATCHVBMETAFLAG, only read kernel strings once
This commit is contained in:
1 file changed
+7
-7
+7
-7
@@ -355,12 +355,14 @@ flash_boot() {
|
|||||||
echo "Attempting kernel unpack with busybox $comp..." >&2;
|
echo "Attempting kernel unpack with busybox $comp..." >&2;
|
||||||
$comp -dc $kernel > kernel;
|
$comp -dc $kernel > kernel;
|
||||||
fi;
|
fi;
|
||||||
if strings kernel 2>/dev/null | grep -q -E '^/data/adb/ksud$'; then
|
strings kernel > stringstmp 2>/dev/null;
|
||||||
|
if grep -q -E '^/data/adb/ksud$' stringstmp; then
|
||||||
touch $home/kernelsu_patched;
|
touch $home/kernelsu_patched;
|
||||||
strings kernel 2>/dev/null | grep -E -m1 'Linux version.*#' > $home/vertmp;
|
grep -E -m1 'Linux version.*#' stringstmp > $home/vertmp;
|
||||||
else
|
else
|
||||||
ui_print " " "Warning: No KernelSU support detected in kernel!";
|
ui_print " " "Warning: No KernelSU support detected in kernel!";
|
||||||
fi;
|
fi;
|
||||||
|
rm -f stringstmp;
|
||||||
if [ "$comp" ]; then
|
if [ "$comp" ]; then
|
||||||
$bin/magiskboot compress=$comp kernel kernel.$comp;
|
$bin/magiskboot compress=$comp kernel kernel.$comp;
|
||||||
if [ $? != 0 ] && $comp --help 2>/dev/null; then
|
if [ $? != 0 ] && $comp --help 2>/dev/null; then
|
||||||
@@ -390,10 +392,8 @@ flash_boot() {
|
|||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
abort "Repacking image failed. Aborting...";
|
abort "Repacking image failed. Aborting...";
|
||||||
fi;
|
fi;
|
||||||
if [ -f .magisk ]; then
|
[ "$PATCHVBMETAFLAG" ] && unset PATCHVBMETAFLAG;
|
||||||
touch $home/magisk_patched;
|
[ -f .magisk ] && touch $home/magisk_patched;
|
||||||
unset PATCHVBMETAFLAG;
|
|
||||||
fi;
|
|
||||||
|
|
||||||
cd $home;
|
cd $home;
|
||||||
if [ -f "$bin/futility" -a -d "$bin/chromeos" ]; then
|
if [ -f "$bin/futility" -a -d "$bin/chromeos" ]; then
|
||||||
@@ -875,7 +875,7 @@ setup_ak() {
|
|||||||
esac;
|
esac;
|
||||||
for name in $parttype; do
|
for name in $parttype; do
|
||||||
for part in $name$slot $name; do
|
for part in $name$slot $name; do
|
||||||
if [ "$(grep -w "$part" /proc/mtd 2> /dev/null)" ]; then
|
if [ "$(grep -w "$part" /proc/mtd 2>/dev/null)" ]; then
|
||||||
mtdmount=$(grep -w "$part" /proc/mtd);
|
mtdmount=$(grep -w "$part" /proc/mtd);
|
||||||
mtdpart=$(echo $mtdmount | cut -d\" -f2);
|
mtdpart=$(echo $mtdmount | cut -d\" -f2);
|
||||||
if [ "$mtdpart" == "$part" ]; then
|
if [ "$mtdpart" == "$part" ]; then
|
||||||
|
|||||||
Reference in new issue
Block a user