[Android Software Development] zgfg:
Im also thinking about trying KSU but it's my daily driver for work and private use, I must ensure not to break the two conditions/requirements:

1) To keep all my apps, their settings and data.

IMHO, unless it happens something really awry, it shall not occur

2) I want to keep for now my painstakingly configured Magisk with a number of Magisk and LSPosed modules.

Hence I don't want to uninstall Magisk but to play with KSU on my original boot.img (not patched by Magisk) that if I need, I could flash back the boot.img patched by Magisk and continue using the Magisk as before

Or, if I decide to keep KSU, that I would later simply delete (with root privileges) Magisk stuff from /data/adb (and few other folders)

Sorry, I started to read/learn about KSU yesterday evening, hence my understanding is still limited...

I have Xiaomi Mi 11 Lite 5G NE, aka Lisa, with Xiaomi.eu (custom) ROM, MIUI 14 (hence not AOSP), Android 13

My kernel is v5.4.210 and " unsupported" according to KSU org (v5.10 is required) - screenshot.

However, I see that @swer45 had installed KSU to his Poco X3 Pro (also with Xiaomi.eu), and having an even older kernel - like you on Alioth

By following the KSU links for "unsupported" devices I've found KSU on GitHub for Lisa, based on Kernel v5.4.226.

If I correctly understand the story about KMI versions, it is important and enough that first two numbers match (as they do, v5.4), hence should it be ok?

However, it also says that it's the KSU for Lisa for AOSP, but I have MIUI?!

It's flashable ZIP (yeah, I have TWRP working excellent with MIUI 14 and A 13) and its generic anykernel.sh script (btw, signed by @osm0sis) does some checking, hence it might protect me from flashing the wrong kernel (or block me to install in case of false-positive checking)

But the zip also intends to flash DTB and DTBO. Ok, I can backup my current ones by TWRP but I still worry about breaking the condition no 1 (?)

I see three ways to install KSU:

a) To flash that KSU zip from TWRP. I would first flash my original boot.img (not patched by Magisk) and let it install KernelSU there.

The easiest way, and in-line with the requirement no (2).

However, IM concerned about that DTB/DTBO here

b) To extract kernel img from that KSU zip for my Lisa and to inject it (by use of eg Android Image Kitchen on the PC or magiskboot unpack/repack tools on the phone) into my boot.img file (again, the original Xiaomi.eu one, not patched by Magisk)

Then to test it by fastboot boot <boot-KSU.img> and flash permanently if it boots ok.

More work, more chances to make something wrong (causing KSU not to boot ot work) but seems to be the safest way to try (regarding the two requirements on the top)

c) I have Ex Kernel and SmartPack Kernel Managers, hence I could flash that KSU zip for Lisa from them - with the DTB/DTBO, or (IMHO) to flash just the extracted KernelSU img - without DTB/DTBO

That's also plain easy but it requires to boot with Magis and to flash KernelSU into the Boot already patched by Magisk to the Ramdisk.

In that case IM not sure how to fully disable Magisk to play with KSU only, and how to later safely remove Magisk from that boot.img with KernelSU installed?

---

Btw, there is one more complication, Lisa does not have separated Recovery but the TWRP is also installed to my Boot partition/image (currently together with Magisk in Ramdisk and/or KernelSU in future)

Also, since Xiaomi.eu (as a custom ROM) cannot use stock Recovery for OTA, Xiaomi.eu already installs and updates by use of TWRP in their official boot.img (again, Lisa has no separated Recovery).

So far it worked seamlessly with Magisk

Eg, when I update Magisk, I just patch or install/update (Direct method) and it does not affect TWRP residing in the same Boot partition / boot.img

And when I update Xiaomi.eu, I first let it's Updater to download Xiaomi.eu OTA ROM zip, I manually extract the boot.img and patch it (still on the pre-OTA Xiaomi.eu System with the running Magisk), then I let Xiaomi.eu Updater to reboot to TWRP and to complete the OTA update (incl. it's automatic rebooting to System to configure the update)

Finally I manually reboot to TWRP (as said, TWRP is integrated into the Xiaomi.eu ROM, and btw even without root I don't bother with Vol+ or even Pow button since Xiaomi.eu has a 'hidden' button to let it directly reboot to the Recovery/TWRP) and I flash the corresponding new boot.img that I had previously extracted and patched by Magisk before finishing the Xiaomi.eu OTA update

Hence, in both cases (updating Magisk or updating Xiaomi.eu) I can do everything in just few minutes on my phone (many times I do it even on the go), without PC, adb, fastboot, some Flasher applications or whatever except Internet and the phone itself

Not sure how would that work with KSU - eg. option (b) means a manual cooking for every Xiaomi.eu or KSU update, and I'm concerned about DTB/DTBO stuff for the option (a)

Option (c) is out-of-scope for updating Xiaomi.eu since I would have to already have the OTA updated Boot installed to let Ex or SmartPack Kernel Managers to flash KernelSU into the updated Boot - but once the ROM was already updated, it means that it had rebooted to System without root and therefore Kernel managers would not have privileges to flash