• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROM][8.1/9/10/11][Unofficial] LineageOS for Mi-4c/Mi-4s

Search This thread

ndonkersloot

Member
Jul 7, 2018
6
2
It's not needed to wipe any partition after flashing the firmware or recovery image. However, a factory reset is needed if you updated from a different custom ROM except my lineage-17.1 . The latest kernel image is optional, which may contain some new kernel changes after the latest ROM release.
It is working!
Thank you very much.

It is very cool to have a phone from 2015 with latest software.
 

sativasoul

Member
Jul 20, 2010
6
0
@WJXXBSH
Thanks for the ROM.
Right now I'm using your 18.1 Build with mindthegapps.
Almost everything works flawlessly.
Only for the GPS, I need to install a third-party app to easily lock the location.
I was using the GPS Test app to lock. The locking process also very fast using that app.
Another question, is this build make our mi4c hotter than 17.1?
Since I'm using this phone as a daily driver, could you help me to make it cooler? really don't need a faster phone, but just a normal phone but cooler. Is there a workaround for that?
Thanks again for your great job to make this phone still alive.
 

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
@WJXXBSH
Thanks for the ROM.
Right now I'm using your 18.1 Build with mindthegapps.
Almost everything works flawlessly.
Only for the GPS, I need to install a third-party app to easily lock the location.
I was using the GPS Test app to lock. The locking process also very fast using that app.
Another question, is this build make our mi4c hotter than 17.1?
Since I'm using this phone as a daily driver, could you help me to make it cooler? really don't need a faster phone, but just a normal phone but cooler. Is there a workaround for that?
Thanks again for your great job to make this phone still alive.
The GPS works well in Mainland China, no location or navigation problem happened.

Theoretically, lineage-18.1 should not be hotter than 17.1, as nothing about performance was changed (both of them use the same kernel). If you prefer a cooler device than high performance, don't enable the "High performance mode" in Battery Settings (if it's disabled, the max frequency of little cores should be 1440MHz rather than 1632MHz). Otherwise, there might be no available way to limit the performance, unless setting the maximum CPU frequency manually with root access. The thermal control mothed used currently is to limit the number of online CPU cores, which may not be efficient enough (but has less affect to performance) like the frequency limit in stock ROMs.
 
  • Like
Reactions: sativasoul

cstn

Member
Jul 29, 2007
29
2
@WJXXBSH
Thanks for the ROM.
Right now I'm using your 18.1 Build with mindthegapps.
Almost everything works flawlessly.
Only for the GPS, I need to install a third-party app to easily lock the location.
I was using the GPS Test app to lock. The locking process also very fast using that app.
Another question, is this build make our mi4c hotter than 17.1?
Since I'm using this phone as a daily driver, could you help me to make it cooler? really don't need a faster phone, but just a normal phone but cooler. Is there a workaround for that?
Thanks again for your great job to make this phone still alive.
if you do not care about the performance, the "3c all-in-one toolbox" or some app like this may help you, it can toggle almost every core of cpu online or offline manually. even you can manipulate cpu min_max frequency. this can decrease the power consmption and also performence, to get device cooler. (Root access needed)
 
  • Like
Reactions: sativasoul

sativasoul

Member
Jul 20, 2010
6
0
The GPS works well in Mainland China, no location or navigation problem happened.

Theoretically, lineage-18.1 should not be hotter than 17.1, as nothing about performance was changed (both of them use the same kernel). If you prefer a cooler device than high performance, don't enable the "High performance mode" in Battery Settings (if it's disabled, the max frequency of little cores should be 1440MHz rather than 1632MHz). Otherwise, there might be no available way to limit the performance, unless setting the maximum CPU frequency manually with root access. The thermal control mothed used currently is to limit the number of online CPU cores, which may not be efficient enough (but has less affect to performance) like the frequency limit in stock ROMs.
Thanks for the answer.
Anyway about the GPS in your 17.1 build work great. it can lock easily even when i was inside the home. in 18.1 even when i was outside it was very hard to lock.
many people do the factory reset and the GPS can works. Should i do that?
if i do that, can i back up all the app first (whatsapp, banking, etc)?
Sorry, im not well exprienced about all of this.
 

