[Xiaomi Mi Pad 4 ROMs, Kernels, Recoveries, & Other] limited_imagination:
Hi all, I'm posting to express thanks to all the devs whose work made this great ROM possible, and especially to @rcstar6696 and @S-trace and @michael_ch and @sabar_op.

After much trial & error, I have just successfully compiled a new build of this 17.1 LineageOS ROM, with an updated Android security patch (August 5, 2021) and an updated kernel version to 4.4.245-Xiaomi_SDM660-LA.UM.8.2.r2-02500+ #2 Mon Aug 16 19:23:55 PDT 2021.

I have been running it on my MiPad 4 for a day now, and it seems to run as well as the @sabar_op version from October 2, 2020, that I was running before.

I'll try to find a place to host the zip file.

(Edit - I used Sourceforge, here's the link: )

https://sourceforge.net/projects/mipad4unofficiallineageosbuild/files/lineage-17.1-20210817-UNOFFICIAL-clover.zip/download

I am a total newb at ROM building, but if I could pull it off, then I'm sure lots more of you could do it too. Obviously there are huge advantages to being able to do it for yourself.

There are plenty of how-to guides here at XDA, and I loosely followed this one: https://xdaforums.com/t/guide-build-lineageos-how-to-use-github.3551484/

I started with Ubuntu 20.04 running in a VM on a Windows 10 PC, but even with 16 GB of ram configured for it on the VM, the build process kept crashing until finally I installed and enabled ZRAM. That last step took the build process from an ordeal of 3+ hours to get to 85% done at the failure point, into a 59 minute and 32 second speed demon success! After so many failures, I could hardly believe it finally worked.

Once everything was set up, the working commands in the terminal were as follows:

repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

repo sync --force-sync

source build/envsetup.sh

brunch lineage_clover-userdebug

The specific conversation between @michael_ch and @rcstar6696 at post #909 and #910 in this thread was crucial to make it work. From that, I was able to create a working XML file in the local_manifests folder of the source code.

From reading that, my final local_manifest XML file looked like this:

(edit - Now I see a typo in sabarop's github address, which explains why those files didn't sync. Oh well, next time...)

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="lineageos"
fetch="https://github.com/LineageOS/" />

<remote name="sdm660"
fetch="https://github.com/xiaomi-sdm660/" />

<remote name="rcstar6696"
fetch="https://github.com/rcstar6696/" />

<remote name="crdroidandroid"
fetch="https://github.com/crdroidandroid/" />

<remote name="sabraop"
fetch="https://github.com/sabraop/" />

<!-- BUILD MANIFEST -->
<project name="android_build_scripts" path="build/scripts" remote="sdm660" revision="lineage-17.0">
<linkfile src="buildxiaomi.sh" dest="buildxiaomi.sh" />
<linkfile src="buildxiaomi_kernel.sh" dest="buildxiaomi_kernel.sh" />
<linkfile src="sync.sh" dest="sync.sh" />
<linkfile src="buildmodule.sh" dest="buildmodule.sh" />
</project>

<!-- Xiaomi Mi Pad 4 (clover) -->
<project name="android_device_xiaomi_clover" path="device/xiaomi/clover" remote="sdm660" revision="lineage-17.1" />
<project name="android_device_xiaomi_sdm660-common" path="device/xiaomi/sdm660-common" remote="sdm660" revision="cr-8.0-hmp" />
<project name="android_kernel_xiaomi_clover" path="kernel/xiaomi/clover" remote="sdm660" revision="kernel.lnx.4.4.r38-rel-wifi" />
<project name="android_kernel_xiaomi_sdm660" path="kernel/xiaomi/sdm660" remote="sdm660" revision="master" />
<project name="android_vendor_xiaomi_clover" path="vendor/xiaomi/clover" remote="sdm660" revision="master" />
<project name="android_vendor_xiaomi_sdm660-common" path="vendor/xiaomi/sdm660-common" remote="sdm660" revision="cr-8.0-hmp" />
<project name="android_vendor_xiaomi_MiuiCamera" path="vendor/xiaomi/MiuiCamera" remote="sdm660" revision="master" />

<!-- Fixes "make[1]: clang: Command not found" kernel build failure -->
<project path="prebuilts/clang/host/linux-x86/clang-r377782c" name="android_prebuilts_clang_host_linux-x86_clang-6305083" groups="pdk" clone-depth="1" remote="crdroidandroid" revision="10.0"/>
</manifest>