AK3: restore f2dbe60 now that magiskboot split -n is supported

This commit is contained in:
osm0sis committed 2026-02-08 14:22:45 -04:00
1 parent 71e5f44869
commit 63c886e3b3
2 files changed
+10 -5

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=20260130 # AK_BASE_VERSION=20260208
+9 -4
View File
@@ -245,7 +245,7 @@ repack_ramdisk() {
# flash_boot (build, sign and write image only) # flash_boot (build, sign and write image only)
flash_boot() { flash_boot() {
local varlist i kernel ramdisk fdt cmdline comp part0 part1 nocompflag signfail pk8 cert avbtype; local varlist i kernel ramdisk fdt cmdline comp part0 part1 needskernelpatch nocompflag signfail pk8 cert avbtype;
cd $SPLITIMG; cd $SPLITIMG;
if [ -f "$BIN/mkimage" ]; then if [ -f "$BIN/mkimage" ]; then
@@ -329,16 +329,17 @@ flash_boot() {
if [ "$magisk_patched" -eq 1 ]; then if [ "$magisk_patched" -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=$(magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p'); comp=$(magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p');
(magiskboot split $kernel || magiskboot decompress $kernel kernel) 2>/dev/null; (magiskboot split $kernel || magiskboot decompress $kernel kernel) >&2;
if [ $? != 0 -a "$comp" ] && $comp --help 2>/dev/null; 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;
# legacy SAR kernel string skip_initramfs -> want_initramfs # legacy SAR kernel string skip_initramfs -> want_initramfs
magiskboot hexpatch kernel 736B69705F696E697472616D6673 77616E745F696E697472616D6673; magiskboot hexpatch kernel 736B69705F696E697472616D6673 77616E745F696E697472616D6673 && needskernelpatch=1;
if [ "$(file_getprop $AKHOME/anykernel.sh do.modules)" == 1 ] && [ "$(file_getprop $AKHOME/anykernel.sh do.systemless)" == 1 ]; then if [ "$(file_getprop $AKHOME/anykernel.sh do.modules)" == 1 ] && [ "$(file_getprop $AKHOME/anykernel.sh do.systemless)" == 1 ]; then
strings kernel 2>/dev/null | grep -E -m1 'Linux version.*#' > $AKHOME/vertmp; strings kernel 2>/dev/null | grep -E -m1 'Linux version.*#' > $AKHOME/vertmp;
fi; fi;
if [ "$needskernelpatch" ]; then
if [ "$comp" ]; then if [ "$comp" ]; then
magiskboot compress=$comp kernel kernel.$comp; magiskboot compress=$comp kernel kernel.$comp;
if [ $? != 0 ] && $comp --help 2>/dev/null; then if [ $? != 0 ] && $comp --help 2>/dev/null; then
@@ -347,6 +348,10 @@ flash_boot() {
fi; fi;
mv -f kernel.$comp kernel; mv -f kernel.$comp kernel;
fi; fi;
else
echo "Restoring untouched new kernel since no patching required..." >&2;
(magiskboot split -n $kernel || cp -f $kernel kernel) >&2;
fi;
[ ! -f .magisk ] && magiskboot cpio ramdisk.cpio "extract .backup/.magisk .magisk"; [ ! -f .magisk ] && magiskboot cpio ramdisk.cpio "extract .backup/.magisk .magisk";
export $(cat .magisk); export $(cat .magisk);
for fdt in dtb extra kernel_dtb recovery_dtbo; do for fdt in dtb extra kernel_dtb recovery_dtbo; do
@@ -355,7 +360,7 @@ flash_boot() {
elif [ -d /data/data/me.weishu.kernelsu ] && [ "$(file_getprop $AKHOME/anykernel.sh do.modules)" == 1 ] && [ "$(file_getprop $AKHOME/anykernel.sh do.systemless)" == 1 ]; then elif [ -d /data/data/me.weishu.kernelsu ] && [ "$(file_getprop $AKHOME/anykernel.sh do.modules)" == 1 ] && [ "$(file_getprop $AKHOME/anykernel.sh do.systemless)" == 1 ]; then
ui_print " " "KernelSU detected! Setting up for kernel helper module..."; ui_print " " "KernelSU detected! Setting up for kernel helper module...";
comp=$(magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p'); comp=$(magiskboot decompress kernel 2>&1 | grep -vE 'raw|zimage' | sed -n 's;.*\[\(.*\)\];\1;p');
(magiskboot split $kernel || magiskboot decompress $kernel kernel) 2>/dev/null; (magiskboot split $kernel || magiskboot decompress $kernel kernel) >&2;
if [ $? != 0 -a "$comp" ] && $comp --help 2>/dev/null; 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;