This is a LineageOS Recovery compiled from the source tree of LineageOS 17.1 for Redmi K30 5G. This is part of my ongoing work to port LineageOS 17.1 to this device.
I am aware that there is a TWRP port for this device, but since the source code is not accessible (as for as I can tell, maybe I just did not look hard enough for the source code), I can only advice against using it. The official TWRP open-sourced under GPLv3 does not even support devices launched with Android 10 yet, so there's clearly something going on here. I do not fix compatibility issues between my ROM and that TWRP port.
Instructions (Installing Recovery)
1. Download vbmeta.img, recovery-XXXX.zip (extract to get recovery.img)
2. Reboot to bootloader (`adb reboot bootloader`)
3. Run `fastboot --disable-verification --disable-verity flash vbmeta vbmeta.img`
4. Run `fastboot flash recovery recovery.img`
5. Run `fastboot reboot recovery` to enter LineageOS Recovery
Instructions (Installing Magisk)
You have to use the patched Magisk. Installing a normal Magisk will make the system unbootable.
1. Download patched Magisk zip (Magisk-xxx-patched.zip), put onto computer
2. Reboot to LineageOS recovery, select `Mount /system` (you may see some errors, but they can be safely ignored)
3. Select `Apply update from ADB`
4. Run `adb sideload Magisk-xxx-patched.zip`
5. You will see a signature verification error, select `Yes` to bypass the check
6. Reboot to system to enjoy your Magisk installation.
1. Since it's not TWRP, you cannot decrypt your /data in recovery for now, which means no data backup or recovery, and you cannot install on-device flashable zips through this recovery.
2. Since it's not TWRP, it cannot prevent your OS from overwriting recovery automatically. If you use official ROM, you may need to manually re-flash the recovery every time. I'm not sure whether this can be bypassed with some Magisk module.
3. Don't expect to be able to flash anything into /system (e.g. OpenGAPPS) on stock ROMs; you might be able to do so once my LineageOS ROM is released
5. You need to always click "Mount /system" before flashing any mods into the system (i.e. Magisk, OpenGapps, etc., ROMs themselves are not affected), otherwise they will fail to install. (Clicking the option does not actually mount /system; it just sets up necessary mappings from the super partition to each of the dynamic partitions so that the installation scripts will work)
LineageOS Recovery (17.1, 2020-03-06): https://mega.nz/#!PZRCBaiA!L-c3Tn6E2...3QJRt04uyQGg_k
Changelog: Improved compatibility with OpenGAPPS (won't work with MIUI; this change is solely for the soon-to-be-released LineageOS 17.1 port)
Patched Magisk (v20.3, 2020-03-01): https://mega.nz/#!XUxHTRpY!crbBJn-Qq...YKlRA2ESQiSJvY
Device Tree (including LineageOS 17.1 port): https://github.com/PeterCxy/android_...xiaomi_picasso