General Development of LineageOS 20 for Xiaomi 12 Pro

Search This thread

NeoArian

Recognized Developer
Nov 25, 2017
1,325
3,089
Sony Xperia Z2
Sony Xperia Z3 Compact
Development
I have been working on LineageOS for the Xiaomi 12 since a while and extended that work to the Xiaomi 12 Pro since the devices have huge parts in common.

All the kernel repositories can be found here: https://github.com/xiaomi-sm8450-kernel/
All the device repositories can be found here: https://github.com/cupid-development/

If you are interested in building LineageOS for Xiaomi 12 Pro yourself, you can use the following two local_manifests:
Code:
xiaomi_sm8450_kernel.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <!-- xiaomi-sm8450 specific forks -->
  <remote name="xiaomi-sm8450-kernel"
          fetch="ssh://[email protected]/xiaomi-sm8450-kernel"
          revision="lineage-20" />
  <!-- https://git.codelinaro.org/clo/la/kernel/build -->
  <project name="android_kernel_platform_build" path="kernel_platform/build" remote="xiaomi-sm8450-kernel"/>
  <!-- https://git.codelinaro.org/clo/la/kernel/msm-5.10 -->
  <project name="android_kernel_platform_msm-kernel" path="kernel_platform/msm-kernel" remote="xiaomi-sm8450-kernel">
    <linkfile dest="kernel_platform/common/build.config.msm.waipio" src="build.config.msm.waipio"/>
    <linkfile dest="kernel_platform/common/build.config.msm.waipio.tuivm" src="build.config.msm.waipio.tuivm"/>
    <linkfile dest="kernel_platform/common/build.config.msm.lahaina" src="build.config.msm.lahaina"/>
    <linkfile dest="kernel_platform/common/build.config.msm.cupid" src="build.config.msm.cupid"/>
    <linkfile dest="kernel_platform/common/build.config.msm.cupid.tuivm" src="build.config.msm.cupid.tuivm"/>
    <linkfile dest="kernel_platform/common/build.config.msm.zeus" src="build.config.msm.zeus"/>
    <linkfile dest="kernel_platform/common/build.config.msm.zeus.tuivm" src="build.config.msm.zeus.tuivm"/>
  </project>
  <!-- https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/audio-kernel-ar -->
  <project name="android_vendor_qcom_opensource_audio-kernel" path="vendor/qcom/opensource/audio-kernel" remote="xiaomi-sm8450-kernel">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/audio_kernel_vendor_board.mk" src="audio_kernel_vendor_board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/audio_kernel_product_board.mk" src="audio_kernel_product_board.mk"/>
  </project>
  <!-- https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel -->
  <project name="android_vendor_qcom_opensource_camera-kernel" path="vendor/qcom/opensource/camera-kernel" remote="xiaomi-sm8450-kernel">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/camera-kernel_board.mk" src="board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/camera-kernel_product.mk" src="product.mk"/>
  </project>
  <!-- https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-drivers -->
  <project name="android_vendor_qcom_opensource_display-drivers" path="vendor/qcom/opensource/display-drivers" remote="xiaomi-sm8450-kernel">
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/display_driver_product.mk" src="display_driver_product.mk"/>
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/display_driver_board.mk" src="display_driver_board.mk"/>
  </project>
  <!-- Proprietary -->
  <project name="android_vendor_qcom_proprietary_devicetree" path="vendor/qcom/proprietary/devicetree" remote="xiaomi-sm8450-kernel">
    <linkfile dest="kernel_platform/msm-kernel/arch/arm64/boot/dts/vendor" src="." />
  </project>
  <project name="android_vendor_qcom_proprietary_audio-devicetree" path="vendor/qcom/proprietary/audio-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_camera-devicetree" path="vendor/qcom/proprietary/camera-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_cvp-devicetree" path="vendor/qcom/proprietary/cvp-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_eva-devicetree" path="vendor/qcom/proprietary/eva-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_display-devicetree" path="vendor/qcom/proprietary/display-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_mmrm-devicetree" path="vendor/qcom/proprietary/mmrm-devicetree" remote="xiaomi-sm8450-kernel"/>
  <project name="android_vendor_qcom_proprietary_video-devicetree" path="vendor/qcom/proprietary/video-devicetree" remote="xiaomi-sm8450-kernel"/>

  <!-- Kernel platform manifest -->
  <!-- https://git.codelinaro.org/clo/la/kernelplatform/manifest -->
  <remote name="clo_kernel_waipio"
          fetch="https://git.codelinaro.org/clo/la"
          sync-c="true"
          sync-tags="false"
          review="codelinaro.org"
          revision="refs/tags/KERNEL.PLATFORM.1.0.r1-15600-kernel.0" />
  <project groups="qki" name="kernel/common" path="kernel_platform/common" remote="clo_kernel_waipio"/>
  <project clone-depth="1" name="kernel/prebuilts/build-tools" path="kernel_platform/prebuilts/kernel-build-tools" remote="clo_kernel_waipio"/>
  <project name="kernel_platform/external/dtc" remote="clo_kernel_waipio"/>
  <project name="kernel_platform/kernel/prebuilts/mainline/arm64" remote="clo_kernel_waipio"/>
  <project clone-depth="1" name="kernel_platform/prebuilts/build-tools" remote="clo_kernel_waipio"/>
  <project name="kernel_platform/system/tools/mkbootimg" path="kernel_platform/tools/mkbootimg" remote="clo_kernel_waipio"/>
  <project clone-depth="1" name="kernelplatform/prebuilts-master/clang/host/linux-x86" path="kernel_platform/prebuilts-master/clang/host/linux-x86" remote="clo_kernel_waipio"/>
  <project clone-depth="1" name="kernelplatform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" path="kernel_platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" remote="clo_kernel_waipio"/>

  <!-- Video manifest -->
  <!-- https://git.codelinaro.org/clo/la/techpack/video/manifest -->
  <remote name="clo_video_waipio"
          fetch="https://git.codelinaro.org/clo/la"
          sync-c="true"
          sync-tags="false"
          review="codelinaro.org"
          revision="refs/tags/VIDEO.LA.2.0.r1-08700-WAIPIO.0" />
  <project groups="cyborg" name="platform/vendor/opensource/mmrm-driver" path="vendor/qcom/opensource/mmrm-driver" remote="clo_video_waipio">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/mmrm_kernel_board.mk" src="mmrm_kernel_board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/mmrm_kernel_product.mk" src="mmrm_kernel_product.mk"/>
  </project>
  <project groups="cyborg" name="platform/vendor/opensource/mmrm-driver-test" path="vendor/qcom/opensource/mmrm-driver/test" remote="clo_video_waipio"/>
  <project groups="cyborg" name="platform/vendor/opensource/video-driver" path="vendor/qcom/opensource/video-driver" remote="clo_video_waipio">
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/video_kernel_product.mk" src="video_kernel_product.mk"/>
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/video_kernel_board.mk" src="video_kernel_board.mk"/>
  </project>

  <!-- Vendor manifest -->
  <!-- https://git.codelinaro.org/clo/la/la/vendor/manifest -->
  <remote name="clo_vendor_waipio"
          fetch="https://git.codelinaro.org/clo/la"
          sync-c="true"
          sync-tags="false"
          review="codelinaro.org"
          revision="refs/tags/LA.VENDOR.1.0.r1-23000-WAIPIO.QSSI13.0" />
  <project name="platform/vendor/opensource/cvp-kernel" path="vendor/qcom/opensource/cvp-kernel" remote="clo_vendor_waipio">
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/cvp_kernel_product.mk" src="cvp_kernel_product.mk"/>
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/cvp_kernel_board.mk" src="cvp_kernel_board.mk"/>
  </project>
  <project name="platform/vendor/opensource/dataipa" path="vendor/qcom/opensource/dataipa" remote="clo_vendor_waipio">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/dataipa_dlkm_vendor_board.mk" src="dataipa_dlkm_vendor_board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/dataipa_dlkm_vendor_product.mk" src="dataipa_dlkm_vendor_product.mk"/>
  </project>
  <project name="platform/vendor/opensource/eva-kernel" path="vendor/qcom/opensource/eva-kernel" remote="clo_vendor_waipio">
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/eva_kernel_product.mk" src="eva_kernel_product.mk"/>
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/eva_kernel_board.mk" src="eva_kernel_board.mk"/>
  </project>
  <project name="platform/vendor/opensource/touch-drivers" path="vendor/qcom/opensource/touch-drivers" remote="clo_vendor_waipio"/>
  <project name="platform/vendor/qcom-opensource/wlan/fw-api" path="vendor/qcom/opensource/wlan/fw-api" remote="clo_vendor_waipio"/>
  <project name="platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn" path="vendor/qcom/opensource/wlan/qca-wifi-host-cmn" remote="clo_vendor_waipio"/>
  <project name="platform/vendor/qcom-opensource/wlan/qcacld-3.0" path="vendor/qcom/opensource/wlan/qcacld-3.0" remote="clo_vendor_waipio"/>
  <project name="platform/vendor/qcom/opensource/datarmnet" path="vendor/qcom/opensource/datarmnet" remote="clo_vendor_waipio">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/datarmnet_dlkm_vendor_board.mk" src="datarmnet_dlkm_vendor_board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/datarmnet_dlkm_vendor_product.mk" src="datarmnet_dlkm_vendor_product.mk"/>
  </project>
  <project name="platform/vendor/qcom/opensource/datarmnet-ext" path="vendor/qcom/opensource/datarmnet-ext" remote="clo_vendor_waipio">
    <linkfile dest="vendor/qcom/defs/board-defs/vendor/datarmnet_ext_dlkm_vendor_board.mk" src="datarmnet_ext_dlkm_vendor_board.mk"/>
    <linkfile dest="vendor/qcom/defs/product-defs/vendor/datarmnet_ext_dlkm_vendor_product.mk" src="datarmnet_ext_dlkm_vendor_product.mk"/>
  </project>
