AK3: also ensure $comp fallback is a working command for ramdisks

This commit is contained in:
osm0sis committed 2022-04-10 22:30:19 -03:00
1 parent c19c5be18c
commit 97d2d7ffd5
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
#
#
# AK_BASE_VERSION=20220403
# AK_BASE_VERSION=20220410
+2 -2
View File
@@ -160,7 +160,7 @@ unpack_ramdisk() {
if [ "$comp" ]; then
mv -f ramdisk.cpio ramdisk.cpio.$comp;
$bin/magiskboot decompress ramdisk.cpio.$comp ramdisk.cpio;
if [ $? != 0 ]; then
if [ $? != 0 ] && $comp --help 2>/dev/null; then
echo "Attempting ramdisk unpack with busybox $comp..." >&2;
$comp -dc ramdisk.cpio.$comp > ramdisk.cpio;
fi;
@@ -216,7 +216,7 @@ repack_ramdisk() {
[ $((magisk_patched & 3)) -eq 1 ] && $bin/magiskboot cpio ramdisk-new.cpio "extract .backup/.magisk $split_img/.magisk";
if [ "$comp" ]; then
$bin/magiskboot compress=$comp ramdisk-new.cpio;
if [ $? != 0 ]; then
if [ $? != 0 ] && $comp --help 2>/dev/null; then
echo "Attempting ramdisk repack with busybox $comp..." >&2;
$comp -9c ramdisk-new.cpio > ramdisk-new.cpio.$comp;
[ $? != 0 ] && packfail=1;