Add compressed ramdisk support

This commit is contained in:
topjohnwu
2019-02-24 20:39:01 -05:00
parent 16ec37a226
commit 63b18246d8
7 changed files with 63 additions and 14 deletions

View File

@ -106,7 +106,15 @@ $IS64BIT && mv -f magiskinit64 magiskinit || rm -f magiskinit64
. ./boot_patch.sh "$BOOTIMAGE"
ui_print "- Flashing new boot image"
flash_image new-boot.img "$BOOTIMAGE" || abort "! Insufficient partition size"
if ! flash_image new-boot.img "$BOOTIMAGE"; then
ui_print "- Compressing ramdisk to fit in partition"
./magiskboot --cpio ramdisk.cpio compress
./magiskboot --repack "$BOOTIMAGE"
flash_image new-boot.img "$BOOTIMAGE" || abort "! Insufficient partition size"
fi
./magiskboot --cleanup
rm -f new-boot.img
if [ -f stock_boot* ]; then