</manifest>
Code:
xiaomi_sm8450.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <!-- Device trees -->
  <project name="cupid-development/android_device_xiaomi_cupid" path="device/xiaomi/cupid" remote="ssh" />
  <project name="cupid-development/android_device_xiaomi_zeus" path="device/xiaomi/zeus" remote="ssh" />

  <project name="cupid-development/android_device_xiaomi_sm8450-common" path="device/xiaomi/sm8450-common" remote="ssh" />

  <!-- Vendor -->
  <project name="ArianK16a/proprietary_vendor_xiaomi_cupid" path="vendor/xiaomi/cupid" remote="gitlab" />
  <project name="ArianK16a/proprietary_vendor_xiaomi_zeus" path="vendor/xiaomi/zeus" remote="gitlab" />
  <project name="ArianK16a/proprietary_vendor_xiaomi_sm8450-common" path="vendor/xiaomi/sm8450-common" remote="gitlab" />
</manifest>

Code:
remotes.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote fetch="ssh://[email protected]" name="ssh" review="review.lineageos.org" revision="lineage-20" />
  <remote fetch="ssh://[email protected]" name="gitlab" revision="lineage-20" />
  <remote fetch="git://codeaurora.org/quic/la" name="caf" />
  <remote fetch="https://git.codelinaro.org/clo/la" name="clo" review="codelinaro.org"/>