sativasoul

Member
Jul 20, 2010
6
0
if you do not care about the performance, the "3c all-in-one toolbox" or some app like this may help you, it can toggle almost every core of cpu online or offline manually. even you can manipulate cpu min_max frequency. this can decrease the power consmption and also performence, to get device cooler. (Root access needed)
ill try that apps too. thanks
 

neonzoff

Member
Sep 9, 2012
45
10
Vologda
I use lineage-17.1-20210615-UNOFFICIAL-EOL-libra.zip . When recording a voice message, not all messengers record from the microphone of wireless TWS headphones, for example, in telegram. And in those that allow you to record-the voice with two headphones is not heard at all - only a monotonous buzz and noise, and with one earphone-a voice like a robot.
When calling, the microphone works the same.
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
I use lineage-17.1-20210615-UNOFFICIAL-EOL-libra.zip . When recording a voice message, not all messengers record from the microphone of wireless TWS headphones, for example, in telegram. And in those that allow you to record-the voice with two headphones is not heard at all - only a monotonous buzz and noise, and with one earphone-a voice like a robot.
When calling, the microphone works the same.
I don't have a TWS Bluetooth earphone, so I cannot test it by myself. Some other users also reported some similar problems about TWS earphones. Did you check if your earphone works properly on MIUI or other ROMs?
 

neonzoff

Member
Sep 9, 2012
45
10
Vologda
I don't have a TWS Bluetooth earphone, so I cannot test it by myself. Some other users also reported some similar problems about TWS earphones. Did you check if your earphone works properly on MIUI or other ROMs?
Thanks for the reply. On MIUI, the android version is 7, and there is only SBC from the Bluetooth codecs, everything worked well in calls, but the music was very quiet, so I decided to install LOS. I tried 17.1 of your development and mokee 100, the problems are similar.
Then I tried 16.1 (by the way, I somehow managed to find at least one mirror and download it with a constant loss of speed to 0) and mokkee 90, the microphone began to work, but the sound quality from it is as if one of the two microphones (right) is working. Before that, I checked on the device of a friend with android 10 and MIUI - there the sound from the microphone was high-quality and ringing.
I didn't check LOS 18.1 or mokee 110.
 

gregory_cooky

Member
Mar 31, 2016
13
2
If anyone is interested in using MicroG (fully - some aps require to have MicroG installed as a system aps) on latest WJXXBSH's ROM (LOS 18.1). Do the following :
1. Delete all aps that will need GPlay services
2. Install only GMS Core apk (MicroG), no other modules
3. Install Magisk via TWRP (fully, after zip installation you need to reboot to the system, turn on access to the Internet and by tapping on Magisk icon finish full installation)
4. Install MircoG as a Magisk's module from the link

It works for me, hopefully for you, too. Maybe this is not the only way to install it, but this order was successful for me, so I didn't check other ways to achieve it.
 

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
Thanks for the reply. On MIUI, the android version is 7, and there is only SBC from the Bluetooth codecs, everything worked well in calls, but the music was very quiet, so I decided to install LOS. I tried 17.1 of your development and mokee 100, the problems are similar.
Then I tried 16.1 (by the way, I somehow managed to find at least one mirror and download it with a constant loss of speed to 0) and mokkee 90, the microphone began to work, but the sound quality from it is as if one of the two microphones (right) is working. Before that, I checked on the device of a friend with android 10 and MIUI - there the sound from the microphone was high-quality and ringing.
I didn't check LOS 18.1 or mokee 110.
If the TWS earphone doesn't work properly on MIUI ROMs and Android 9- custom ROMs, it could be a hardware problem (TWS earphone are popular years after Mi-4c launched). New device may support it properly, does your friend use a device launched after 2017?
 

neonzoff

