[ROM][10.0][Xiaomi Mi 9][UNOFFICIAL]LineageOS 17.1 CLEAN, STOCK [2020-07-10]

Search This thread
** Standard Disclaimer: Unlocking your Bootloader will Void your Warranty. I take no responsibility for this or for any bricked devices. These thing should go without saying at this point, but there they are. If you are here, I assume you are familiar with LineageOS, TWRP, and moving from MIUI to AOSP-based ROMs**

**Download Link Updated to build 2020-07-10**


TL;DR:
This is a Clean, Stock LineageOS Build for Xiaomi Mi 9 (cepheus) that does NOT include any GApps, MicroG, or Signature Spoofing.
What you choose to add/modify after installing this ROM is entirely up to you.

All,
I wanted to distance myself from Google as much as possible, so I decided to build LineageOS from the source.
I used the LineageOS source they provide via GitHub, available here.
I also use the Proprietary Blobs for the Cepheus Device Tree from Demon000's GitHub, available here.
To get current version to build, I also needed to add the LineageOS/android_hardware_xiaomi source to my local manifest and use the repopicks Cozzymy13 includes in the OP of his ROM's thread. [Thanks k1l for and Cozzymy13 for pointing out these additions!]

The result is a stock build of LineageOS 17.1 for the Cepheus device. In the spirit of LineageOS, this does not include Signature Spoofing. You will need to use Xposed or some other method if you desire that functionality.

This also does not include MicroG or any other additional applications. This is pure LineageOS, built on 2020-07-10.

NanoDroid patcher works well for anyone who wants to add MicroG support. You will still need to use Xposed or similar if you want Signature Spoofing as NanoDroid does not offer a patch for Android 10 as of this build.

Feel free to provide download mirrors.

What Works:
Pretty much everything from what I can tell
Fingerprint Sensor it working like a champ so far.
DT2W/DT2S
NFC Seems to be working but I don't have a device to test against

Known Issues:
You tell me...

Install:
From TWRP:
1) Wipe Date (standard wipe)
2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
3) Format Data (Wipe -> Format Data -> type "yes"
3b) - OPTIONAL - Flash Magisk Zip for Root
4) Reboot to system


Alternate Install Steps for Full MicroG with Signature Spoofing:
From TWRP:
1) Wipe Date (standard wipe)
2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
3) Format Data (Wipe -> Format Data -> type "yes"
3b) - OPTIONAL - Flash Magisk Zip for Root
4) Reboot to system (ignore any errors about missing Google Services)
5) Reboot to TWRP
6) Flash NanoDroid Patcher (either the Full package or you can customize per the instructions in the NanoIx link below)
7) Reboot
8) Install the Magisk Module for Xposed Framework and the EDXposed.ZIP as per the instructions in the Xposed link below)
9) Reboot to activate the new Module
10) Within the EDXposed App, Install the FakeGApps Module
11) Reboot to activate the new Module


As everything I really care about is working in this build, I do not plan to devote much, if any, time to "supporting" this release. I just thought I'd share my clean 17.1 LineageOS in case anyone else is interested.

Download:
LineageOS 17.1 Unofficial (Built: 2020-07-10) md5sum: 1c340fc16a6fbc7586d0a856acb9c600
NanoDroid Patcher (optional): NanoIx
Magisk Root (optional): Magisk
XPosed for Android 10 - Magisk Module (optional): Xposed
 
Last edited:
Messed around too much and had to re-flash. Afterwards, I could not get apps to register with MicroG Cloud Messaging, so some notifications were not working.

If anyone runs into this issue, just get a root shell and run this command:
Code:
adb shell
su
am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://2432546 --receiver-include-background

This will register the current user with Cloud Messaging. You can verify this works with the "Push Notification Tester" app in the Aurora Store.

This knowledge comes to you courtesy of lxp over on the MicroG Github
 

Simonell

Member
Sep 8, 2008
14
14
Using it for second day, and everything seems fine, hotspot working too.
Only problem is with Revolut app which say it's incompatible app, are there any workaround?

Btw. Good job, thanks!
 
Using it for second day, and everything seems fine, hotspot working too.
Only problem is with Revolut app which say it's incompatible app, are there any workaround?

Btw. Good job, thanks!

