mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 05:07:45 +02:00
Add compressed ramdisk support
This commit is contained in:
@ -90,7 +90,8 @@ esac
|
||||
# Test patch status and do restore, after this section, ramdisk.cpio.orig is guaranteed to exist
|
||||
ui_print "- Checking ramdisk status"
|
||||
./magiskboot --cpio ramdisk.cpio test
|
||||
case $? in
|
||||
STATUS=$?
|
||||
case $((STATUS & 3)) in
|
||||
0 ) # Stock boot
|
||||
ui_print "- Stock boot image detected"
|
||||
ui_print "- Backing up stock boot image"
|
||||
@ -128,6 +129,11 @@ echo "KEEPFORCEENCRYPT=$KEEPFORCEENCRYPT" >> config
|
||||
"backup ramdisk.cpio.orig" \
|
||||
"add 000 .backup/.magisk config"
|
||||
|
||||
if [ $((STATUS & 4)) -ne 0 ]; then
|
||||
ui_print "- Compressing ramdisk"
|
||||
./magiskboot --cpio ramdisk.cpio compress
|
||||
fi
|
||||
|
||||
rm -f ramdisk.cpio.orig config
|
||||
|
||||
##########################################################################################
|
||||
@ -167,4 +173,5 @@ ui_print "- Repacking boot image"
|
||||
# Sign chromeos boot
|
||||
$CHROMEOS && sign_chromeos
|
||||
|
||||
./magiskboot --cleanup
|
||||
# Reset any error code
|
||||
true
|
||||
|
Reference in New Issue
Block a user