@zgfg you definitely did something wrong (or Magisk messed up your magisk_patched.img). Nothing in your ramdisk but my folder and a folder called "backup" and an init file. Why don't you upload your magisk_patch.img and let me try.
Last edited:
Yes, before flagging ramdisk only had backup folder and init file - I added your overlay.d per instructions.@zgfg you definitely did something wrong. Nothing in your ramdisk but my folder and a folder called "backup" and an init file. Why don't you upload your magisk_patch.img and let me try.
Something wrong with your magisk_patched.img. Install a stable version of magisk and try again.Yes, before flagging ramdisk only had backup folder and init file - I added your overlay.d per instructions.
But patching with works perfect - just overlay.d is ignored and there is no Core Only mode - I just left it on the phone and continue ed to use (Android, Magisk and everything fully functioning)
Link to my boot image as it was patched by Magisk Canary 20407:
https://mega.nz/file/YhsREBYR#nL0VCgyed1bCs9cXYVLi0HdRh3TRi8lI5UJ2z98sON4
Link also to my stock boot image as originally extracted from the full OTA package (I didn't try to unpack yet by AIK to check its ramdisk content):
https://mega.nz/file/pociRQSS#3juycICtl6EwzWhT6NVE8WFBI37a0QZXvx0xIM_mpsA
Btw, as I edited my previous post, the same your method (so the same my PC environment and steps) works excellent on Huawei P9, stock Oreo - however, its ramdisk folder (unpacked image) is full of stuff
Thank you for your prompt help and interest
This is not "my" boot.img (second link in my previous post) but Xiaomi's stock boot imageSomething wrong with your magisk_patched.img. Install a stable version of magisk and try again.
Edit: no, it's your boot.img. there is nothing in your ramdisk.
Following up, I just unpacked (and later successfully repacked) stock recovery.img from the same Xiaomi Mi 9T and obtained the full ramdisk folder here:This is not "my" boot.img (second link in my previous post) but Xiaomi's stock boot image
You could patch it yourself by Magisk Manager, you will get the same as was my patched image (first link)
Or you could download the whole official firmware (Mi 9T, QFJEUXM 11.0.5 EEA Stable) and unzip to extract the original boot.img:
https://mirom.ezbox.idv.tw/en/phone/davinci/
I don't see a wrongdoing from my side ?
Thank you for your thoughts anyway
EDIT: Could you please suggest what else to add (if misssing from the stock and hance also patched and flagged ramdisk unpacked folders), to make it properly execute the shell script in overlay.d)
A person can boot TWRP so try putting the overlay.d folder in your stock recovery image and boot that.Following up, I just unpacked (and later successfully repacked) stock recovery.img from the same Xiaomi Mi 9T and obtained the full ramdisk folder here:
https://mega.nz/file/sp83WCTR#46xihtEltppMoj2CLm2nYOjvoNMW35-5ZcFr83cD4PY
Maybe the expected stuff "missing" from ramdisk folder in boot.img is here (screenshot)?!
But stock recovery can be replaced by TWRP (or Orange Fox), and MIUI still boots and works just fine then, hence it doesn't miss all this stuff that is in ramdisk folder in the stock recovery image
If using TWRP, then TWRP is in recovery partition, no more stock recovery - so I don't see how TWRP can inject overlay.d to the stock recovery imageA person can boot TWRP so try putting the overlay.d folder in your stock recovery image and boot that.
Sorry, did you think I should unpack stock boot.img, put overlay.d there to the ramdisk folder, repack and flash - but then it will not boot to Magisk (?)A person can boot TWRP so try putting the overlay.d folder in your stock recovery image and boot that.
If you have TWRP, there is no need for this at all. In TWRP file manager you delete the bad module and reboot.If using TWRP, then TWRP is in recovery partition, no more stock recovery - so I don't see how TWRP can inject overlay.d to the stock recovery image
Ofc, I can manipulate /data/adb/ from TWRP and I know how.If you have TWRP, there is no need for this at all. In TWRP file manager you delete the bad module and reboot.
I would think you would still be able to "boot" a modded stock recovery image. This would possibly install the .disable_magisk file and you would just restart your phone after booting it.
Edit: tried on a Nexus 5X and it didn't work...
Thanks, interesting.TWRP is run from memory, so on A/B devices with boot-as-recovery (TWRP in the boot partition) you can of course dump the partition and modify to add /overlay.d to the ramdisk and it'll be there next boot. AK3 could be used to do this on-the-fly. :good:
Go to the linked folder in the op and use that one....Hi all, I'm trying to build magisk core patched img but I cannot do it because maybe I'm not extracting properly boot.img
Is there anyone that can do the build for me? In case I will share patched_boot.img
Attempted something even easier with no success. Further info at https://github.com/topjohnwu/Magisk/issues/2978If anyone wants to experiment with this idea, here's the basic setup I used for my boot.img to fully reset the /data/adb directory for the soft brick issue (related to a magisk.db failure) I was seeing in the last canary.
Unpack the current magisk_patched.img for your device using my Android Image Kitchen (AIK) project, then create:
ramdisk/overlay.d/init.resetmagisk.rc:
ramdisk/overlay.d/sbin/init.resetmagisk.sh:Code:on post-fs-data exec u:r:magisk:s0 root root -- /sbin/init.resetmagisk.sh
So, pretty simple stuff, and I'm sure it could be applied to some sort of Core Only workaround until @topjohnwu decides what he wants to do with all those Core Only boot.img Pull Requests.Code:#!/system/bin/sh rm -rf /data/adb/* && reboot![]()
Flash your magisk_patched.img. in a command window, before it boots into fastboot, run this:So I am in the situation of
1. not having TWRP, not being able to boot into it.
2. and having lost root probably because of some faulty magisk module.
3. My device is booting into fastboot since a crash, probably caused by faulty module.
I recovered the stock boot image via fastboot. I can boot my device. Without root privileges.
I tried to patch the stock boot image with magisk Manager.
I flashed the magisk_patched.img via fastboot. Result: Again the device boots into fastboot mode and not into os.
I unpacked and repacked the magisk_patched.img as you describe here. To no avail. As soon as I flash the patched boot image, the device boots into fastboot instead of os.
OP7P GM1913, Android 10 OOS 10.0.9
This is really frustrating and I am stuck. Do you have any Ideas?
This does not work. The phone goes into fastboot mode after a while.Flash your magisk_patched.img. in a command window, before it boots into fastboot, run this:
adb wait-for-device shell magisk --remove-modules
This also fails.If that doesn't work, this works for some:
1. adb reboot bootloader
2. fastboot flash boot magisk_patched.img
3. Powered off phone completely
4. Powered on phone and as soon as I saw the G logo pressed and held Volume Down until it boots into Safe Mode
5. Phone eventually booted into Safe Mode as noted by lower left of your screen. You aren't able to access anything magisk related in here but we did just disable magisk modules for the next normal boot!
6. Reboot
Selfreply as I found a solution. Maybe useful to others.This does not work. The phone goes into fastboot mode after a while.
This also fails.
Yet, I managed to boot into a working version of TWRP. I deleted some magisk modules that I installed prior to the error.
It did not help. Still landing into fastboot.