
Which separates the kernel into a Google-maintained kernel image and vendor maintained-modules, To build that kernel's modules, use this buildĬonfiguration: BUILD_CONFIG=common-modules/virtual-device/_device.x86_64 build/build.sh
#Android linux kernel android#
In Android 12 Cuttlefish and Goldfish converge, so they share Building the Vendor Modules for the Virtual Device with build.sh (legacy) Kleaf - Building Android Kernels with Bazel.įor details on Kleaf support for individual architectures, see Tools/bazel run //common-modules/virtual-device:virtual_device_x86_64_dist -dist_dir= $DIST_DIRįor more details on building Android kernels with Bazel, see. Tools/bazel build //common-modules/virtual-device:virtual_device_x86_64_dist To build the virtual_device's modules, run: Building the Vendor Modules for the Virtual Device The kernel binary, modules, and corresponding image are located in the Platform, run: $ BUILD_CONFIG=common/64 build/build.sh For example, to build the GKI kernel for the aarch64
#Android linux kernel how to#
Kernel build to find out how to specify the build configuration forĬommon kernels. For details, refer to theīuild.sh is not supported on Android 14 (AOSP experimental) and above.Ĭommon kernels are generic, customizable kernels and therefore don't defineĪ default configuration. Of the command for the location of the artifacts. Thereafter the kernel binary, modules, and corresponding images are located in the Tools/bazel run //common:kernel_aarch64_dist -dist_dir= $DIST_DIR Tools/bazel build //common:kernel_aarch64_dist To build the GKI kernel for the aarch64 architecture, check outĪn Android Common Kernel branch no earlier than Android 13 and To identify when you can use Kleaf to build a kernel, and build instructions andĪndroid 13 introduced building kernels with $ repo init -b common-android-mainline & repo sync.īuilding the kernel Building with Bazel (Kleaf) Note: For example, to switch toĬommon-android-mainline from your existing Repo checkout, Switching to a different branch is similar to initializing a branch the To be cloned fully (not shallow), which enables fast switching among them. TheĬommon kernel manifests (and most others) define the kernel git repository You can switch among different branches within one Repo checkout. Pixel 3 (blueline) Pixel 3 XL (crosshatch) Pixel 5a (barbet) Pixel 5 (redfin) Pixel 4a (5G) (bramble) The following table lists the BRANCH names for kernels available Using the repo approach ensures a correct sourceĭownload the sources for the appropriate branch: mkdir android-kernel & cd android-kernel repo init -u -b BRANCH repo sync Repositories, while others (for example, the common kernels) require only a single Some kernels (for example, the Pixel 3 kernels) require sources from multiple git
#Android linux kernel download#
To download the sources, toolchain, and build scripts.

The kernel trees contain the kernel sources and all tools to build The Android tree contains only prebuilt kernelīinaries. Note: The root of the kernel source checkout containsīuild/build.sh. You can acquire more recent kernel sources by usingĬonfiguration by running build/build.sh from the root of your Sources, building the kernel, and embedding the results into a system imageīuilt from the Android Open Source Project (AOSP). Instructions guide you through the process of selecting the right This page details the process of building custom
