Closed NevCu closed 1 year ago
Invalid bug report, automatically closed. Please report issues using the latest debug Magisk build (version code: 26301).
Nb. You need to follow the template / rules for issues to avoid bot closing...
However I think that this regression (already fixed upstream) has caused your issue: App loses Recovery mode user setting for A-only legacy SAR devices
This regression means that current Magisk is selecting Recovery Mode each time you open the app even if you have de-selected it... You need to ensure you uncheck the box every time you open the app, perform an install or patch function or use Magisk reboot option ATM...
Since installation from custom recovery now only gives partial root, App asks you to re-install to set up selinux/module rules directory which now needs booted system to occur... If you took Direct Install without unchecking the Recovery Mode box, Magiskinit will have been patched to /recovery ramdisk (which is needed for A-only L-SAR devices that don't accept Magisk in /boot ramdisk, ie most Ramdisk=No devices other than Xiaomi)... So you now have both patched /boot and patched /recovery partitions.
Simply flashing /recovery (TWRP) using fastboot from PC should fix booting (and restore booting to TWRP) I think... After that, open Magisk App, go to Install, uncheck the Recovery Mode box and take Direct Install again to ensure selinux rules directory is properly set up again even if app didn't prompt you to do this. Also, go to Install and ensure Recovery Mode box is still unchecked before rebooting...
If this isn't enough to fix booting, flash unpatched boot.img (from LOS archive) as well as recovery.img to fix, then flash Magisk from TWRP again and go through the same (remaining) steps above...
If that fails you may have a TWRP issue... In this case restore both unpatched recovery.img and boot.img and use the recommended in-app patch and flash via fastboot method... You could also flash patched boot.img via TWRP. (Remember to pay attention to Recovery Mode setting as mentioned as user setting will be lost often until next Magisk release... Failing to do this will result in patching recovery again on our unusual A-only L-SAR devices regardless of installation method.)
Nb. I've never used the depreciated custom recovery installation method on my Redmi Note 8T.
Hope this helps you...
Thanks a lot for the explanation!
As a final desperate measure, I re-flashed TWRP using ADB Fastboot, and this indeed got me back in. Strangely enough, after having rebooted into system, the device was rooted. But the app still said it 'requires additional setup‘. So, I did it, but this time (like you said) unchecked the Recovery Mode box, and the device booted just fine.
In the app, it still says 'Ramdisk No', but I read here that apparently 'since Android is such a fractured ecosystem, detection of the ramdisk might not always be accurate (Xiaomi).'
Computer stuff can be tough, but mobile phone stuff takes the cake...
Thanks again!
Thanks a lot for the explanation!
Welcome...
As a final desperate measure, I re-flashed TWRP using ADB Fastboot, and this indeed got me back in. Strangely enough, after having rebooted into system, the device was rooted.
Yup, as I said patched /recovery was your issue and Magisk was already patched to /boot earlier...
But the app still said it 'requires additional setup‘. So, I did it, but this time (like you said) unchecked the Recovery Mode box, and the device booted just fine.
Yup... Because of installation from TWRP, Magisk still hadn't set up selinux/rules directory properly which is done with booted system since refactoring to avoid randomseed use (made Magisk compatible with more devices)... (Well, patching /recovery did set the directory in /recovery ramdisk CPIO, but that never booted which is when configuration files in /data/adb are set up...)
In the app, it still says 'Ramdisk No', but I read here that apparently 'since Android is such a fractured ecosystem, detection of the ramdisk might not always be accurate (Xiaomi).'
Nah, it's accurate apart from the recent detection regression (fixed in the Magisk you're using... I mentioned it in the issue I linked also; the still extant user setting retention issue was part of the same regression but was overlooked in the recent fix for that...
It may not be well documented but Ramdisk=No really means the OEM supplied no ramdisk in /boot partition... This means that bootloader logically can be assumed not to support ramdisk in /boot, but Xiaomi bootloaders (and a few others) inexplicably do. The fact that a few OEMs include unused bootloader support (maybe they just lazily reconfigured code from earlier devices) means that Magiskinit can be supported in Boot mode simply by manually adding a basic generic ramdisk to /boot... So since this commit: https://github.com/topjohnwu/Magisk/commit/e72c6685edf81706617a3444575c4500b9b8fe6c Magisk has 'manually' added such a ramdisk whenever it's missing... Just in case it can work!
Also, despite the fact that there is now in fact ramdisk in /boot, Magisk changing the indication to Ramdisk=yes would mean nothing. Doing that would be wrong because once Magisk-patched, basic ramdisk in initramfs will always exist but cannot be expected to be compatible with bootloader...
OEM ramdisk=No (to indicate probable bootloader incompatibility with ramdisk in boot) remains a valuable indicator of expected behaviour... Compatibility can only be determined by trying to boot such a patched image there being no way for Magisk to poll bootloader... And Xiaomi is an exception to what should logically occur... Thankfully...
See this comment/doc:
Some Type III devices’ bootloader will still accept and provide initramfs that was manually added to the boot image to the kernel (e.g. some Xiaomi phones), but many device don’t (e.g. Samsung S10, Note 10). It solely depends on how the OEM implements its bootloader.
https://topjohnwu.github.io/Magisk/boot.html#piecing-things-together
Computer stuff can be tough, but mobile phone stuff takes the cake...
I think John takes the cake for getting his head around Google's ever changing booting architecture and Shenanigans... See his doc above.
Was Stuck on this for a whole day, couldn't figure out what I was doing wrong, this thread saved the day. Thanks @pndwal @NevCu
Open Magisk App, go to Install, uncheck the Recovery Mode box and take Direct Install again to ensure selinux rules directory is properly set up again even if app didn't prompt you to do this. Also, go to Install and ensure Recovery Mode box is still unchecked before rebooting...
I didn't realize that the "Recovery Mode" menu in additional setup doesn't have to be checked to be able to proceed to the next step, I really appreciate this, thanks man @pndwal
@NevCu @pndwal
Could you explain how you re-flashed TWRP using adb fastboot? I am stuck in a boot loop and I cannot get into recovery or bootloader/download mode on my Samsung note 10. When I type adb devices or adb fastboot I get an empty list or the error message no emulators found. Any advice will help!
@BilalBismillah
It's been a while since I troubleshot this one, so I've forgotten the details. But I did create a text file at the time with all the steps, so maybe this will help you (even if for Xiaomi Redmi Note 8):
Install TWRP: connect phone to pc, press volume- and power for Fastmode, download the correct TWRP image file and copy the file into the same folder as your platform-tools (Minimal ADB and Fastboot). Rename the image to twrp.img and type:
fastboot flash recovery twrp.img
fastboot reboot
Note: many devices will replace your custom recovery automatically during first boot. To prevent this, use Google to find the proper key combo to enter recovery (volume up + power, release power button when Redmi shows up). After typing fastboot reboot, hold the key combo and boot to TWRP. Once TWRP is booted, TWRP will patch the stock ROM to prevent the stock ROM from replacing TWRP. If you don't follow this step, you will have to repeat the install.
Device: Redmi Note 8 Android version: 11 Magisk version name: v26.3 Magisk version code:
I tried to root my device after installing the latest LineageOS 18.1 for my mobile phone. I downloaded the APK, changed the extension into ZIP, and then flashed it with TWRP. After rebooting the Magisk app said that additional stuff needed to be downloaded. I did that, rebooted, and since then it has been stuck in the LineageOS boot logo.
I can't seem to do anything to get it out of the loop. I can't get to TWRP recovery or safe mode, and in fastboot/ADB there is no list after 'adb devices' (despite USB debugging being enabled). I can't even turn off the phone. I'm at a loss, but hopefully not a total loss.
I've Googled all I could. Is there someone who knows how to get back again?
Sorry for being a total noob.