Member
Sep 9, 2012
45
10
Vologda
If the TWS earphone doesn't work properly on MIUI ROMs and Android 9- custom ROMs, it could be a hardware problem (TWS earphone are popular years after Mi-4c launched). New device may support it properly, does your friend use a device launched after 2017?
Everything worked fine on MIUI, but the AAC codec appeared later on android 7. Therefore, there was only SBC, in which the sound in the headphones is very quiet.
On android 9, everything also works properly, but the microphone records the sound very muted.
Both devices on which I tested were released in 2021 and 2020, the sound from the microphones is good on them.
 

reenberg

Member
Jul 31, 2021
5
0
Finally got the time to move from the last xiaomi.eu v10.1.1.0 release to lineage-18.1-20210718 . woa, first impressions is smooth.

Install was however quite annoying. I found some of the pointers in the previous pages, hinting to remove the CJK fonts to get space for GApps.

I tried installing OpenGApps, and their pico versions won't fit when you just remove the CJK fonts, so you have to dig around trying to find stuff you won't need. I believe i ended up needing about 260mb of free space just to install the pico version.
Removing the WebView is a bad idea, as the Google setup wizard ends up using it (as far as I can read elsewhere). I experienced a black screen, which made it impossible to finish the setup. When I tried not removing the WebView, then it worked perfectly.
However I needed to spend way to much time trying to find other stuff to remove. I ended up removing all sorts of LineageOS apps, like the recorder, wallpaper (this obviously made the Trebuchet wallpaper change menu fail), and others - I dont entirely remember all of them anymore.

Hints to which GApps that will fit for 18.1, and what else to remove than CJK fonts would be nice in the first post. The notes about this seems quite outdated.

I'm not entirely sure if my battery is just old or if something else is going on. It seems to drain battery very fast, according to the old xiaomi.eu release I was running. However when it turns off, when battery is empty, and I plug it in a charger for 2 seconds, remove the charger and turn it on again, then it claims to have about 60% battery, and it will continue to work for quite some time before dying completely.

Everything seemed to work perfectly. But, after a few days of use, a few things suddenly stopped working:
  1. The settings menu used to have a search bar at the top, as seen on the following image. However I now just have a blank space of about 1-2cm and then it starts listing the Settings menus.

  2. It seems like the settings generally is missing things. settings -> system feels somewhat empty.
    And clicking on the build number a few hundred times doesn't trigger the developer options menu.
    I believe there should be a settings -> system -> buttons menu, but I cant find it. It generally seems like the "Advanved" dropdown is missing.

  3. Task switcher / recent apps no longer comes up when pressing the recents button. I feel the haptic feedback, so its not the button that is defective.

  4. Pulling down the notification curtain, it no longer shows any notifications. It says
    "No notifications", but I can hear the notification sound when they happen.
    And I can no longer pull it further down to expand the first row of toggles (wifi, phone data, etc).

  5. The power menu (when holding the power button for a few seconds) used to show Google Home and other "smart" apps, and suggest that I add smart devices to be toggled in there.

I'll try to see if a factory reset will do the trick.

Update: It did. All is now back to normal. The quetion now is just what I did to **** it up.
 
Last edited:

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
Finally got the time to move from the last xiaomi.eu v10.1.1.0 release to lineage-18.1-20210718 . woa, first impressions is smooth.

Install was however quite annoying. I found some of the pointers in the previous pages, hinting to remove the CJK fonts to get space for GApps.

I tried installing OpenGApps, and their pico versions won't fit when you just remove the CJK fonts, so you have to dig around trying to find stuff you won't need. I believe i ended up needing about 260mb of free space just to install the pico version.
Removing the WebView is a bad idea, as the Google setup wizard ends up using it (as far as I can read elsewhere). I experienced a black screen, which made it impossible to finish the setup. When I tried not removing the WebView, then it worked perfectly.
However I needed to spend way to much time trying to find other stuff to remove. I ended up removing all sorts of LineageOS apps, like the recorder, wallpaper (this obviously made the Trebuchet wallpaper change menu fail), and others - I dont entirely remember all of them anymore.

Hints to which GApps that will fit for 18.1, and what else to remove than CJK fonts would be nice in the first post. The notes about this seems quite outdated.

