2
0
mirror of https://github.com/topjohnwu/Magisk synced 2025-09-02 09:15:13 +00:00

Update dtb patch to not use in-place modification

This commit is contained in:
topjohnwu
2019-09-21 05:30:04 -04:00
parent 120668c7bc
commit 4d91e50d6d
7 changed files with 86 additions and 98 deletions

View File

@@ -280,11 +280,13 @@ patch_dtbo_image() {
find_dtbo_image
if [ ! -z $DTBOIMAGE ]; then
ui_print "- DTBO image: $DTBOIMAGE"
if $MAGISKBIN/magiskboot --dtb-test $DTBOIMAGE; then
local PATCHED=$TMPDIR/dtbo
if $MAGISKBIN/magiskboot dtb $DTBOIMAGE patch $PATCHED; then
ui_print "- Backing up stock DTBO image"
$MAGISKBIN/magiskboot --compress $DTBOIMAGE $MAGISKBIN/stock_dtbo.img.gz
$MAGISKBIN/magiskboot compress $DTBOIMAGE $MAGISKBIN/stock_dtbo.img.gz
ui_print "- Patching DTBO to remove avb-verity"
$MAGISKBIN/magiskboot --dtb-patch $DTBOIMAGE
cat $PATCHED /dev/zero > $DTBOIMAGE
rm -f $PATCHED
return 0
fi
fi