So I tried to make Core Only image for my Xiaomi Mi 9T, MIUI 11, Android 10, based on my Canary 20407 patched image - but it didn't work (see below)
---
Followed the guide from OP posts (various Pixel guides):
https://forum.xda-developers.com/showpost.php?p=80408781&postcount=1
https://forum.xda-developers.com/showpost.php?p=80408801&postcount=1
https://forum.xda-developers.com/showpost.php?p=80657663&postcount=1
and used Android Image Kitchen for Windows from (thank you for pointing directly to):
https://forum.xda-developers.com/showpost.php?p=36067074&postcount=1
It's not really complicated, took me first time 15 minutes, and just few minutes for subsequent tests (incl. flashing and rebooting)
So thank you and to
@osm0sis for this nice method(s)
First of all, I don't have a bootloop when booting to Magisk, there is TWRP for my device (supporting the encrypted /data) and
adb shell Magisk -V
works correctly hence I could always fix a Magisk bootloop through TWRP or by adb if needed
---
Unpackimg magisk_patched.img - success.
I copied overlay.d from overlay.dcoreonly1.zip to ramdisk.
Repackimg - success.
Flashed image-new.img but it still booted to Magisk with all modules
Indeed, I checked in /cache but didn't find .disable_magisk file.
To test, I copied that empty .disable_magisk manually to /cache, rebooted and Magisk Manager properly showed the Core Only mode
I also tested with AIK:
Cleanup
Unpacking image_new.img
and it was properly unpacked, containing the overlay.d in ramdisk
I played more with init.resetmagisk.sh script in sbin/overlay.d, by testing to similarly put empty disable file to /data/adb/modules/adb-ndk but it did not help to disable my ADB & Fastboot NDK module
Finally, by modifying overlay.d from overlay.dremove1.zip I tried to remove /data/adb/modules/adb-ndk, but again it did not remove that module
Not sure if I did something wrong, or something changed with Magisk Canary 20407 or could it be (I don't believe) related to the fact that my Magisk Manager is hidden...
One of my image_new.img test images:
https://mega.nz/file/B98HiBxB#3uu-cZWDcBzbG-e2SXcKZHTZ7pr8T3FtB9r-1QctnSU
EDIT:
Now I did the same for my patched ramdisk image for Huawei P9, EMUI 8, Android 8 - and here, P9 properly reboots to the Core Only mode.
Also based on Canary 20407
I made all the same, except unpacking/repacking image for different device
Hence it may depend on device (or Android version - but I think you also use Q on Pixels and it works for you)