I'm not entirely sure if my battery is just old or if something else is going on. It seems to drain battery very fast, according to the old xiaomi.eu release I was running. However when it turns off, when battery is empty, and I plug it in a charger for 2 seconds, remove the charger and turn it on again, then it claims to have about 60% battery, and it will continue to work for quite some time before dying completely.

Everything seemed to work perfectly. But, after a few days of use, a few things suddenly stopped working:
  1. The settings menu used to have a search bar at the top, as seen on the following image. However I now just have a blank space of about 1-2cm and then it starts listing the Settings menus.

  2. It seems like the settings generally is missing things. settings -> system feels somewhat empty.
    And clicking on the build number a few hundred times doesn't trigger the developer options menu.
    I believe there should be a settings -> system -> buttons menu, but I cant find it. It generally seems like the "Advanved" dropdown is missing.

  3. Task switcher / recent apps no longer comes up when pressing the recents button. I feel the haptic feedback, so its not the button that is defective.

  4. Pulling down the notification curtain, it no longer shows any notifications. It says
    "No notifications", but I can hear the notification sound when they happen.
    And I can no longer pull it further down to expand the first row of toggles (wifi, phone data, etc).

  5. The power menu (when holding the power button for a few seconds) used to show Google Home and other "smart" apps, and suggest that I add smart devices to be toggled in there.

I'll try to see if a factory reset will do the trick.

Update: It did. All is now back to normal. The quetion now is just what I did to **** it up.
The problem you mentioned should be "Initial setup not finished". That's an old and common problem (exactly, a security feature) of Android. In such situations, you cannot expand quick settings, cannot open recent apps, besides have limited access to Settings. If you deleted too many basic apps from system (exactly, the LineageOS Setup Wizard), the initial setup may fail and cause the problem. For solutions, run the setup again or manually make your device provisioned using shell commands:
Code:
settings put secure user_setup_complete 1
settings put global device_provisioned 1
OpenGapps is surely a good choice, but you can still try BitGapps or other ones with less disk space requirement. Delete the prebuilt Webview package is an alternative to the font file, but only after installing a new version (or the same version) of Webview to "/data".
 
  • Like
Reactions: neonzoff

cstn

Member
Jul 29, 2007
29
2
the lastest lineageos-18.1-20210718-UNOFFICIAL-libra rom settings can not be open from the status/notification bar.

fully pulling down status bar, and touch the little settings icon on the right, it won't launch the settings, but flash black the screen, and reload the launcher.

normally touch the 'settings' icon to open from the home screen or the launcher is OK.
 

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
the lastest lineageos-18.1-20210718-UNOFFICIAL-libra rom settings can not be open from the status/notification bar.

fully pulling down status bar, and touch the little settings icon on the right, it won't launch the settings, but flash black the screen, and reload the launcher.

normally touch the 'settings' icon to open from the home screen or the launcher is OK.
I tested the setting icon on my device, but nothing wrong happened. Try clearing the data of "SystemUI" and reboot the system? Also, did you disable any components (eg. activities, services) of system apps?
 

cstn

Member
Jul 29, 2007
29
2
I tested the setting icon on my device, but nothing wrong happened. Try clearing the data of "SystemUI" and reboot the system? Also, did you disable any components (eg. activities, services) of system apps?
It must be kidding me! this bug on my device is not stable.

after i report the bug hours later, i suddenly found the settings can be open from the status bar normally.

but reboot the device, the bug will appear again, even after the screen flash black, appears a dialog:

System UI keeps stopping
App Info
Close app

clearing the data of SystemUI cannot fix the bug.
i don't disable any system apps, and i don't modify/delete any system files.

update: with wipe all data to factory and reinstall the rom, it seems can open the settings from the status bar. its a tiny issue, but it goes well now anyway.
 
Last edited:

Pastorious

Member
Feb 23, 2016
13
3
I have a situation with mounting internal sdcard under TWRP-3.3.1. Sometimes TWRP shows empty disk, somtimes shows my system(?) folder mounted under sdcard point. I have no ideal why. Simply can not install gapps. Only solution is formating all.
From Interent it is well know Internal Storage 0MB bug:
https://appuals.com/how-to-fix-twrp-unable-to-mount-storage-internal-storage-0mb/
Comments section is important - most reports concern Xiaomi devices.
Boot to TWRP after installation system ends always with broken filesystem on internal card
 