</manifest>

Additionally to these repositories there are a few patches from gerrit needed, you can run this bash scrip to apply them locally
Code:
repopicks.sh
Code:
#!/bin/bash

set -e
source "build/envsetup.sh";
source "vendor/lineage/build/envsetup.sh";

# frameworks/av
changes=(
351261 # SessionConfigurationUtils: Allow privileged camera apps to create raw streams for raw capable cameras
)
repopick -P frameworks/av ${changes[@]}&

# frameworks/base
changes=(
351262 # Camera: Expose aux camera if packagename is null
)
repopick -f -P frameworks/base ${changes[@]}&

# frameworks/opt/telephony
changes=(
349338 # Disable proguard for CellularNetworkServiceProvider
349339 # Add provision to override CellularNetworkService
349340 # Make a few  members of DSM overridable and accessible
349341 # Reset data activity after traffic status poll stops
349342 # Start using inject framework support
349343 # Skip sending duplicate requests
349344 # Enable vendor Telephony plugin: MSIM Changes
)
repopick -P frameworks/opt/telephony ${changes[@]}&

# hardware/interfaces
changes=(
349303 # frameworks: Update HIDL overrideFormat from HAL
)
repopick -P hardware/interfaces ${changes[@]}&

# hardware/xiaomi
changes=(
352657 # Add dummy sensors sub HAL
352658 # sensors: Make sensor batch function virtual
352659 # sensors: Make sensor run function virtual
352660 # sensors: Make sensor flush function virtual
352661 # sensors: Make sensor set mode operation function virtual
352662 # sensors: Move one shot sensor out of main class
352663 # sensors: Fix locking around setOperationMode and activate
352664 # sensors: Add udfps long press sensor
352665 # sensors: Handle fod_pressed_state without coordinates
)
repopick -P hardware/xiaomi ${changes[@]}&

# hardware/qcom-caf/sm8450/display
changes=(
364748 # Revert "display: Remove dependencies of display specific kernel headers"
)
repopick -P hardware/qcom-caf/sm8450/display ${changes[@]}&

wait

repopick -t 13-kernelplatform


