Support separate ramdisk images

This commit is contained in:
topjohnwu
2018-02-10 03:34:13 +08:00
parent 10ed299c78
commit 6728445542
6 changed files with 102 additions and 114 deletions

View File

@@ -53,8 +53,6 @@ if [ -z $SOURCEDMODE ]; then
cd "`dirname_wrap "${BASH_SOURCE:-$0}"`"
# Load utility functions
. ./util_functions.sh
# Detect current status
mount_partitions
fi
BOOTIMAGE="$1"
@@ -68,7 +66,7 @@ BOOTIMAGE="$1"
if [ -z $KEEPFORCEENCRYPT ]; then
if [ "`getprop ro.crypto.state`" = "encrypted" ]; then
KEEPFORCEENCRYPT=true
ui_print "- Encrypted data detected"
ui_print "- Encrypted data detected, keep forceencrypt"
else
KEEPFORCEENCRYPT=false
fi
@@ -159,15 +157,17 @@ if ! $KEEPVERITY && [ -f dtb ]; then
./magiskboot --dtb-patch dtb && ui_print "- Patching fstab in dtb to remove dm-verity"
fi
# Remove Samsung RKP in stock kernel
./magiskboot --hexpatch kernel \
49010054011440B93FA00F71E9000054010840B93FA00F7189000054001840B91FA00F7188010054 \
A1020054011440B93FA00F7140020054010840B93FA00F71E0010054001840B91FA00F7181010054
if [ -f kernel ]; then
# Remove Samsung RKP in stock kernel
./magiskboot --hexpatch kernel \
49010054011440B93FA00F71E9000054010840B93FA00F7189000054001840B91FA00F7188010054 \
A1020054011440B93FA00F7140020054010840B93FA00F71E0010054001840B91FA00F7181010054
# skip_initramfs -> want_initramfs
./magiskboot --hexpatch kernel \
736B69705F696E697472616D6673 \
77616E745F696E697472616D6673
# skip_initramfs -> want_initramfs
./magiskboot --hexpatch kernel \
736B69705F696E697472616D6673 \
77616E745F696E697472616D6673
fi
##########################################################################################
# Repack and flash