These instructions are written for and tested on Debian Bullseye and Ubuntu 20.04, but should be straightforward to adapt to other Linux distributions. Building on Mac or Windows has not been tested and is not currently supported.
To create a viable custom kernel for Android, first install the dependencies:
The next steps depend on the version of Android you're after.
1. Clone the common kernel repository and checkout commit hash 0566f6529a7b8d15d8ff50797331717b346f9aa4
.
2. Download this patch and save it to $COMMON_CHECKOUT
:
3. Apply the patch with:
4. Download this tarball and save it to $COMMON_CHECKOUT:
5. Extract the tarball to the correct directory from the $COMMON_CHECKOUT
location:
6. Save this file to $COMMON_CHECKOUT/arch/arm64/configs/corellium_defconfig.
1. Clone the common kernel repository and checkout the android11-5.4.161_r00
tag.
2. Download this patch and save it to $COMMON_CHECKOUT
:
3. Apply the patch with:
4. Download this tarball and save it to $COMMON_CHECKOUT
:
5. Extract the tarball to the correct directory from the $COMMON_CHECKOUT
location:
6. Save this file to $COMMON_CHECKOUT/arch/arm64/configs/corellium_defconfig
.
1. Clone the common kernel repository and checkout the android12-5.10.81_r00
tag.
2. Download this patch and save it to $COMMON_CHECKOUT
:
3. Apply the patch with:
4. Download this tarball and save it to $COMMON_CHECKOUT
:
5. Extract the tarball to the correct directory from the $COMMON_CHECKOUT
location:
6. Save this file to $COMMON_CHECKOUT/arch/arm64/configs/corellium_defconfig
.
1. Clone the common kernel repository and checkout the android13-5.15-2022-08_r6
tag.
2. Download this patch and save it to $COMMON_CHECKOUT
:
3. Apply the patch with:
4. Download this tarball and save it to $COMMON_CHECKOUT
:
5. Extract the tarball to the correct directory from the $COMMON_CHECKOUT
location:
6. Save this file to $COMMON_CHECKOUT/arch/arm64/configs/corellium_defconfig
.
For portability, build the kernel inside a Docker container.
To build the kernel image use the following:
Once the build is finished, a usable kernel image is found in your checkout directory under arch/arm64/boot/Image
. It is recommended to first test the default-configured kernel image on the respective Android device version to ensure the build was successful before making changes to the kernel.
Rebuild the kernel image with your changes by running:
Kernels compiled from physical devices and uploaded a Corellium virtual device will not work. This is because Corellium only supports a specific chipset and hardware configuration.
Experience Corellium’s groundbreaking virtualization technology for mobile devices and discover never-before-possible mobile vulnerability and threat research for iOS and Android phones. Set up a meeting today to explore how our platform can optimize mobile security research and malware analysis.