AK3: only allow repack of hdr v4 ramdisks as lz4-l
- they all get overlayed and must be matching compression formats
This commit is contained in:
2 files changed
+6
-2
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=20230913
|
# AK_BASE_VERSION=20230918
|
||||||
+5
-1
@@ -127,7 +127,7 @@ split_boot() {
|
|||||||
elif [ -f "$bin/rkcrc" ]; then
|
elif [ -f "$bin/rkcrc" ]; then
|
||||||
dd bs=4096 skip=8 iflag=skip_bytes conv=notrunc if=$bootimg of=ramdisk.cpio.gz;
|
dd bs=4096 skip=8 iflag=skip_bytes conv=notrunc if=$bootimg of=ramdisk.cpio.gz;
|
||||||
else
|
else
|
||||||
$bin/magiskboot unpack -h $bootimg;
|
(set -o pipefail; $bin/magiskboot unpack -h $bootimg 2>&1 | tee infotmp >&2);
|
||||||
case $? in
|
case $? in
|
||||||
1) dumpfail=1;;
|
1) dumpfail=1;;
|
||||||
2) touch chromeos;;
|
2) touch chromeos;;
|
||||||
@@ -193,6 +193,10 @@ repack_ramdisk() {
|
|||||||
local comp packfail mtktype;
|
local comp packfail mtktype;
|
||||||
|
|
||||||
cd $home;
|
cd $home;
|
||||||
|
if [ "$ramdisk_compression" != "auto" ] && [ "$(grep HEADER_VER $split_img/infotmp | sed -n 's;.*\[\(.*\)\];\1;p')" -gt 3 ]; then
|
||||||
|
ui_print " " "Warning: Only lz4-l ramdisk compression is allowed with hdr v4+ images. Resetting to auto...";
|
||||||
|
ramdisk_compression=auto;
|
||||||
|
fi;
|
||||||
case $ramdisk_compression in
|
case $ramdisk_compression in
|
||||||
auto|"") comp=$(ls $split_img/ramdisk.cpio.* 2>/dev/null | grep -v 'mtk' | rev | cut -d. -f1 | rev);;
|
auto|"") comp=$(ls $split_img/ramdisk.cpio.* 2>/dev/null | grep -v 'mtk' | rev | cut -d. -f1 | rev);;
|
||||||
none|cpio) comp="";;
|
none|cpio) comp="";;
|
||||||
|
|||||||
Reference in new issue
Block a user