topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.94k stars 12.17k forks source link

Magisk 20.4 fails to boot after update to Android 10 (same with 20.3, 19.4, 19.1) #2695

Closed SoftwareSchlosser closed 4 years ago

SoftwareSchlosser commented 4 years ago

I have a similar issue as seen in #2049 with my Xiaomi Mi A2 (non-lite) which had stock Pie with Magisk 19.x (can't remember) running. I wanted to apply the latest OTA update to Android 10 (security update from March 1st). After uninstalling Magisk and applying the OTA, the phone boots the stock bootloader as expected. Now I fastbooted into TWRP and extracted and copied both boot images. I'm on slot b - so back in Android I patched the corresponding boot image via Magisk Manager and tried to fastboot it. The colored line starts to move which means the boot process itself works but it runs like that forever. I also tried to fastboot the extracted unpatched image which also works so there must be something wrong with the patched image.

stock boot image patched boot image

Do you have any ideas on that?

Originally posted by @SoftwareSchlosser in https://github.com/topjohnwu/Magisk/issues/2049#issuecomment-614779955

It seems like TWRP can't handle the encryption anymore on Android 10. Maybe that is related?

SoftwareSchlosser commented 4 years ago

I had the same issue it is solved now, i tried all the version 13, 15, 17, 19 ,20.4 and canary but the issue was solved when I used the version 20.0 of magisk.

If your phone is not booting after magisk flash or it is in bootloop, the only solution that I have found is that magisk 20.0 version works fine. Hope you find this helpful.

I tried that version and even downgraded Magisk Manager to the version shown on your screenshot but it doesn't even display any boot- / splash logo. Just a black screen after the fastboot boot ... command. Also cleared the cache partitions in TWRP but that didn't help too. I can boot the unpatched boot image so there must be something wrong with the patched file.

SoftwareSchlosser commented 4 years ago

Hello again, this is the last line from my failing boot log: mdss_fb_do_ioctl: unsupported ioctl (5401) Does this help?

nazar-pc commented 4 years ago

Initially reported by another user here (and I left a few comments): https://gitlab.com/LineageOS/issues/android/-/issues/2300

Essentially as soon as Magisk is installed on OnePlus 7 Pro on either stock OxygenOS or LineageOS 17.1 it either causes bootloop (most of the time was fixed by "Fix Recovery Bootloop" in TWRP for some reason) and WiFi/voice calls not working (LTE data still works). I had 20.4 running just fine until last update though. It happens in such a way that uninstallation or re-flashing OS doesn't help, only complete reflashing of a bunch of partitions to completely stock phone state.

There have been no comments here for a while, is this fixed in nightly builds?

osm0sis commented 4 years ago

I always run Magisk Canary and Lineage 17.1 with TWRP 3.4.0 installed on my OP7Pro without issue.

nazar-pc commented 4 years ago

Probably a stupid question, but readme mentions "Canary Magisk Manager", where can I get it?

osm0sis commented 4 years ago

Tap the download count badge for the Canary Manager, it'll grab everything else for you

nazar-pc commented 4 years ago

Update to Canary didn't fix WiFi. There was sonething in /data left by Magisk 20.4 that was destroying WiFi on all slots right after first boot with /data restored from backup.

With everything wiped once again, fresh LineageOS 2020-08-09 installed on top + opengapps + Canary Magisk I can finally both have Magisk and working WiFi again. Yay!

Please release new stable version then, 20.4 clearly breaks Android 10 devices and Canary (in my case at least) does not.

osm0sis commented 4 years ago

Magisk doesn't touch anything except boot.img and put its own stuff in /data/adb (and /system/addon.d on custom ROMs). Any lasting effect basically can't logically be Magisk's fault.

But anyway, obviously another stable will happen, now stop polluting this thread.

j4w3ny commented 4 years ago

I have a similar issue with my Xiaomi Redmi 9. I have tried Magisk 20.4, 18.4, 19.4, 20.1 but unfortunately all failed.

I firstly using Magisk 20.4 to root my device, but after flashing patched boot img, it turned into bootloop, so i have to flash back to stock boot image.Then i try other version again and again

This is the image and log: Log Patched Boot Image

BTW ,I cannot install TWRP in my phone because it did't support.

Add from #3099

osm0sis commented 4 years ago

Might be worth trying latest Canary again, SAR detection and init logic was rewritten. 👍

fgl27 commented 4 years ago

The device work well on android 9 and older, but after android 10 it never worked.

Using latest version from release Magisk v20.4 the magisk manager doesn't recognizes magisk su device boot OK.

Using latest version 20418 the device doesn't finises the boot process.

It also looses adb root, so logcat is limited, I took some logs from 20418 logcat.txt

Can't run dmesg because no SU, but via TWRP I can cat /sys/fs/pstore/console-ramoops AKA dmesg console-ramoops.txt

There is some odd Unmounting spamming on dmesg of data and cache, that doesn't happen on normal boot.

Anyone has some experience with this issue?

I fix my problem...

Regarding the release version 20.4 (20400), it doesn't work because it can't patch the dtb this devices was using a separated zImage and dtb , to fix this issue I add the kernel defconfig flags

CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES=""

Removed on dt BoardConfig.mk

BOARD_KERNEL_SEPARATED_DT := true

Technically the canary version 20420 and up doesn't have this issue regarding the dtb (I assume the dtb issue was fixed on a version prior to 20420 that was the one I tested after 20400), but it will not boot the device just stay on the bootanimation screen for ever...

So to fix that issue I changed the data partition to latemount in the fstab file

https://github.com/fgl27/device_motorola_quark/commit/bec4069d85543b261e558a4200c60d91c62521b1

I did other things on the above, but what is need there is to add latemount to the data partition in fstab and change the mount process of fstab


on fs
    mount_all /vendor/etc/fstab.qcom --early

on late-fs
    mount_all /vendor/etc/fstab.qcom --late

So for some reason that I don't know magisk need a "delay" at init, as it is inside the data partition late mouting it resolves the issue for this device, but I do believed that with this information some improves on magisk can be made to address the problem.

regarding 20423, it doesn't work, the last that work for me is 20422... using 20423 the device boot but magisk manager just freezes and no app can request SU. I know that is a wipe version for Android 11 but extra info always help...

But no canary version is needed as with this changes that I made release version 20400 just work, as long you don't use separated dtb and zImage and late mount the data partition.

In doubt about my process let me know.

osm0sis commented 4 years ago

Try 20424, there was an selinux issue

j4w3ny commented 4 years ago

Might be worth trying latest Canary again, SAR detection and init logic was rewritten. 👍

Thanks, Try It later.

UltraBlackLinux commented 4 years ago

Canary Fixed nothing for me, sadly. @topjohnwu