After applying the necessary patches you will have to extract the vendor, either from stock Xiaomi 12 Pro ROM or, preferably, from my shared LineageOS 20 build which can be found below. Use the extract-files.sh script in device/xiaomi/zeus to do so.
The vendor repositories are on gitlab now and included in the manifests above.

Due to the Generic Kernel Image setup we build the kernel before starting the LineageOS build, to do that execute the following commands to prepare your environment:
Code:
. build/envsetup.sh
breakfast zeus
Now use this bash script to compile the kernel:
Code:
#!/bin/bash

export TARGET_BOARD_PLATFORM="zeus"
export OUT_DIR=${ANDROID_BUILD_TOP}/out/msm-kernel-${TARGET_BOARD_PLATFORM}

export LTO=thin

./kernel_platform/build/android/prepare_vendor.sh ${TARGET_BOARD_PLATFORM} gki


Now you're ready to start the actual build:
Code:
brunch zeus

Installation
In order to flash the compiled build you can follow the instructions from my thread for the shared builds,
Make sure you are using firmware from MIUI 14 based on Android 13 before flashing LineageOS!


I hope this can help other interested developers to get AOSP for Xiaomi 12 Pro in a better shape!

Donate to support development:
Donate via PayPal to ArianK16a
Donate via PayPal to LineageOS
 
Last edited:

Danacy

Senior Member
Jan 7, 2014
194
40
Amazing! Thank you very much for sharing it here. I lack the technical knowledge to start this off but like @Maxou6440 above me here says, I also will be available for beta testing if needed.

If LineageOS goes unto my 12 Pro I think I will stick with it forever :)
 

Ghesun

Member
Nov 4, 2022
7
5
Are there plans to completely finish this project or is it as-is? Anyway thank you so much for putting in the groundwork for ROM development for our phones. Can't wait to see where this all goes! :)
 
  • Like
Reactions: Danacy and NeoArian

NeoArian

Recognized Developer
Nov 25, 2017
1,325
3,089
Sony Xperia Z2
Sony Xperia Z3 Compact
Are there plans to completely finish this project or is it as-is? Anyway thank you so much for putting in the groundwork for ROM development for our phones. Can't wait to see where this all goes! :)
Yes, I will buy the device soon. There's is a crowdfunding running to support it, which is mentioned at the bottom of the first post.
I intend to get both, Xiaomi 12 and 12 pro, official at lineage in future. Once I get the device I should be able to get it working soon on an unofficial version :)
Official might take a while.
 
Last edited:

Danacy

Senior Member
Jan 7, 2014
194
40
Yes, I will buy the device soon. There's is a crowdfunding running to support it, which is mentioned at the bottom of the first post.
I intend to get both, Xiaomi 12 and 12 pro, official at lineage in future. Once I get the device I should be able to get it working soon on an unofficial version :)
Official might take a while.
Getting official will always take a while right? Needs to get into some process, core of the LineageOS must already be of high standard, etc. I've seen the development with other devices.

I donated to your PayPal, hope it works out with the 12 Pro. Thanks again for picking this up
 
  • Like
Reactions: NeoArian and Kkjin

Kkjin

Member
Feb 2, 2021
35
12
OnePlus 9R
l’m very excited about the Xiaomi 12 Pro LineageOS development news.


I have a quick question: Is it possible to achieve a maximum of 480Hz in touch sampling?

Is the cn version the model you buy and develop?

If it is possible, I will definitely purchase this device.
 
Last edited:

Kkjin

Member
Feb 2, 2021
35
12
OnePlus 9R
i love neo!~
 

Attachments

  • bandicam 2023-05-31 00-24-38-302.jpg
    bandicam 2023-05-31 00-24-38-302.jpg
    67.3 KB · Views: 168

NeoArian

Recognized Developer
Nov 25, 2017
1,325
3,089
Sony Xperia Z2
Sony Xperia Z3 Compact
Hello everyone!

I have received my Xiaomi 12 Pro yesterday and am currently waiting until i can unlock the bootloader.
In the meantime i have tried some more things regarding the issue with the touchscreen - with success!
There are still major issues on the build, namely:
* SELinux is permissive
* UDFPS does not work
* Setting a screen lock does not work

However, if you are still intersted in playing with lineage on zeus already; you can download it here and follow the instructions from my Xiaomi 12 thread (linked at the first post in this thread): https://github.com/arian-ota/ota/releases/tag/20.0-zeus-1c07013d

There might not be many updates from me within the next week.
Have a nice day everyone!

Arian
 

Danacy

Senior Member
Jan 7, 2014
194
40
Hello everyone!

