Welcome! This is a guide on how to build a LineageOS ROM for POCO F3, with KernelSU-Next and SUSFS built-in!
I'll go over the general approach and cover some hurdles I encountered during the process. There's also some patches included, specifically to make KernelSU-Next and SUSFS work together nicely on a non-GKI kernel.
Tip
You can try out a precompiled version if you're so keen. No guarantees!
I won't delve into bootloader unlocking and general custom ROM flashing too much; there's already good resources on this out there.
If you're new to this, unlocking the bootloader for this phone is notoriously hard. One tool which helped me is HyperSploit, so you might want to take a look at it!
After that, a good starting point is just to try and install the regular, prebuilt LineageOS ROM. You can follow the official guide here.
As per LineageOS official guidelines, I used Ubuntu 24 LTS for my build machine. This is a VirtualBox guest inside of a Windows 10 host.
I allocated 32GB of RAM to the VM, but it wasn't enough. I had to add a 16GB swap file, and enable 16GB of ZRAM. I used a 100GB compiler cache.
Additionally, these may be of help:
We mostly rely on the LineageOS build guide. I recommend going through it completely, building the vanilla LineageOS ROM and installing it. This will help you understand the process and also verify that your phone works as it should.
In any case, the rest of the steps in this guide are done before starting the actual build (Start the build). Make sure you have the whole LineageOS build environment set-up, including the kernel and proprietary blobs.
Tip
We'll do the patching after we set everything else up. I left notes on how I did it manually, if you're interested!
Follow the official build page and set up the driver inside the kernel source tree.
Note
How I did it
KernelSU-Next does support non-GKI kernels, but it's not entirely clear from the docs what the exact steps are to enable this. Follow the KernelSU page on integrating with non-GKI kernels. Ignore the kprobes
section and just follow the stuff under Manually modify the kernel source
, including modyfing the code. You should add CONFIG_KSU=y
to <KERNEL_ROOT>/arch/arm64/configs/vendor/xiaomi/alioth.config
.
SUSFS has an official branch for our exact kernel version, 4.19! Clone that branch anywhere and follow steps 4 and 5 under - Apply SUSFS patches -
.
Note
How I did it
Unfortunately, the patches in the repo are tailored towards KernelSU, so there's a lot of confusion and failed patching involved. The kernel patch mostly works fine, but the KernelSU patch is problematic. Fixing this isn't too complicated, but it is time-consuming. I went through the patches and just manually merged the changes as needed.
Now, simply download our combined patch into the root kernel directory, and run patch -p1 < [PATCH_FILE]
!
Continue with the LineageOS build guide at Start the build.
The build took around 2 to 3 hours on my machine.
If you encounter any errors, unfortunately, there's no particular tips which I can put into this doc. Every error that I encountered was pretty specific, due to manual code modification.
Using your fresh, newly-built files, continue following the LineageOS installation guide. Note that you don't have to do a factory reset if you already have LineageOS installed.
This is (I think) the bare minimum you should install post-flash (specific tested versions included):
- KernelSU-Next Manager Spoofed v1.1.1
- ReZygisk v1.0.0-rc.3 Release
- LSPosed 1.9.2 Zygisk
- SUSFS module v1.5.2+ Revision 21
That's it! Everything should be working nice and up and running!