Last edited:

cstn

Member
Jul 29, 2007
29
2
i got the same issue.
install lineage-18.1-20210815-UNOFFICIAL-libra.zip will lost /data and /insternal_sdcard partition, whatever there's a screen pin lock or not.
have to formate /data partition to ext2 then formate it back to ext4, /internal_sdcard and /data will come back. but all private data in internal_sadcard will lost.
lineage-18.1-20210718-UNOFFICIAL-libra.zip is OK to use.
 

WJXXBSH

Senior Member
Dec 22, 2018
144
76
Xiaomi Mi 4C
Xiaomi Mi Mix 2
i got the same issue.
install lineage-18.1-20210815-UNOFFICIAL-libra.zip will lost /data and /insternal_sdcard partition, whatever there's a screen pin lock or not.
have to formate /data partition to ext2 then formate it back to ext4, /internal_sdcard and /data will come back. but all private data in internal_sadcard will lost.
lineage-18.1-20210718-UNOFFICIAL-libra.zip is OK to use.
Which version of TWRP are you using? My own device with TWRP-3.3.1.0 has no issue like what you said. It's no need to format "/data" to EXT2 then EXT4, just make sure your TWRP supports disk quota (which is newly introduced in 20210815, reason).
However, I'm only sure that F2FS will work properly in such situation, EXT4 is theoretically available for disk quota (not tested). If your "/data" partition was EXT4 when you installed lineage-18.1-20210815, could you try this TWRP image (unpack and flash it in fastboot, if your current TWRP cannot access "/data") to see if it works?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    DESCRIPTION
    Unofficial LineageOS ROMs for Mi-4c (libra) and Mi-4s (aqua), with base-layer enhancements and performance optimizations.
    Version 15.1/16.0/17.1/18.1 are available for download, version 18.1 are in active development.


    FEATURE
    The following items may not be available for all versions, please use the latest build!
    • Build with user variant instead of userdebug (to reduce image size and improve performance).
    • CPU/GPU is overclocked with optimized voltage/bus-cci and 300 Hz/Jiffies kernel clock frequency. [16.0 +]
    • EAS (sched cpufreq governor from linux-3.18) CPU scheduler implemented. [16.0 +]
    • Full-weight NotoSansCJK fonts included (to display East Asian characters with more font weights).
    • High screen refresh-rate (75 Hz) support for Mi-4c with "Sharp-rsp61322 LCD" screen. [16.0 +]
    • Implement ZRAM with ZSTD crypto algorithm (KSM is used after 20210116) to improve I/O performance on devices with 2GB RAM. [16.0 +]
    • Linux kernel is built by clang-12 toolchains, with Polly + LTO + -Ofast optimization to get better performance. [17.1 +]
    • Pre-dex2oat with everything filter globally (sacrificing space and first-install time to improve efficiency).
    • Remove or disable unnecessary kernel configs and modules, also includes some other optimizations. [16.0 +]
    • Remove unnecessary apps/binaries/libraries/services from Android framework and more. [16.0 +]
    • Signature spoofing support (ready for MicroG, including Chinese translations).
    • User-friendly controller for special features in Settings app (like CPU overclock, Edge gesture and Screen refresh rate). [17.1 +]
    • ...

    STATUS
    Go to GitHub Issues for more details and give me feedback.
    • Working
      • Basic hardware
        • Baseband/SMS
        • Bluetooth
        • Camera/Flashlight
        • IR remote
        • Speaker/Microphone
        • Wi-Fi
      • Extras
        • Camera API2 (with patch) [17.1 +]
        • Edge gesture (in Settings > System > Buttons) [16.0 +]
        • Overclock control (in Settings > Battery > Battery saver and performance) [17.1 +]
        • Screen refresh rate (in Settings > Display) [17.1 +]
    • Not working
      • SELinux permissive [16.0 +]
      • VOLTE (won't fix because of no compatible IMS stacks) [16.0 +]
      • WFD/ScreenCast/MiraCast (depreciated in AOSP after Android 9) [16.0 +]

    DOWNLOAD

    SOURCE

    Thanks to all developers and users (Gah0 | Mortezadadgar | Xiaomi classic dev | ...) who contributed to Mi-4c/Mi-4s (including other devices shipped with MSM8992/8994 SOC) or gave me help!
    6
    TIPS
    Here are some tips which may improve your experience or resolve some problems.
    • Basic quality assurance: I only have one smart phone (3+32GB Mi-4c ×1), so the ROMs here should at least satisfy my daily usage.
      • This project will be kept maintained even after I bought my new mobile phone (8+128GB Mi-Mix-2 ×1) in 2021. My Mi-4c is one of the most meaningful items of my own, it's not easy to leave it behind in the drawer and say goodbye. The new battery and rear cover (thanks to yipinghuang1991) will refresh this old device and make it usable again.
    • Even though the signal icon in status bar shows "No signal" at the first minute after boot, the device is still able to receive SMS and phone calls (so the device does have signal, but the system doesn't admit it at all).
    • If the free space in /system is not enough to install GAPPs, try to delete /system/fonts/NotoSansCJK.ttc to get about 100MB free space (If Chinese/Japanese/Korean is not your main language). Removing the prebuilt Webview packages (about 120MB) after installed another one is also a solution.
    • If you found random reboot on your device with overclock enabled (or just updated to lineage-17.1-20201216 and left overclock option unchanged), please disable this feature to see if this issue is resolved. Go to Settings > System > Battery > Battery saver and performance, enable then disable "High performance mode", and reboot your device. If you are using lineage-17.1-20210209 or newer, it's no need to do such steps after a clean install (as both persist.sys.cpu_overclock and persist.vendor.edge_touch_mode are default to false by default).
    • It's highly recommended to disable system logs to reduce resource consumption (for better performance and privacy), unless you're going to collect system logs. Go to Settings > System > Developer options, and set the value of "Logger buffer sizes" to off.
    • It's not recommended to use SELinux enforcing mode even if it's supported in some builds. Also, please consider the negative effect of I/O performance before enabling disk encryption, unless you really want to.
    • You could download the latest (or nightly) kernel image for Mi-4c/4s (packed with AnyKernel3) on GitHub Releases or AFH. Different from the boot image (boot.img), AnyKernel3 will replace old kernel in device regardless of the ROM version. Therefore, this new kernel image is suitable for lineage-16.0/17.1/18.1, and 14.1/15.1 (may need to modify the init scripts to change CPU scheduler, as interactive has been replaced by sched). For installation, just flash the zip file aqua+libra-AnyKernel3-date-commit.zip in recovery like other custom kernels and ROMs.

    BUILD
    As all source codes and custom changes in my LineageOS ROMs are open-source, you are permitted to build your own ROM or kernel (not only for LineageOS) with my sources for non-commercial purpose.

    There are many documents about how to build custom Android ROMs in Linux/OSX, so I will not post these basic steps here to reduce redundancy. However, there are still some important things which may not be included in other documents. Here are some basic steps about what you should do (using lineage-17.1 as example), you can also take a reference to other tutorials.
    • Install necessary packages
      • There are a number of "necessary" packages listed in most tutorials, but not all of them are needed. Here are the packages you need to install manually on Ubuntu or Debian.
        • Necessary packages: sudo apt install bc bison git gnupg make rsync unzip zip
        • Optional packages: sudo apt install ccache repo
        • It's optional to install and setup ccache to reduce build time.
        • As libncurses5 is needed by some components, you should either install it (not recommend) or make symlinks to libncurses6 (which has been installed by default) like this: libncurses.so.5 -> libncurses.so.6 + libncursesw.so.5 -> libncursesw.so.6 + libtinfo.so.5 -> libtinfo.so.6
    • Sync Android sources
      • You need to download and update your local repo with upstream sources regularly, in order to get new changes as soon as possible (just like other open-source projects).
        • Init repo to current directory: repo init -u https://github.com/LineageOS/android.git -b lineage-17.1 --depth=1
        • Sync all repos and prune unused branches: repo sync --prune
      • If nothing wrong happened, the LineageOS sources have been downloaded to your computer (about 100GB). Here are some commands which might be useful in the future.
        • Show all local changes of your repos: repo status or repo diff
        • Perform any operations to all repos: repo forall -c "xxx"
    • Setup local manifest
      • To sync your Android sources with upstream repos easily, it's recommended to create a local manifest in ./repo/local_manifests/. The local manifest should be a XML file like the following one, any filename is accepted (file: libra.xml).
        XML:
        <?xml version="1.0" encoding="UTF-8"?>
        <manifest>
          <project name="BYZYB/android_device_xiaomi_libra" path="device/xiaomi/libra" remote="github" revision="lineage-17.1" />
          <project name="BYZYB/android_kernel_xiaomi_libra" path="kernel/xiaomi/libra" remote="github" revision="master" />
          <project name="BYZYB/android_vendor_xiaomi_libra" path="vendor/xiaomi/libra" remote="github" revision="lineage-16.0" />
          <project name="LineageOS/android_hardware_sony_timekeep" path="hardware/sony/timekeep" remote="github" revision="lineage-17.1" />
          <project name="LineageOS/android_hardware_xiaomi" path="hardware/xiaomi" remote="github" revision="lineage-17.1" />
        </manifest>
    • Resolve build errors
      • Due to some hacks in my device configurations which are conflict with Android build rules, there might be some build errors if using all my repos directly. To resolve this issue, you need to modify project build/make/manually on your disk. After that, you should be able to prepare the necessary environment for Android build without errors.
        • Setup build namespace only: . build/envsetup.sh
        • Prepare build environment for Mi-4c with a specified build variant (xxx = eng/userdebug/user): . build/envsetup.sh && lunch lineage_libra-xxx
      • If you want to build the ROM in "user" build variant instead of the default "userdebug", more changes are needed to avoid build errors or potential bootloop. The following commands are some ways to build a full ROM.
        • Build full ROM in "user" variant: brunch lineage_libra-user
        • Build full ROM in "userdebug" variant: brunch lineage_libra-userdebug
        • Build full ROM with a specified number of threads (x ≤ physical CPU cores): lunch lineage_libra-xxx && make -jx
        • If you have lunch before, here is the simplest way: m
      • As git patch files are similar to git diff, you can always do these changes manually without using git am xxx.patch && git reset HEAD^ or other shell commands.
    • Kernel build toolchains
      • The kernel supports to be built with gcc-9+ or clang-10+. As Link-Time-Optimization (LTO) for Clang is enabled by default (config: CONFIG_LTO_CLANG), building the kernel with GCC directly will result in build errors. In conclusion, it's recommended to choose Clang as your toolchains for both faster build speed and better performance.
      • As VDSO compat is enabled (config: CONFIG_COMPAT_VDSO), both arm and arm64 toolchains are needed to build the kernel. Clang could handle different cross compile targets easily (thanks to LLVM), but GCC could not. Also, though the kernel sources are compiled by clang, they will be linked by LD (included in GCC toolchains -> Binutils) with LLVM plugins. In conclusion, if the ROM you are building provides legacy gcc-4.9 toolchains, it should be safe to go ahead without installing GCC toolchains or Binutils. Otherwise, you need to install both Binutils and Clang packages in your computer to avoid build problems.
      • After 8/15/2021 (commit d4f4eb9), it's now possible to link the kernel with ld.lld and the integrated assembler of LLVM. Combined with LTO, ld.lld could reduce the size of kernel image (-1MB) with no performance impact.
      • If you are using Ubuntu or Debian on your computer, please install the following packages.
        • For Ubuntu or Debian: sudo apt install clang llvm-dev
        • For ROMs without legacy gcc-4.9 toolchains: sudo apt install binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf
      • Then you should be able to build the kernel without modifying build configs.
        • Build kernel image only: make bootimage
        • Build recovery image only: make recoveryimage
    • Apply custom changes (optional)
    2
    Thanks for the fast reply. So it's not possible to disable the pop up without updating to LineageOS 17? It's not a big issue but I want to be sure.

    Technically, yes. We cannot get rid of the pop-ups unless disabling permission review. You may try to decompile framework-res.apk (or generate a RRO overlay to override default configs), find "config_permissionReviewRequired" in "res/values/config.xml" and set it to "false".
    2
    :good: :victory: Finally, my phone do no longer randomly reboots.
    I reduced the speed to around 144k with a root app called "CpuSpeed". Thanks for the important note!

    If CPU/GPU overclock is the reason that caused random reboot (it's surely possible), it means the CPU (or msm8992 SOC) in some devices has different hardware quality than others (just as the screen: only some of them support 75Hz refresh rate, others will stop working). That's why this problem doesn't happens to all Mi-4c/4s (My device doesn't reboot even when overclocking the big cores to 1.8GHz).
    1
    Finally got the time to move from the last xiaomi.eu v10.1.1.0 release to lineage-18.1-20210718 . woa, first impressions is smooth.

    Install was however quite annoying. I found some of the pointers in the previous pages, hinting to remove the CJK fonts to get space for GApps.

    I tried installing OpenGApps, and their pico versions won't fit when you just remove the CJK fonts, so you have to dig around trying to find stuff you won't need. I believe i ended up needing about 260mb of free space just to install the pico version.
    Removing the WebView is a bad idea, as the Google setup wizard ends up using it (as far as I can read elsewhere). I experienced a black screen, which made it impossible to finish the setup. When I tried not removing the WebView, then it worked perfectly.
    However I needed to spend way to much time trying to find other stuff to remove. I ended up removing all sorts of LineageOS apps, like the recorder, wallpaper (this obviously made the Trebuchet wallpaper change menu fail), and others - I dont entirely remember all of them anymore.

    Hints to which GApps that will fit for 18.1, and what else to remove than CJK fonts would be nice in the first post. The notes about this seems quite outdated.

    I'm not entirely sure if my battery is just old or if something else is going on. It seems to drain battery very fast, according to the old xiaomi.eu release I was running. However when it turns off, when battery is empty, and I plug it in a charger for 2 seconds, remove the charger and turn it on again, then it claims to have about 60% battery, and it will continue to work for quite some time before dying completely.

    Everything seemed to work perfectly. But, after a few days of use, a few things suddenly stopped working:
    1. The settings menu used to have a search bar at the top, as seen on the following image. However I now just have a blank space of about 1-2cm and then it starts listing the Settings menus.

    2. It seems like the settings generally is missing things. settings -> system feels somewhat empty.
      And clicking on the build number a few hundred times doesn't trigger the developer options menu.
      I believe there should be a settings -> system -> buttons menu, but I cant find it. It generally seems like the "Advanved" dropdown is missing.

    3. Task switcher / recent apps no longer comes up when pressing the recents button. I feel the haptic feedback, so its not the button that is defective.

    4. Pulling down the notification curtain, it no longer shows any notifications. It says
      "No notifications", but I can hear the notification sound when they happen.
      And I can no longer pull it further down to expand the first row of toggles (wifi, phone data, etc).

    5. The power menu (when holding the power button for a few seconds) used to show Google Home and other "smart" apps, and suggest that I add smart devices to be toggled in there.

    I'll try to see if a factory reset will do the trick.

    Update: It did. All is now back to normal. The quetion now is just what I did to **** it up.
    The problem you mentioned should be "Initial setup not finished". That's an old and common problem (exactly, a security feature) of Android. In such situations, you cannot expand quick settings, cannot open recent apps, besides have limited access to Settings. If you deleted too many basic apps from system (exactly, the LineageOS Setup Wizard), the initial setup may fail and cause the problem. For solutions, run the setup again or manually make your device provisioned using shell commands:
    Code:
    settings put secure user_setup_complete 1
    settings put global device_provisioned 1
    OpenGapps is surely a good choice, but you can still try BitGapps or other ones with less disk space requirement. Delete the prebuilt Webview package is an alternative to the font file, but only after installing a new version (or the same version) of Webview to "/data".