[Redmi K20 Pro / Xiaomi Mi 9T Pro ROMs, Kernels, Re] AndyYan:
OP, can you provide some documentation on what you had to apply on top of vanilla LOS to get it building/working, like you did for 16.0?

The first things I thought of are these patches you mentioned back when you released your 16.0 trees, and indeed these still seem necessary.

With those patches in place, it built fine, but got stuck in a bootloop:

E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
E AndroidRuntime: java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions whitelist: {com.android.systemui: android.permission.MANAGE_DEBUGGING, com.android.systemui: android.permission.CONTROL_VPN, com.android.systemui: android.permission.START_TASKS_FROM_RECENTS, com.android.systemui: android.permission.STATUS_BAR, com.android.systemui: android.permission.GET_APP_OPS_STATS, com.android.systemui: android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS, com.android.systemui: android.permission.MOUNT_UNMOUNT_FILESYSTEMS, com.android.systemui: android.permission.USE_RESERVED_DISK, com.android.systemui: android.permission.CONNECTIVITY_INTERNAL, com.android.systemui: android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, com.android.systemui: android.permission.WRITE_MEDIA_STORAGE, com.android.systemui: android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS, com.android.systemui: android.permission.READ_DREAM_STATE, com.android.systemui: android.permission.CHANGE_COMPONENT_ENABLED_STATE, com.android.systemui: android.permission.MODIFY_PHONE_STATE, com.android.systemui: android.permission.CHANGE_OVERLAY_PACKAGES, com.android.systemui: android.permission.MEDIA_CONTENT_CONTROL, com.android.systemui: android.permission.STOP_APP_SWITCHES, com.android.systemui: android.permission.TETHER_PRIVILEGED, com.android.systemui: android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS, com.android.systemui: android.permission.MASTER_CLEAR, com.android.systemui: android.permission.BLUETOOTH_PRIVILEGED, com.android.systemui: android.permission.RECEIVE_MEDIA_RESOURCE_USAGE, com.android.systemui: android.permission.BATTERY_STATS, com.android.systemui: android.permission.MANAGE_USB, com.android.systemui: android.permission.REAL_GET_TASKS, com.android.systemui: android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST, com.android.systemui: android.permission.WATCH_APPOPS, com.android.systemui: android.permission.WRITE_DREAM_STATE, com.android.systemui: android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME, com.android.systemui: android.permission.OVERRIDE_WIFI_CONFIG, com.android.systemui: android.permission.WRITE_SECURE_SETTINGS, com.android.systemui: android.permission.MANAGE_USERS, com.android.systemui: android.permission.READ_PRIVILEGED_PHONE_STATE, com.android.systemui: android.permission.READ_NETWORK_USAGE_HISTORY, com.android.systemui: android.permission.START_ACTIVITIES_FROM_BACKGROUND, com.android.systemui: android.permission.MODIFY_DAY_NIGHT_MODE, com.android.systemui: android.permission.DUMP, com.android.systemui: android.permission.UPDATE_APP_OPS_STATS, com.android.systemui: android.permission.INTERACT_ACROSS_USERS}

Turns out /vendor/build.prop from MIUI enforces priv-app permissions whitelist, and causes many related crashes, so disabling that enforcement got it to finish booting.

But why are crucial packages/permissions failing the permissions whitelist in the first place? I've never seen this happen on any other devices I've built for.

After booting I was greeted by a black screen. LiveDisplay HAL didn't start:

I lineage.livedisplay@2.0-service-sdm: LiveDisplay HAL service is starting.
E lineage.livedisplay@2.0-service-sdm: Can not get libsdm-disp-apis.so (dlopen failed: library "libsdm-disp-apis.so" not found)
E lineage.livedisplay@2.0-service-sdm: LiveDisplay HAL service is shutting down.

We have "libsdm-disp-apis.qti.so" instead of "libsdm-disp-apis.so" in vendor, so I renamed it, and finally got to see the setup wizard.

I'm quite baffled that I had to do these weird/dirty hacks to get things rolling, and although I'm now in the OS, I fear that there might be more such problems I've yet to hit.