I'm not familiar with that App. Is it working on other AOSP-based ROMS?

It looks like Mobile Banking app. I don't have an account to really test; nor do I have the energy to try and troubleshoot individual apps.

Are you by chance running it on a rooted install? If you have rooted this ROM, that could be why you are having trouble with that Banking App. I know they tend to not like rooted phones.

I have been happy with this build since I compiled it on the 25th, but I may update and compile from current source. It I do, I can make it available for you to try.

Of course, if it is broken on other LineageOS builds, or if you are rooted, I would expect it to still complain on this build, too.

If you rooted with Magisk, there is a Magisk Hide option in the Magisk Manager app that may let you hide your root from that specific banking app.
 
Last edited:
  • Like
Reactions: Simonell

Simonell

Member
Sep 8, 2008
14
14
I'm not familiar with that App. Is it working on other AOSP-based ROMS?

It looks like Mobile Banking app. I don't have an account to really test; nor do I have the energy to try and troubleshoot individual apps.

Are you by chance running it on a rooted install? If you have rooted this ROM, that could be why you are having trouble with that Banking App. I know they tend to not like rooted phones.

I have been happy with this build since I compiled it on the 25th, but I may update and compile from current source. It I do, I can make it available for you to try.

Of course, if it is broken on other LineageOS builds, or if you are rooted, I would expect it to still complain on this build, too.

If you rooted with Magisk, there is a Magisk Hide option in the Magisk Manager app that may let you hide your root from that specific banking app.

It's working after root and Hide in Magisk Manager. I was confused because it was showing up as "Incomaptible with device" in google play store, after rooting it's installed. Thanks!
Could you send commands which you used to compile ROM? I have some free space on my home server, maybe I could set up Jenkins with auto building. Is it possible to get auto update working?
 
It's working after root and Hide in Magisk Manager. I was confused because it was showing up as "Incomaptible with device" in google play store, after rooting it's installed. Thanks!
Could you send commands which you used to compile ROM? I have some free space on my home server, maybe I could set up Jenkins with auto building. Is it possible to get auto update working?

ThePiGuy already has a great overview of building for unsupported/unofficial devices here
You'll need to install all the base requirements on your build distro before you proceed. This includes the adb and fastboot tools, the build packages, and the java versions as mentioned in this LineageOS build guide for one of their other Xiaomi "supported" devices.

What I post here is basically my method of pulling the relevant info from the two build guides above to get a successful build for the Xiaomi Mi 9 (cepheus).

I will say as for the Requirements, it really needs to be 16GB of RAM. I tried building in a VM with 8GB multiple times and it failed due to running out of memory. This could just be because I run on SSDs and do not use SWAP space/files...

When it comes to your Proprietary Blobs, I pulled mine from Demon000's Github Source
You will need these repos, and we will cover these steps further down:
vendor_xiaomi
kernel_xiaomi_sm8150
device_xiaomi_cepheus
device_xiaomi_sm8150_common

When performing the "ccache -M $G" command I used:
Code:
ccache -M 50G

Now let's create your base folder where you want to make all the magic happen. Be sure to have plenty of storage available. In my case, I needed about 200GB.
Code:
mkdir -p ~/android/lineage
cd ~/android/lineage

When performing your repo init commands, reference branch 17.1:
Code:
repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

Sync the repo to your current working directory, in this case the lineage folder you created above (which should still be your working directory):
Code:
repo sync

This will pull down 100+GB of files, so this takes quite some time.

Following along, you should be in your folder called "lineage" where you ran your repo init and repo sync commands. In my case this is:
Code:
~/android/lineage/

Attached is my manifest file called "cepheus.xml" that references the Demon000 github source.
Place this cepheus.xml file here:
Code:
~/android/lineage/.repo/local_manifests/cepheus.xml
(creating the local_manifests folder if necessary)

Now you need to complete the build of your device tree.
You will clone each of the four repositories above into their respective locations in the device tree:
vendor_xiaomi -> ~/android/lineage/vendor/xiaomi/
kernel_xiaomi_sm8150 -> ~/android/lineage/kernel/xiaomi/sm8150
device_xiaomi_cepheus -> ~/android/lineage/device/xiaomi/cepheus
device_xiaomi_sm8150_common -> ~/android/lineage/device/sm8150_common

