Fairphone 4 - Kernel Source CodeΒΆ

Here you can find instructions on how to download and compile the version of the Linux kernel used in the Fairphone 4.

The sources are available on our public Gerrit on git branch kernel/13/fp4 (for Android 12: kernel/12/fp4, for Android 11: kernel/11/fp4).

As the sources are split over multiple git repositories, we have prepared a repo manifest so you can compile the kernel and its modules outside of the Android build system.


You need the repo tool from Google. To install repo, follow the instructions on the AOSP website.

You will also need to install the Clang/LLVM toolchain on your host system. Any version between clang 10 and clang 15 should work correctly.

# Initialize the local repository
mkdir fp4-kernel && cd fp4-kernel
repo init -u https://gerrit-public.fairphone.software/manifest -b kernel/13/fp4
# Download the sources
repo sync --detach --current-branch --no-tags

Next you can compile your kernel using the following commands:

cd kernel/msm-4.19
export ARCH=arm64; export CROSS_COMPILE=aarch64-linux-gnu-
export KBUILD_OUTPUT=build
# Choose either fp4-perf_defconfig (release mode)...
make CC=clang LLVM=1 vendor/fp4-perf_defconfig
# ... or fp4_defconfig (debug mode)
make CC=clang LLVM=1 vendor/fp4_defconfig
# Finally compile the kernel
make CC=clang LLVM=1 -j$(nproc)

You will find the compiled kernel in build/arch/arm64/boot/Image.

You can find full flashable images at Installing Fairphone OS Manually.

Only applies to kernel/11/fp4 branch: Additionally please note, that the stock Android image currently does not support having the WLAN driver built-in (CONFIG_QCA_CLD_WLAN=y) and Wi-Fi will not work in Android unless you trigger starting the WLAN driver manually using echo 1 > /sys/kernel/boot_wlan/boot_wlan.