I have received my Xiaomi 12 Pro yesterday and am currently waiting until i can unlock the bootloader.
In the meantime i have tried some more things regarding the issue with the touchscreen - with success!
There are still major issues on the build, namely:
* SELinux is permissive
* UDFPS does not work
* Setting a screen lock does not work

However, if you are still intersted in playing with lineage on zeus already; you can download it here and follow the instructions from my Xiaomi 12 thread (linked at the first post in this thread): https://github.com/arian-ota/ota/releases/tag/20.0-zeus-1c07013d

There might not be many updates from me within the next week.
Have a nice day everyone!

Arian
Awesome, great news. After the mandatory waiting game I wish you a lot of fun with the puzzle :) And of there is an usable ROM I will be available for beta testing. I use it as a daily device so need a little bit of stability, okay with bugs and stuff to discover. Thank you again!
 

NOSS8

Recognized Contributor
Hi ,NeoArian
I installed the rom successfully but the touchscreen does not work so I get stuck on the LOS welcome screen.
Maybe my mistake to have installed NikGapps-core-arm64-13-20230531 since the recommended one is A12.
Even after a complete formatting and reinstallation without gapps no touch.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Development
    I have been working on LineageOS for the Xiaomi 12 since a while and extended that work to the Xiaomi 12 Pro since the devices have huge parts in common.

    All the kernel repositories can be found here: https://github.com/xiaomi-sm8450-kernel/
    All the device repositories can be found here: https://github.com/cupid-development/

    If you are interested in building LineageOS for Xiaomi 12 Pro yourself, you can use the following two local_manifests:
    Code:
    xiaomi_sm8450_kernel.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <!-- xiaomi-sm8450 specific forks -->
      <remote name="xiaomi-sm8450-kernel"
              fetch="ssh://[email protected]/xiaomi-sm8450-kernel"
              revision="lineage-20" />
      <!-- https://git.codelinaro.org/clo/la/kernel/build -->
      <project name="android_kernel_platform_build" path="kernel_platform/build" remote="xiaomi-sm8450-kernel"/>
      <!-- https://git.codelinaro.org/clo/la/kernel/msm-5.10 -->
      <project name="android_kernel_platform_msm-kernel" path="kernel_platform/msm-kernel" remote="xiaomi-sm8450-kernel">
        <linkfile dest="kernel_platform/common/build.config.msm.waipio" src="build.config.msm.waipio"/>
        <linkfile dest="kernel_platform/common/build.config.msm.waipio.tuivm" src="build.config.msm.waipio.tuivm"/>
        <linkfile dest="kernel_platform/common/build.config.msm.lahaina" src="build.config.msm.lahaina"/>
        <linkfile dest="kernel_platform/common/build.config.msm.cupid" src="build.config.msm.cupid"/>
        <linkfile dest="kernel_platform/common/build.config.msm.cupid.tuivm" src="build.config.msm.cupid.tuivm"/>
        <linkfile dest="kernel_platform/common/build.config.msm.zeus" src="build.config.msm.zeus"/>
        <linkfile dest="kernel_platform/common/build.config.msm.zeus.tuivm" src="build.config.msm.zeus.tuivm"/>
      </project>
      <!-- https://git.codelinaro.org/clo/la/platform/vendor/qcom/opensource/audio-kernel-ar -->
      <project name="android_vendor_qcom_opensource_audio-kernel" path="vendor/qcom/opensource/audio-kernel" remote="xiaomi-sm8450-kernel">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/audio_kernel_vendor_board.mk" src="audio_kernel_vendor_board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/audio_kernel_product_board.mk" src="audio_kernel_product_board.mk"/>
      </project>
      <!-- https://git.codelinaro.org/clo/la/platform/vendor/opensource/camera-kernel -->
      <project name="android_vendor_qcom_opensource_camera-kernel" path="vendor/qcom/opensource/camera-kernel" remote="xiaomi-sm8450-kernel">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/camera-kernel_board.mk" src="board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/camera-kernel_product.mk" src="product.mk"/>
      </project>
      <!-- https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-drivers -->
      <project name="android_vendor_qcom_opensource_display-drivers" path="vendor/qcom/opensource/display-drivers" remote="xiaomi-sm8450-kernel">
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/display_driver_product.mk" src="display_driver_product.mk"/>
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/display_driver_board.mk" src="display_driver_board.mk"/>
      </project>
      <!-- Proprietary -->
      <project name="android_vendor_qcom_proprietary_devicetree" path="vendor/qcom/proprietary/devicetree" remote="xiaomi-sm8450-kernel">
        <linkfile dest="kernel_platform/msm-kernel/arch/arm64/boot/dts/vendor" src="." />
      </project>
      <project name="android_vendor_qcom_proprietary_audio-devicetree" path="vendor/qcom/proprietary/audio-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_camera-devicetree" path="vendor/qcom/proprietary/camera-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_cvp-devicetree" path="vendor/qcom/proprietary/cvp-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_eva-devicetree" path="vendor/qcom/proprietary/eva-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_display-devicetree" path="vendor/qcom/proprietary/display-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_mmrm-devicetree" path="vendor/qcom/proprietary/mmrm-devicetree" remote="xiaomi-sm8450-kernel"/>
      <project name="android_vendor_qcom_proprietary_video-devicetree" path="vendor/qcom/proprietary/video-devicetree" remote="xiaomi-sm8450-kernel"/>
    
      <!-- Kernel platform manifest -->
      <!-- https://git.codelinaro.org/clo/la/kernelplatform/manifest -->
      <remote name="clo_kernel_waipio"
              fetch="https://git.codelinaro.org/clo/la"
              sync-c="true"
              sync-tags="false"
              review="codelinaro.org"
              revision="refs/tags/KERNEL.PLATFORM.1.0.r1-15600-kernel.0" />
      <project groups="qki" name="kernel/common" path="kernel_platform/common" remote="clo_kernel_waipio"/>
      <project clone-depth="1" name="kernel/prebuilts/build-tools" path="kernel_platform/prebuilts/kernel-build-tools" remote="clo_kernel_waipio"/>
      <project name="kernel_platform/external/dtc" remote="clo_kernel_waipio"/>
      <project name="kernel_platform/kernel/prebuilts/mainline/arm64" remote="clo_kernel_waipio"/>
      <project clone-depth="1" name="kernel_platform/prebuilts/build-tools" remote="clo_kernel_waipio"/>
      <project name="kernel_platform/system/tools/mkbootimg" path="kernel_platform/tools/mkbootimg" remote="clo_kernel_waipio"/>
      <project clone-depth="1" name="kernelplatform/prebuilts-master/clang/host/linux-x86" path="kernel_platform/prebuilts-master/clang/host/linux-x86" remote="clo_kernel_waipio"/>
      <project clone-depth="1" name="kernelplatform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" path="kernel_platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8" remote="clo_kernel_waipio"/>
    
      <!-- Video manifest -->
      <!-- https://git.codelinaro.org/clo/la/techpack/video/manifest -->
      <remote name="clo_video_waipio"
              fetch="https://git.codelinaro.org/clo/la"
              sync-c="true"
              sync-tags="false"
              review="codelinaro.org"
              revision="refs/tags/VIDEO.LA.2.0.r1-08700-WAIPIO.0" />
      <project groups="cyborg" name="platform/vendor/opensource/mmrm-driver" path="vendor/qcom/opensource/mmrm-driver" remote="clo_video_waipio">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/mmrm_kernel_board.mk" src="mmrm_kernel_board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/mmrm_kernel_product.mk" src="mmrm_kernel_product.mk"/>
      </project>
      <project groups="cyborg" name="platform/vendor/opensource/mmrm-driver-test" path="vendor/qcom/opensource/mmrm-driver/test" remote="clo_video_waipio"/>
      <project groups="cyborg" name="platform/vendor/opensource/video-driver" path="vendor/qcom/opensource/video-driver" remote="clo_video_waipio">
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/video_kernel_product.mk" src="video_kernel_product.mk"/>
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/video_kernel_board.mk" src="video_kernel_board.mk"/>
      </project>
    
      <!-- Vendor manifest -->
      <!-- https://git.codelinaro.org/clo/la/la/vendor/manifest -->
      <remote name="clo_vendor_waipio"
              fetch="https://git.codelinaro.org/clo/la"
              sync-c="true"
              sync-tags="false"
              review="codelinaro.org"
              revision="refs/tags/LA.VENDOR.1.0.r1-23000-WAIPIO.QSSI13.0" />
      <project name="platform/vendor/opensource/cvp-kernel" path="vendor/qcom/opensource/cvp-kernel" remote="clo_vendor_waipio">
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/cvp_kernel_product.mk" src="cvp_kernel_product.mk"/>
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/cvp_kernel_board.mk" src="cvp_kernel_board.mk"/>
      </project>
      <project name="platform/vendor/opensource/dataipa" path="vendor/qcom/opensource/dataipa" remote="clo_vendor_waipio">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/dataipa_dlkm_vendor_board.mk" src="dataipa_dlkm_vendor_board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/dataipa_dlkm_vendor_product.mk" src="dataipa_dlkm_vendor_product.mk"/>
      </project>
      <project name="platform/vendor/opensource/eva-kernel" path="vendor/qcom/opensource/eva-kernel" remote="clo_vendor_waipio">
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/eva_kernel_product.mk" src="eva_kernel_product.mk"/>
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/eva_kernel_board.mk" src="eva_kernel_board.mk"/>
      </project>
      <project name="platform/vendor/opensource/touch-drivers" path="vendor/qcom/opensource/touch-drivers" remote="clo_vendor_waipio"/>
      <project name="platform/vendor/qcom-opensource/wlan/fw-api" path="vendor/qcom/opensource/wlan/fw-api" remote="clo_vendor_waipio"/>
      <project name="platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn" path="vendor/qcom/opensource/wlan/qca-wifi-host-cmn" remote="clo_vendor_waipio"/>
      <project name="platform/vendor/qcom-opensource/wlan/qcacld-3.0" path="vendor/qcom/opensource/wlan/qcacld-3.0" remote="clo_vendor_waipio"/>
      <project name="platform/vendor/qcom/opensource/datarmnet" path="vendor/qcom/opensource/datarmnet" remote="clo_vendor_waipio">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/datarmnet_dlkm_vendor_board.mk" src="datarmnet_dlkm_vendor_board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/datarmnet_dlkm_vendor_product.mk" src="datarmnet_dlkm_vendor_product.mk"/>
      </project>
      <project name="platform/vendor/qcom/opensource/datarmnet-ext" path="vendor/qcom/opensource/datarmnet-ext" remote="clo_vendor_waipio">
        <linkfile dest="vendor/qcom/defs/board-defs/vendor/datarmnet_ext_dlkm_vendor_board.mk" src="datarmnet_ext_dlkm_vendor_board.mk"/>
        <linkfile dest="vendor/qcom/defs/product-defs/vendor/datarmnet_ext_dlkm_vendor_product.mk" src="datarmnet_ext_dlkm_vendor_product.mk"/>
      </project>
    </manifest>
    Code:
    xiaomi_sm8450.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <!-- Device trees -->
      <project name="cupid-development/android_device_xiaomi_cupid" path="device/xiaomi/cupid" remote="ssh" />
      <project name="cupid-development/android_device_xiaomi_zeus" path="device/xiaomi/zeus" remote="ssh" />
    
      <project name="cupid-development/android_device_xiaomi_sm8450-common" path="device/xiaomi/sm8450-common" remote="ssh" />
    
      <!-- Vendor -->
      <project name="ArianK16a/proprietary_vendor_xiaomi_cupid" path="vendor/xiaomi/cupid" remote="gitlab" />
      <project name="ArianK16a/proprietary_vendor_xiaomi_zeus" path="vendor/xiaomi/zeus" remote="gitlab" />
      <project name="ArianK16a/proprietary_vendor_xiaomi_sm8450-common" path="vendor/xiaomi/sm8450-common" remote="gitlab" />
    </manifest>

    Code:
    remotes.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <remote fetch="ssh://[email protected]" name="ssh" review="review.lineageos.org" revision="lineage-20" />
      <remote fetch="ssh://[email protected]" name="gitlab" revision="lineage-20" />
      <remote fetch="git://codeaurora.org/quic/la" name="caf" />
      <remote fetch="https://git.codelinaro.org/clo/la" name="clo" review="codelinaro.org"/>
    </manifest>

    Additionally to these repositories there are a few patches from gerrit needed, you can run this bash scrip to apply them locally
    Code:
    repopicks.sh
    Code:
    #!/bin/bash
    
    set -e
    source "build/envsetup.sh";
    source "vendor/lineage/build/envsetup.sh";
    
    # frameworks/av
    changes=(
    351261 # SessionConfigurationUtils: Allow privileged camera apps to create raw streams for raw capable cameras
    )
    repopick -P frameworks/av ${changes[@]}&
    
    # frameworks/base
    changes=(
    351262 # Camera: Expose aux camera if packagename is null
    )
    repopick -f -P frameworks/base ${changes[@]}&
    
    # frameworks/opt/telephony
    changes=(
    349338 # Disable proguard for CellularNetworkServiceProvider
    349339 # Add provision to override CellularNetworkService
    349340 # Make a few  members of DSM overridable and accessible
    349341 # Reset data activity after traffic status poll stops
    349342 # Start using inject framework support
    349343 # Skip sending duplicate requests
    349344 # Enable vendor Telephony plugin: MSIM Changes
    )
    repopick -P frameworks/opt/telephony ${changes[@]}&
    
    # hardware/interfaces
    changes=(
    349303 # frameworks: Update HIDL overrideFormat from HAL
    )
    repopick -P hardware/interfaces ${changes[@]}&
    
    # hardware/xiaomi
    changes=(
    352657 # Add dummy sensors sub HAL
    352658 # sensors: Make sensor batch function virtual
    352659 # sensors: Make sensor run function virtual
    352660 # sensors: Make sensor flush function virtual
    352661 # sensors: Make sensor set mode operation function virtual
    352662 # sensors: Move one shot sensor out of main class
    352663 # sensors: Fix locking around setOperationMode and activate
    352664 # sensors: Add udfps long press sensor
    352665 # sensors: Handle fod_pressed_state without coordinates
    )
    repopick -P hardware/xiaomi ${changes[@]}&
    
    # hardware/qcom-caf/sm8450/display
    changes=(
    364748 # Revert "display: Remove dependencies of display specific kernel headers"
    )
    repopick -P hardware/qcom-caf/sm8450/display ${changes[@]}&
    
    wait
    
    repopick -t 13-kernelplatform


    After applying the necessary patches you will have to extract the vendor, either from stock Xiaomi 12 Pro ROM or, preferably, from my shared LineageOS 20 build which can be found below. Use the extract-files.sh script in device/xiaomi/zeus to do so.
    The vendor repositories are on gitlab now and included in the manifests above.

    Due to the Generic Kernel Image setup we build the kernel before starting the LineageOS build, to do that execute the following commands to prepare your environment:
    Code:
    . build/envsetup.sh
    breakfast zeus
    Now use this bash script to compile the kernel:
    Code:
    #!/bin/bash
    
    export TARGET_BOARD_PLATFORM="zeus"
    export OUT_DIR=${ANDROID_BUILD_TOP}/out/msm-kernel-${TARGET_BOARD_PLATFORM}
    
    export LTO=thin
    
    ./kernel_platform/build/android/prepare_vendor.sh ${TARGET_BOARD_PLATFORM} gki


    Now you're ready to start the actual build:
    Code:
    brunch zeus

    Installation
    In order to flash the compiled build you can follow the instructions from my thread for the shared builds,
    Make sure you are using firmware from MIUI 14 based on Android 13 before flashing LineageOS!


    I hope this can help other interested developers to get AOSP for Xiaomi 12 Pro in a better shape!

    Donate to support development:
    Donate via PayPal to ArianK16a
    Donate via PayPal to LineageOS
    11
    Hello everyone!

    I have received my Xiaomi 12 Pro yesterday and am currently waiting until i can unlock the bootloader.
    In the meantime i have tried some more things regarding the issue with the touchscreen - with success!
    There are still major issues on the build, namely:
    * SELinux is permissive
    * UDFPS does not work
    * Setting a screen lock does not work

    However, if you are still intersted in playing with lineage on zeus already; you can download it here and follow the instructions from my Xiaomi 12 thread (linked at the first post in this thread): https://github.com/arian-ota/ota/releases/tag/20.0-zeus-1c07013d

    There might not be many updates from me within the next week.
    Have a nice day everyone!

    Arian
    8
    Great news, i have spent the last two days and nights on reverse engineering the touchscreen drivers and got it working!
    This means that we can have a complete OSS kernel which allows us to update it without having to wait on stock ROM updates so that the kernel modules will still work.

    The most relevant part which had to be reversed can be found here: https://github.com/xiaomi-sm8450-ke...mmit/a1e600ded3f2c33afd4e8e307bca359a02f8cedc

    All changes are here: https://github.com/xiaomi-sm8450-ke...s/touch/KERNEL.PLATFORM.1.0.r1-09700-kernel.0
    6
    Hello there!
    I have been working on the fingerprint scanner the last two days and got it working!
    I have also configured the aux cameras for aperture and switched to enforcing selinux.

    The ROM has reached a respectable state now in my opinion, that's why i have decided to open a new thread for the usage of the rom.

    This thread will stay open with the build instructions in the first post and should be used for development related questions, not for user support.

    Thanks everyone and have a nice day!
    6
    Are there plans to completely finish this project or is it as-is? Anyway thank you so much for putting in the groundwork for ROM development for our phones. Can't wait to see where this all goes! :)
    Yes, I will buy the device soon. There's is a crowdfunding running to support it, which is mentioned at the bottom of the first post.
    I intend to get both, Xiaomi 12 and 12 pro, official at lineage in future. Once I get the device I should be able to get it working soon on an unofficial version :)
    Official might take a while.