AK3: fix unpack/repack with magiskboot zimage kernel support

- exclude "zimage" as a compression type since magiskboot unpack, split and repack handle it automatically and there is no fallback
- ensure $comp is a working command for all busybox compression fallbacks
This commit is contained in:
osm0sis committed 2022-04-03 09:19:15 -03:00
1 parent 991bb673a7
commit c19c5be18c
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@
# Dummy file; update-binary is a shell script (DO NOT CHANGE) # Dummy file; update-binary is a shell script (DO NOT CHANGE)
# #
# #
# AK_BASE_VERSION=20220310 # AK_BASE_VERSION=20220403
+3 -3
View File
@@ -320,9 +320,9 @@ flash_boot() {
fi; fi;
if [ $((magisk_patched & 3)) -eq 1 ]; then if [ $((magisk_patched & 3)) -eq 1 ]; then
ui_print " " "Magisk detected! Patching kernel so reflashing Magisk is not necessary..."; ui_print " " "Magisk detected! Patching kernel so reflashing Magisk is not necessary...";
comp=$($bin/magiskboot decompress kernel 2>&1 | grep -v 'raw' | sed -n 's;.*\[\(.*\)\];\1;p'); comp=$($bin/magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p');
($bin/magiskboot split $kernel || $bin/magiskboot decompress $kernel kernel) 2>/dev/null; ($bin/magiskboot split $kernel || $bin/magiskboot decompress $kernel kernel) 2>/dev/null;
if [ $? != 0 -a "$comp" ]; then if [ $? != 0 -a "$comp" ] && $comp --help 2>/dev/null; then
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;
@@ -332,7 +332,7 @@ flash_boot() {
fi; fi;
if [ "$comp" ]; then if [ "$comp" ]; then
$bin/magiskboot compress=$comp kernel kernel.$comp; $bin/magiskboot compress=$comp kernel kernel.$comp;
if [ $? != 0 ]; then if [ $? != 0 ] && $comp --help 2>/dev/null; then
echo "Attempting kernel repack with busybox $comp..." >&2; echo "Attempting kernel repack with busybox $comp..." >&2;
$comp -9c kernel > kernel.$comp; $comp -9c kernel > kernel.$comp;
fi; fi;