AK3: restore f2dbe60 now that magiskboot split -n is supported
This commit is contained in:
2 files changed
+16
-11
No files matched your search
@@ -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
|
||||||
+15
-10
@@ -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,23 +329,28 @@ 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 [ "$comp" ]; then
|
if [ "$needskernelpatch" ]; then
|
||||||
magiskboot compress=$comp kernel kernel.$comp;
|
if [ "$comp" ]; then
|
||||||
if [ $? != 0 ] && $comp --help 2>/dev/null; then
|
magiskboot compress=$comp kernel kernel.$comp;
|
||||||
echo "Attempting kernel repack with busybox $comp..." >&2;
|
if [ $? != 0 ] && $comp --help 2>/dev/null; then
|
||||||
$comp -9c kernel > kernel.$comp;
|
echo "Attempting kernel repack with busybox $comp..." >&2;
|
||||||
|
$comp -9c kernel > kernel.$comp;
|
||||||
|
fi;
|
||||||
|
mv -f kernel.$comp kernel;
|
||||||
fi;
|
fi;
|
||||||
mv -f kernel.$comp kernel;
|
else
|
||||||
|
echo "Restoring untouched new kernel since no patching required..." >&2;
|
||||||
|
(magiskboot split -n $kernel || cp -f $kernel kernel) >&2;
|
||||||
fi;
|
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);
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user