Note: Be sure to check each of those four locations and make sure the contents of the repository are in those folders, not, for example: ~/android/lineage/device/sm8150_common/device_xiaomi_sm8150_common. You don't want the repo contents within that extra subfolder...
In my case, I created the necessary directory structure and changed to that directory, then cloned the repo and moved the contents from the subfolder created by the clone operation into the correct location.

Code:
mkdir -p ~/android/lineage/vendor/xiaomi/
cd ~/android/lineage/vendor/xiaomi
git clone https://github.com/Demon000/vendor_xiaomi.git
mv vendor_xiaomi/* .
rm -r vendor_xiaomi

Code:
mkdir -p ~/android/lineage/kernel/xiaomi/sm8150
cd ~/android/lineage/kernel/xiaomi/sm8150
git clone https://github.com/Demon000/kernel_xiaomi_sm8150.git
mv kernel_xiaomi_sm8150/* .
rm -r kernel_xiaomi_sm8150

Code:
mkdir -p ~/android/lineage/device/xiaomi/cepheus
cd ~/android/lineage/device/xiaomi/cepheus
git clone https://github.com/Demon000/device_xiaomi_cepheus.git
mv device_xiaomi_cepheus/* .
rm -r device_xiaomi_cepheus

Code:
mkdir -p ~/android/lineage/device/xiaomi/sm8150_common
cd ~/android/lineage/device/xiaomi/sm8150_common
git clone https://github.com/Demon000/device_xiaomi_sm8150_common.git
mv device_xiaomi_sm8150_common/* .
rm -r device_xiaomi_sm8150_common

Now return to your base lineage folder:
Code:
cd ~/android/lineage

Now that you have init'd and synced your repo and pulled your proprietary blobs into their respective folders, you are ready to build with the brunch command:
Code:
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
export USE_CCACHE=1
ccache -M 50G
source build/envsetup.sh 
brunch lineage_cepheus-userdebug

For me, I have no idea how long this took to complete as I left it running overnight. I would imaging at least 4 hours on my i5 device. Once it's done, you should have a TWRP-flashable zip and an OTA zip in the ~/android/lineage/out folder.

Note: If after compiling for some time, the process fails with errors, it should provide you with information on how to track down the error. In my case, I ended up with it stopping with a failure a couple times, but I just re-ran the above brunch command and it picked up where it left off, eventually completing successfully. YMMV

I'm sure there are cleaner, simpler ways of going about this, but I'm just getting my feet wet with current Android source. I haven't really done any sort of Android "development" since the days of KitKat...
 

Attachments

  • cepheus.xml
    245 bytes · Views: 89
Last edited:

Simonell

Member
Sep 8, 2008
14
14
ThePiGuy already has a great overview of building for unsupported/unofficial devices here
You'll need to install all the base requirements on your build distro before you proceed. This includes the adb and fastboot tools, the build packages, and the java versions as mentioned in this LineageOS build guide for one of their other Xiaomi "supported" devices.

What I post here is basically my method of pulling the relevant info from the two build guides above to get a successful build for the Xiaomi Mi 9 (cepheus).

I will say as for the Requirements, it really needs to be 16GB of RAM. I tried building in a VM with 8GB multiple times and it failed due to running out of memory. This could just be because I run on SSDs and do not use SWAP space/files...

When it comes to your Proprietary Blobs, I pulled mine from Demon000's Github Source
You will need these repos, and we will cover these steps further down:
vendor_xiaomi
kernel_xiaomi_sm8150
device_xiaomi_cepheus
device_xiaomi_sm8150_common

When performing the "ccache -M $G" command I used:
Code:
ccache -M 50G

Now let's create your base folder where you want to make all the magic happen. Be sure to have plenty of storage available. In my case, I needed about 200GB.
Code:
mkdir -p ~/android/lineage
cd ~/android/lineage

When performing your repo init commands, reference branch 17.1:
Code:
repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

Sync the repo to your current working directory, in this case the lineage folder you created above (which should still be your working directory):
Code:
repo sync

This will pull down 100+GB of files, so this takes quite some time.

Following along, you should be in your folder called "lineage" where you ran your repo init and repo sync commands. In my case this is:
Code:
~/android/lineage/

Attached is my manifest file called "cepheus.xml" that references the Demon000 github source.
Place this cepheus.xml file here:
Code:
~/android/lineage/.repo/local_manifests/cepheus.xml
(creating the local_manifests folder if necessary)

Now you need to complete the build of your device tree.
You will clone each of the four repositories above into their respective locations in the device tree:
vendor_xiaomi -> ~/android/lineage/vendor/xiaomi/
kernel_xiaomi_sm8150 -> ~/android/lineage/kernel/xiaomi/sm8150
device_xiaomi_cepheus -> ~/android/lineage/device/xiaomi/cepheus
device_xiaomi_sm8150_common -> ~/android/lineage/device/sm8150_common

Note: Be sure to check each of those four locations and make sure the contents of the repository are in those folders, not, for example: ~/android/lineage/device/sm8150_common/device_xiaomi_sm8150_common. You don't want the repo contents within that extra subfolder...
In my case, I created the necessary directory structure and changed to that directory, then cloned the repo and moved the contents from the subfolder created by the clone operation into the correct location.

Code:
mkdir -p ~/android/lineage/vendor/xiaomi/
cd ~/android/lineage/vendor/xiaomi
git clone https://github.com/Demon000/vendor_xiaomi.git
mv vendor_xiaomi/* .
rm -r vendor_xiaomi

Code:
mkdir -p ~/android/lineage/kernel/xiaomi/sm8150
cd ~/android/lineage/kernel/xiaomi/sm8150
git clone https://github.com/Demon000/kernel_xiaomi_sm8150.git
mv kernel_xiaomi_sm8150/* .
rm -r kernel_xiaomi_sm8150

Code:
mkdir -p ~/android/lineage/device/xiaomi/cepheus
cd ~/android/lineage/device/xiaomi/cepheus
git clone https://github.com/Demon000/device_xiaomi_cepheus.git
mv device_xiaomi_cepheus/* .
rm -r device_xiaomi_cepheus

Code:
mkdir -p ~/android/lineage/device/xiaomi/sm8150_common
cd ~/android/lineage/device/xiaomi/sm8150_common
git clone https://github.com/Demon000/device_xiaomi_sm8150_common.git
mv device_xiaomi_sm8150_common/* .
rm -r device_xiaomi_sm8150_common

Now return to your base lineage folder:
Code:
cd ~/android/lineage

Now that you have init'd and synced your repo and pulled your proprietary blobs into their respective folders, you are ready to build with the brunch command:
Code:
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
export USE_CCACHE=1
ccache -M 50G
source build/envsetup.sh 
brunch lineage_cepheus-userdebug

For me, I have no idea how long this took to complete as I left it running overnight. I would imaging at least 4 hours on my i5 device. Once it's done, you should have a TWRP-flashable zip and an OTA zip in the ~/android/lineage/out folder.

Note: If after compiling for some time, the process fails with errors, it should provide you with information on how to track down the error. In my case, I ended up with it stopping with a failure a couple times, but I just re-ran the above brunch command and it picked up where it left off, eventually completing successfully. YMMV

I'm sure there are cleaner, simpler ways of going about this, but I'm just getting my feet wet with current Android source. I haven't really done any sort of Android "development" since the days of KitKat...

Thanks! I will try this guide at the weekend, and post results :)
 

us23heep

New member
Mar 8, 2018
3
0
Hello friends!
Sorry my poor english. I am stuck 5 days with this error. Google cant answer. Please can you tell me if what I am doing wrong?

Error always say ... depends on undefined module

Try 1: pastebin.com/33nmpQLU
Try 2: pastebin.com/n3gxTXgY
Try 3: pastebin.com/7Lre4ZiF

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

local_manifests:
pastebin.com/kt4ES0d4

Thank you :good:
 
Hello friends!
Sorry my poor english. I am stuck 5 days with this error. Google cant answer. Please can you tell me if what I am doing wrong?

Error always say ... depends on undefined module

Try 1: pastebin.com/33nmpQLU
Try 2: pastebin.com/n3gxTXgY
Try 3: pastebin.com/7Lre4ZiF

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

local_manifests:
pastebin.com/kt4ES0d4

Thank you :good:

It seems like maybe it is not seeing some or all of the device tree files it needs. You may try manually downloading those device files an putting them in the appropriate folders as I mentioned I did in the steps I posted.
 

MWPau

Senior Member
Mar 12, 2015
58
19
I built this yesterday using the instructions above... thanks a lot for those photonmedia!
Some of the instructions were wrong, ie a _ instead of a - in a dir name, but easy fixed.
After that, the entire build completed with 0 errors.
I didnt end up with a ZIP file though, just a approx 400MB "build-lineage_cepheus.ninja" file?
 

k1l

Senior Member
Nov 19, 2010
206
35
I built this yesterday using the instructions above... thanks a lot for those photonmedia!
Some of the instructions were wrong, ie a _ instead of a - in a dir name, but easy fixed.
After that, the entire build completed with 0 errors.
I didnt end up with a ZIP file though, just a approx 400MB "build-lineage_cepheus.ninja" file?

did you first
Code:
breakfast cepheus
and then
Code:
brunch cepheus
?


the .zip is actually in the
/out/target/product/cepheus/ folder.
 
Last edited:

MWPau

Senior Member
Mar 12, 2015
58
19
I did *exactly* as was instructed above...

Code:
cd ~/android/lineage
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
export USE_CCACHE=1
ccache -M 50G
source build/envsetup.sh 
brunch lineage_cepheus-userdebug
 
I did *exactly* as was instructed above...

Code:
cd ~/android/lineage
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
export USE_CCACHE=1
ccache -M 50G
source build/envsetup.sh 
brunch lineage_cepheus-userdebug

My understanding is that the breakfast command is not necessary when you are building for unofficial devices and manually populating the necessary device tree files; you skip to the brunch step.

That is per the other guide I referenced in my instructions and how I was able to build this release.

I have not tried to pull and build an updated version as of this time.
 

MWPau

Senior Member
Mar 12, 2015
58
19
For what it's worth, I just successfully compiled an updated build today, but it fails to boot after flashing. Had to go back and flash my 2020-01-25 build from the OP.
YMMV

Same for me. Have been trying to get it sorted the last few days, i dont know whats going on.
Original OP build works ok.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    ** Standard Disclaimer: Unlocking your Bootloader will Void your Warranty. I take no responsibility for this or for any bricked devices. These thing should go without saying at this point, but there they are. If you are here, I assume you are familiar with LineageOS, TWRP, and moving from MIUI to AOSP-based ROMs**

    **Download Link Updated to build 2020-07-10**


    TL;DR:
    This is a Clean, Stock LineageOS Build for Xiaomi Mi 9 (cepheus) that does NOT include any GApps, MicroG, or Signature Spoofing.
    What you choose to add/modify after installing this ROM is entirely up to you.

    All,
    I wanted to distance myself from Google as much as possible, so I decided to build LineageOS from the source.
    I used the LineageOS source they provide via GitHub, available here.
    I also use the Proprietary Blobs for the Cepheus Device Tree from Demon000's GitHub, available here.
    To get current version to build, I also needed to add the LineageOS/android_hardware_xiaomi source to my local manifest and use the repopicks Cozzymy13 includes in the OP of his ROM's thread. [Thanks k1l for and Cozzymy13 for pointing out these additions!]

    The result is a stock build of LineageOS 17.1 for the Cepheus device. In the spirit of LineageOS, this does not include Signature Spoofing. You will need to use Xposed or some other method if you desire that functionality.

    This also does not include MicroG or any other additional applications. This is pure LineageOS, built on 2020-07-10.

    NanoDroid patcher works well for anyone who wants to add MicroG support. You will still need to use Xposed or similar if you want Signature Spoofing as NanoDroid does not offer a patch for Android 10 as of this build.

    Feel free to provide download mirrors.

    What Works:
    Pretty much everything from what I can tell
    Fingerprint Sensor it working like a champ so far.
    DT2W/DT2S
    NFC Seems to be working but I don't have a device to test against

    Known Issues:
    You tell me...

    Install:
    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system


    Alternate Install Steps for Full MicroG with Signature Spoofing:
    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system (ignore any errors about missing Google Services)
    5) Reboot to TWRP
    6) Flash NanoDroid Patcher (either the Full package or you can customize per the instructions in the NanoIx link below)
    7) Reboot
    8) Install the Magisk Module for Xposed Framework and the EDXposed.ZIP as per the instructions in the Xposed link below)
    9) Reboot to activate the new Module
    10) Within the EDXposed App, Install the FakeGApps Module
    11) Reboot to activate the new Module


    As everything I really care about is working in this build, I do not plan to devote much, if any, time to "supporting" this release. I just thought I'd share my clean 17.1 LineageOS in case anyone else is interested.

    Download:
    LineageOS 17.1 Unofficial (Built: 2020-07-10) md5sum: 1c340fc16a6fbc7586d0a856acb9c600
    NanoDroid Patcher (optional): NanoIx
    Magisk Root (optional): Magisk
    XPosed for Android 10 - Magisk Module (optional): Xposed
    4
    It's working after root and Hide in Magisk Manager. I was confused because it was showing up as "Incomaptible with device" in google play store, after rooting it's installed. Thanks!
    Could you send commands which you used to compile ROM? I have some free space on my home server, maybe I could set up Jenkins with auto building. Is it possible to get auto update working?

    ThePiGuy already has a great overview of building for unsupported/unofficial devices here
    You'll need to install all the base requirements on your build distro before you proceed. This includes the adb and fastboot tools, the build packages, and the java versions as mentioned in this LineageOS build guide for one of their other Xiaomi "supported" devices.

    What I post here is basically my method of pulling the relevant info from the two build guides above to get a successful build for the Xiaomi Mi 9 (cepheus).

    I will say as for the Requirements, it really needs to be 16GB of RAM. I tried building in a VM with 8GB multiple times and it failed due to running out of memory. This could just be because I run on SSDs and do not use SWAP space/files...

    When it comes to your Proprietary Blobs, I pulled mine from Demon000's Github Source
    You will need these repos, and we will cover these steps further down:
    vendor_xiaomi
    kernel_xiaomi_sm8150
    device_xiaomi_cepheus
    device_xiaomi_sm8150_common

    When performing the "ccache -M $G" command I used:
    Code:
    ccache -M 50G

    Now let's create your base folder where you want to make all the magic happen. Be sure to have plenty of storage available. In my case, I needed about 200GB.
    Code:
    mkdir -p ~/android/lineage
    cd ~/android/lineage

    When performing your repo init commands, reference branch 17.1:
    Code:
    repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

    Sync the repo to your current working directory, in this case the lineage folder you created above (which should still be your working directory):
    Code:
    repo sync

    This will pull down 100+GB of files, so this takes quite some time.

    Following along, you should be in your folder called "lineage" where you ran your repo init and repo sync commands. In my case this is:
    Code:
    ~/android/lineage/

    Attached is my manifest file called "cepheus.xml" that references the Demon000 github source.
    Place this cepheus.xml file here:
    Code:
    ~/android/lineage/.repo/local_manifests/cepheus.xml
    (creating the local_manifests folder if necessary)

    Now you need to complete the build of your device tree.
    You will clone each of the four repositories above into their respective locations in the device tree:
    vendor_xiaomi -> ~/android/lineage/vendor/xiaomi/
    kernel_xiaomi_sm8150 -> ~/android/lineage/kernel/xiaomi/sm8150
    device_xiaomi_cepheus -> ~/android/lineage/device/xiaomi/cepheus
    device_xiaomi_sm8150_common -> ~/android/lineage/device/sm8150_common

    Note: Be sure to check each of those four locations and make sure the contents of the repository are in those folders, not, for example: ~/android/lineage/device/sm8150_common/device_xiaomi_sm8150_common. You don't want the repo contents within that extra subfolder...
    In my case, I created the necessary directory structure and changed to that directory, then cloned the repo and moved the contents from the subfolder created by the clone operation into the correct location.

    Code:
    mkdir -p ~/android/lineage/vendor/xiaomi/
    cd ~/android/lineage/vendor/xiaomi
    git clone https://github.com/Demon000/vendor_xiaomi.git
    mv vendor_xiaomi/* .
    rm -r vendor_xiaomi

    Code:
    mkdir -p ~/android/lineage/kernel/xiaomi/sm8150
    cd ~/android/lineage/kernel/xiaomi/sm8150
    git clone https://github.com/Demon000/kernel_xiaomi_sm8150.git
    mv kernel_xiaomi_sm8150/* .
    rm -r kernel_xiaomi_sm8150

    Code:
    mkdir -p ~/android/lineage/device/xiaomi/cepheus
    cd ~/android/lineage/device/xiaomi/cepheus
    git clone https://github.com/Demon000/device_xiaomi_cepheus.git
    mv device_xiaomi_cepheus/* .
    rm -r device_xiaomi_cepheus

    Code:
    mkdir -p ~/android/lineage/device/xiaomi/sm8150_common
    cd ~/android/lineage/device/xiaomi/sm8150_common
    git clone https://github.com/Demon000/device_xiaomi_sm8150_common.git
    mv device_xiaomi_sm8150_common/* .
    rm -r device_xiaomi_sm8150_common

    Now return to your base lineage folder:
    Code:
    cd ~/android/lineage

    Now that you have init'd and synced your repo and pulled your proprietary blobs into their respective folders, you are ready to build with the brunch command:
    Code:
    export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
    export USE_CCACHE=1
    ccache -M 50G
    source build/envsetup.sh 
    brunch lineage_cepheus-userdebug

    For me, I have no idea how long this took to complete as I left it running overnight. I would imaging at least 4 hours on my i5 device. Once it's done, you should have a TWRP-flashable zip and an OTA zip in the ~/android/lineage/out folder.

    Note: If after compiling for some time, the process fails with errors, it should provide you with information on how to track down the error. In my case, I ended up with it stopping with a failure a couple times, but I just re-ran the above brunch command and it picked up where it left off, eventually completing successfully. YMMV

    I'm sure there are cleaner, simpler ways of going about this, but I'm just getting my feet wet with current Android source. I haven't really done any sort of Android "development" since the days of KitKat...
    2
    BTW, to skip all the manual downloading of Demon000's device repo's, use this for your cepheus.xml local manifest:

    Code:
    <manifest>
        <project path="vendor/xiaomi" name="Demon000/vendor_xiaomi" remote="github" revision="lineage-17.1" />
        <project path="kernel/xiaomi/sm8150" name="Demon000/kernel_xiaomi_sm8150" remote="github" revision="lineage-17.1" />
        <project path="device/xiaomi/cepheus" name="Demon000/device_xiaomi_cepheus" remote="github" revision="lineage-17.1" />
        <project path="device/xiaomi/sm8150-common" name="Demon000/device_xiaomi_sm8150-common" remote="github" revision="lineage-17.1" />
    </manifest>

    "repo sync" will pull those down into the right locations.
    2
    That said, I cannot even get updated builds to compile using the Markakash or Demon000 sources that I used in the first couple of builds I did. And my day job and homestead upkeep in my "downtime" does not afford me much opportunity to look into issues.

    Look at the OP from Cozzmy13, he mentioned there what repos to use and what repopicks he uses. I stumbled over the hardware repo, too.
    1
    hello
    I am stuck at fastboot or bootloop after following the installation step
    I have tried several times here what I do
    boot to fastboot then flash TWRP_V3.4.0.0
    then reboot to recovery and Flash the VBMETA PATCHER
    then reboot to recovery and wipe data, cache, system then flash
    lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    if I reboot to system now I get bootloop on mi logo
    and if I did all the above with the extra step
    to Format Data then reboot to system
    i stuck in fastboot again and I have to unbrick with MiFlash &
    cepheus_global_images_V11.0.6.0.QFAMIXM_20200420.0000.00_10.0_global_01caf423db.gz
    I have tried three times till now
    first time was cumming from miui 12 global
    the other two from 11.0.6.0.QFAMIXM

    do I have to flash V11.0.2.0.QFAMIXM from fastboot or Recovery at first?

    You should be starting with your device running MIUI V11.0.6 if you have not yet run an AOSP-based ROM on it.

    Then you flash the VBMETA and TWRP both from Fastboot. I'm not sure of a VBMETA patcher that you would be flashing in TWRP.

    Once you flash both of those in FASTBOOT, then boot into TWRP and do a base Wipe Data.

    Flash the LineageOS build

    Then go BACK into Wipe Data in TWRP and click the "Format Data" button. This will then require you to type 'yes' to continue.
    If you miss this step, you WILL get bootloops.

    Now you should be able to reboot system.

    Install:
    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system