How to flash Magisk into NVMe Android?

Followed https://github.com/radxa/manifests/releases/tag/Rock-android12-20221104 to install the NVMe Android in my ROCK 5B, and can run pretty well with both my 1TB and 512GB card.

Though I am lost for whether it’s possible to flash root into the image. I know for eMMC and SD image, I can unpack the update.img file with Magisk patch and pack it again. How can I do the similar stuff with the NVMe image?

Finally figured myself…
After flashing with NVMe and boot successfully once into Android, I can use a NVMe to USB adapter in Linux with dd command to import and export the image.

Another way you can do this: connect to a host device with USB-C, treat it like a phone or the like.

The images are rooted for use over an ADB shell as it is, and support “adb root”, so, from a host machine:

adb root
adb shell dd if=/dev/block/by-name/boot of=/sdcard/boot.img
[magisk patch boot.img]
adb shell dd if=[patched_boot.img] of=/dev/block/by-name/boot

This, of course, assumes your host is capable of providing enough power over USB-C to run the board.

Hey Thanks…, you saved me from alot of googling… any idea on how to disable the serial console in Android?