@@ -355,12 +355,14 @@ flash_boot() {
355
355
echo " Attempting kernel unpack with busybox $comp ..." >&2 ;
356
356
$comp -dc $kernel > kernel;
357
357
fi ;
358
- if strings kernel 2> /dev/null | grep -q -E ' ^/data/adb/ksud$' ; then
358
+ strings kernel > stringstmp 2> /dev/null;
359
+ if grep -q -E ' ^/data/adb/ksud$' stringstmp; then
359
360
touch $home /kernelsu_patched;
360
- strings kernel 2> /dev/null | grep -E -m1 ' Linux version.*#' > $home /vertmp;
361
+ grep -E -m1 ' Linux version.*#' stringstmp > $home /vertmp;
361
362
else
362
363
ui_print " " " Warning: No KernelSU support detected in kernel!" ;
363
364
fi ;
365
+ rm -f stringstmp;
364
366
if [ " $comp " ]; then
365
367
$bin /magiskboot compress=$comp kernel kernel.$comp ;
366
368
if [ $? != 0 ] && $comp --help 2> /dev/null; then
@@ -390,10 +392,8 @@ flash_boot() {
390
392
if [ $? != 0 ]; then
391
393
abort " Repacking image failed. Aborting..." ;
392
394
fi ;
393
- if [ -f .magisk ]; then
394
- touch $home /magisk_patched;
395
- unset PATCHVBMETAFLAG;
396
- fi ;
395
+ [ " $PATCHVBMETAFLAG " ] && unset PATCHVBMETAFLAG;
396
+ [ -f .magisk ] && touch $home /magisk_patched;
397
397
398
398
cd $home ;
399
399
if [ -f " $bin /futility" -a -d " $bin /chromeos" ]; then
@@ -875,7 +875,7 @@ setup_ak() {
875
875
esac ;
876
876
for name in $parttype ; do
877
877
for part in $name$slot $name ; do
878
- if [ " $( grep -w " $part " /proc/mtd 2> /dev/null) " ]; then
878
+ if [ " $( grep -w " $part " /proc/mtd 2> /dev/null) " ]; then
879
879
mtdmount=$( grep -w " $part " /proc/mtd) ;
880
880
mtdpart=$( echo $mtdmount | cut -d\" -f2) ;
881
881
if [ " $mtdpart " == " $part " ]; then
0 commit comments