Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v22 Magisk Survival Script not working #3908

Closed
twu2 opened this issue Feb 24, 2021 · 5 comments
Closed

v22 Magisk Survival Script not working #3908

twu2 opened this issue Feb 24, 2021 · 5 comments

Comments

@twu2
Copy link

twu2 commented Feb 24, 2021

the script was executed after rom update, but after reboot, still lost root.
need to flash magisk v22 zip after rom update.

@topjohnwu
Copy link
Owner

#3820

@twu2
Copy link
Author

twu2 commented Feb 24, 2021

I think that's different issue.
#3820 lost root after OTA because no /system/addon.d/99-magisk.sh exist.
But in my case, it exist and identified with /data/adb/magisk/addon.d.sh, and it was executed after install ROM, and still lost root.

in /tmp/recovery.log (reinstall the ROM zip), it show the addon.d.sh patch boot image and flash it, but after reboot, it lost root:

 Magisk 22.0 addon.d 
*********************
- Mounting /system
- Target image: /dev/block/platform/sdhci-tegra.3/by-name/LNX
! Unable to detect Magisk Manager APK for BootSigner
sh: 21: unknown operand
- Unpacking boot image
Parsing boot image: [/dev/block/platform/sdhci-tegra.3/by-name/LNX]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1154429]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [3f4f350142e052145ed0fb508b6ff364a7a1e3ca000000000000000000000000]
KERNEL_FMT      [raw]
RAMDISK_FMT     [gzip]
EXTRA_FMT       [dtb]
- Checking ramdisk status
Loading cpio: [ramdisk.cpio]
- Stock boot image detected
I:Set overlay: ''
- Patching ramdisk
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[false] KEEPFORCEENCRYPT=[false]
Found fstab file [fstab.tn8]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
Loading dtbs from [extra]
- Repacking boot image
Parsing boot image: [/dev/block/platform/sdhci-tegra.3/by-name/LNX]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1154429]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [3f4f350142e052145ed0fb508b6ff364a7a1e3ca000000000000000000000000]
KERNEL_FMT      [raw]
RAMDISK_FMT     [gzip]
EXTRA_FMT       [dtb]
Repack to boot image: [new-boot.img]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1642754]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [3ac1f5381a7243e87308ce85c4ebc8758f351b2c000000000000000000000000]
- Flashing new boot image
Cleaning up...
- Unmounting partitions
- Done
I:Updater process ended with RC=0

if I manually install magisk zip, it also patch boot image, but it work after reboot:

 Magisk 22.0 Installer
***********************
- Mounting /system
- Target image: /dev/block/platform/sdhci-tegra.3/by-name/LNX
- Device platform: arm
- Constructing environment
- Adding addon.d survival script
Invalid image: not signed
- Unpacking boot image
Parsing boot image: [/dev/block/platform/sdhci-tegra.3/by-name/LNX]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1642753]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [0ce18b7616d5079438c572b2ce86de3a486465c2000000000000000000000000]
KERNEL_FMT      [raw]
RAMDISK_FMT     [gzip]
EXTRA_FMT       [dtb]
- Checking ramdisk status
Loading cpio: [ramdisk.cpio]
- Magisk patched boot image detected
Loading cpio: [ramdisk.cpio]
Remove [overlay.d]
Remove [overlay.d/sbin]
Remove [overlay.d/sbin/magisk32.xz]
Remove [overlay.d/sbin/magisk64.xz]
Remove [.backup/.rmlist]
Remove [.backup]
Remove [.backup/.magisk]
Move [.backup/init] -> [init]
Dump cpio: [ramdisk.cpio]
- Patching ramdisk
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Patch with flag KEEPVERITY=[false] KEEPFORCEENCRYPT=[false]
Found fstab file [fstab.tn8]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
Loading dtbs from [extra]
- Repacking boot image
Parsing boot image: [/dev/block/platform/sdhci-tegra.3/by-name/LNX]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1642753]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [0ce18b7616d5079438c572b2ce86de3a486465c2000000000000000000000000]
KERNEL_FMT      [raw]
RAMDISK_FMT     [gzip]
EXTRA_FMT       [dtb]
Repack to boot image: [new-boot.img]
HEADER_VER      [0]
KERNEL_SZ       [6238120]
RAMDISK_SZ      [1544278]
SECOND_SZ       [0]
EXTRA_SZ        [144835]
OS_VERSION      [8.1.0]
OS_PATCH_LEVEL  [2021-02]
PAGESIZE        [2048]
NAME            []
CMDLINE         [vpr_resize androidboot.selinux=permissive buildvariant=userdebug]
CHECKSUM        [d5c9d02ee52c89b89d0a6284252ff5d039a04598000000000000000000000000]
- Flashing new boot image
Cleaning up...
- Unmounting partitions
- Done
I:Updater process ended with RC=0

@twu2
Copy link
Author

twu2 commented Feb 24, 2021

I test in another device (arm64), it work fine without this issue.
The device has this issue is an arm tablet (android O).

@Tomoms
Copy link

Tomoms commented Mar 15, 2021

I can confirm this issue on an arm device running unofficial LineageOS 18.1. Magisk v22, flashed as a zip via latest TWRP, does not survive across ROM updates, although the addon.d survival script seems to be executed correctly. This started happening since Magisk v22, v21.4 survived as expected.

@Iey4iej3
Copy link

Maybe it is a duplicate of #1500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants