diff --git a/native/jni/magiskboot/ramdisk.cpp b/native/jni/magiskboot/ramdisk.cpp index bf4dfe47c..5192dbdbd 100644 --- a/native/jni/magiskboot/ramdisk.cpp +++ b/native/jni/magiskboot/ramdisk.cpp @@ -48,8 +48,8 @@ void magisk_cpio::patch() { auto cur = it++; bool fstab = (!keepverity || !keepforceencrypt) && S_ISREG(cur->second->mode) && - !str_starts(cur->first, ".backup") && - !str_contains(cur->first, "twrp") && + !str_starts(cur->first, ".backup") && + !str_contains(cur->first, "twrp") && !str_contains(cur->first, "recovery") && str_contains(cur->first, "fstab"); if (!keepverity) { @@ -73,7 +73,6 @@ void magisk_cpio::patch() { #define MAGISK_PATCHED (1 << 0) #define UNSUPPORTED_CPIO (1 << 1) #define COMPRESSED_CPIO (1 << 2) -#define TWO_STAGE_INIT (1 << 3) int magisk_cpio::test() { for (auto file : UNSUPPORT_LIST) @@ -87,9 +86,6 @@ int magisk_cpio::test() { decompress(); } - if (exists("apex") || exists("first_stage_ramdisk")) - flags |= TWO_STAGE_INIT; - for (auto file : MAGISK_LIST) { if (exists(file)) { flags |= MAGISK_PATCHED; diff --git a/scripts/boot_patch.sh b/scripts/boot_patch.sh index 8b9c49783..3d1841d7a 100644 --- a/scripts/boot_patch.sh +++ b/scripts/boot_patch.sh @@ -142,18 +142,13 @@ echo "RECOVERYMODE=$RECOVERYMODE" >> config "mkdir 000 .backup" \ "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 ################# # Binary Patches ################# -for dt in dtb kernel_dtb extra recovery_dtbo; do +for dt in dtb kernel_dtb extra; do [ -f $dt ] && ./magiskboot dtb $dt patch && ui_print "- Patch fstab in $dt" done