Skip to content

Commit

Permalink
AK3: only allow repack of hdr v4 ramdisks as lz4-l
Browse files Browse the repository at this point in the history
- they all get overlayed and must be matching compression formats
  • Loading branch information
osm0sis committed Sep 18, 2023
1 parent 04376fb commit 19ab7e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
#
#
# AK_BASE_VERSION=20230913
# AK_BASE_VERSION=20230918
6 changes: 5 additions & 1 deletion tools/ak3-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ split_boot() {
elif [ -f "$bin/rkcrc" ]; then
dd bs=4096 skip=8 iflag=skip_bytes conv=notrunc if=$bootimg of=ramdisk.cpio.gz;
else
$bin/magiskboot unpack -h $bootimg;
(set -o pipefail; $bin/magiskboot unpack -h $bootimg 2>&1 | tee infotmp >&2);
case $? in
1) dumpfail=1;;
2) touch chromeos;;
Expand Down Expand Up @@ -193,6 +193,10 @@ repack_ramdisk() {
local comp packfail mtktype;

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
auto|"") comp=$(ls $split_img/ramdisk.cpio.* 2>/dev/null | grep -v 'mtk' | rev | cut -d. -f1 | rev);;
none|cpio) comp="";;
Expand Down

0 comments on commit 19ab7e1

Please sign in to comment.