{"id":34774578,"url":"https://github.com/azagramac/build-kernel-aosp-pixel","last_synced_at":"2026-04-19T21:06:38.389Z","repository":{"id":324060021,"uuid":"1095791552","full_name":"azagramac/build-kernel-aosp-pixel","owner":"azagramac","description":"Automated workflow to build AOSP kernels for Google Pixel devices","archived":false,"fork":false,"pushed_at":"2025-11-24T10:56:11.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-13T19:22:24.788Z","etag":null,"topics":["aosp","aosp-android","aosp-kernel","github-actions","google","kernel","lineageos","lineageos-devices","lineageos-kernel","linux","pixel","workflows"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azagramac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-13T14:23:49.000Z","updated_at":"2025-12-16T18:35:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/azagramac/build-kernel-aosp-pixel","commit_stats":null,"previous_names":["azagramac/kernel-google-lineageos","azagramac/build-kernel-aosp-pixel"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/azagramac/build-kernel-aosp-pixel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azagramac%2Fbuild-kernel-aosp-pixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azagramac%2Fbuild-kernel-aosp-pixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azagramac%2Fbuild-kernel-aosp-pixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azagramac%2Fbuild-kernel-aosp-pixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azagramac","download_url":"https://codeload.github.com/azagramac/build-kernel-aosp-pixel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azagramac%2Fbuild-kernel-aosp-pixel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32022579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aosp","aosp-android","aosp-kernel","github-actions","google","kernel","lineageos","lineageos-devices","lineageos-kernel","linux","pixel","workflows"],"created_at":"2025-12-25T08:13:16.109Z","updated_at":"2026-04-19T21:06:38.348Z","avatar_url":"https://github.com/azagramac.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"#### The Android kernel is based on an upstream Linux [Long Term Supported (LTS) kernel](https://www.kernel.org/category/lts). At Google, LTS kernels are combined with Android-specific patches to form Android Common Kernels (ACKs).\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"350\" alt=\"android-logo\" src=\"https://github.com/user-attachments/assets/b6fe1a38-1c8d-4421-82eb-6fba2631fbf9\" /\u003e\n\u003c/div\u003e\n\n\nACKs that are 5.10 and higher are also known as *generic kernel images (GKI) kernels. GKI kernels support the separation of the hardware-agnostic generic core kernel code and GKI modules from hardware-specific vendor modules.\n\nThe interaction between the GKI kernel and vendor modules is enabled by the Kernel Module Interface (KMI) consisting of symbol lists identifying the functions and global data required by vendor modules. Figure 1 shows the GKI kernel and vendor module architecture:\n\nGKI kernel and vendor module architecture.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"450\" alt=\"aosp-kernel\" src=\"https://github.com/user-attachments/assets/078f4481-7d68-441f-8fff-6ef8826ae5b2\" /\u003e\n\u003c/div\u003e\n\nFigure 1. GKI kernel and vendor module architecture.\n\n💡 Notes:\n\u003e Note: The GKI kernel, GKI module, and vendor module architecture is the result of a multi-year effort known as the Generic Kernel Image (GKI) project. For information about this project and its phases, refer to The Generic Kernel Image (GKI) project.\n\u003e Note: Kernels are referred to by their platform version followed by a kernel version. For example, android15-6.6 is kernel for Android 15 with a version of 6.6.\n\n### Kernel glossary\nFollowing are terms used throughout the kernel documentation.\n\n### Kernel types\n#### Android Common Kernel (ACK)\nA kernel that is downstream of a LTS kernel and includes patches that are important to the Android community. These patches haven't been merged into Linux mainline or Long Term GKI kernels.\nKernel with versions of 5.10 and higher are also referred to as [Generic Kernel Image (GKI)](https://source.android.com/docs/core/architecture/kernel#gkik) kernels.\n\n#### Android Open Source Project (AOSP) kernel\nSee [Android Common Kernel](https://source.android.com/docs/core/architecture/kernel#ack).\n\nAndroid 12 features can't be backported to 4.19 kernels; the feature set would be similar to a device that launched with 4.19 on Android 11 and upgraded to Android 12.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"500\" alt=\"aosp-architecture\" src=\"https://github.com/user-attachments/assets/799744d5-4feb-45cf-a7f4-c1a2d04c99ff\" /\u003e\n\u003c/div\u003e\n\nFigure 2. AOSP Architecture\n\n#### Generic Kernel Image (GKI) kernel\nAny 5.10 and higher ACK kernel(aarch64 only). The GKI kernel has these two parts:\n\n- Generic kernel - The portion of the GKI kernel that is common across all devices.\n- GKI modules - Kernel modules built by Google that can be dynamically loaded on devices where applicable. These modules are built as artifacts of the GKI kernel and are delivered alongside GKI as the `system_dlkm_staging_archive.tar.gz` archive. GKI modules are signed by Google using the kernel build time key pair and are compatible only with the GKI kernel that they're built with.\n\n#### Kernel Module Interface (KMI) kernel\nSee [GKI kernel](https://source.android.com/docs/core/architecture/kernel#gkik).\n\n#### Long Term Supported (LTS) kernel\nA Linux kernel that's supported for 2 to 6 years. LTS kernels are released once per year and are the basis for each of Google's Android Common Kernels.\n\n### Branch types\n#### ACK KMI kernel branch\nThe branch for which GKI kernels are built. Branch names correspond to kernel versions, such as `android15-6.6`.\n\n#### Android-mainline\nThe primary development branch for Android features. When a new LTS kernel is declared upstream, the corresponding new GKI kernelGKI kernel is branched from android-mainline.\nLinux mainline :The primary development branch for the upstream Linux kernels, including LTS kernels.\n\n### Other terms\n#### Certified boot image\nThe kernel delivered in binary form `boot.img` and flashed onto the device. This image is considered certified because contains embedded certificates so Google can verify that the device ships with a kernel certified by Google.\n\n#### Dynamically loadable kernel module (DLKM)\nA module that can be dynamically loaded during device boot depending on the needs of the device. GKI and vendor modules are both types of DLKMs. DLKMs are released in `.ko` form and can be drivers or can deliver other kernel functionality.\n\n#### GKI project\nA Google project addressing kernel fragmentation by separating common core kernel functionality from vendor-specific SoC and board support into loadable modules.\n\n💡 Notes:\n\u003e Generic Kernel Image (GKI): A boot image certified by Google that contains a GKI kernel built from an ACK source tree and is suitable to be flashed to the boot partition of an Android-powered device.\n\n#### Kernel Module Interface (KMI)\nAn interface between the GKI kernel and vendor modules allowing vendor modules to be updated independently of the GKI kernel. This interface consists of kernel functions and global data that have been identified as vendor/OEM dependencies using per-partner symbol lists.\nVendor module\nA hardware-specific module developed by a partner and that contains SoC and device-specific functionality. A vendor module is a type of dynamically loadable kernel module\n\n---\n\n### 🌰 Build custom kernel\n\nEnter the [GitHub Actions workflow](https://github.com/azagramac/build-kernel-aosp-pixel/actions/workflows/build-kernel.yml)\n\n\u003cimg width=\"250\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e7f3144a-9984-49cb-88a9-84a262d1d599\" /\u003e\n\nSelect codename device, build mode, and LTO mode.\n\n| LTO Mode | Global Optimization | kCFI Compatibility | Build Time | Memory Usage | Typical Use                          |\n| -------- | ------------------- | ------------------ | ---------- | ------------ | ------------------------------------ |\n| none     | No                  | ❌ No               | Very fast  | Low          | Debug / development                  |\n| thin     | Partial / fast      | ✅ Yes              | Moderate   | Moderate     | Recommended for Android builds       |\n| full     | Full                | ✅ Yes              | Slow       | High         | Release builds / maximum performance |\n\n💡 Notes:\n\u003e * For AOSP / LineageOS, Pixel kernel builds where you want security (kCFI) and reasonable build times, use **`lto=thin`**.\n\u003e * You would only use **`lto=full`** if you want to maximize kernel performance and don’t mind longer build times.\n\n\nArtifacts are available on [GitHub Releases](https://github.com/azagramac/build-kernel-aosp-pixel/releases)\n\n---\n#### 🖼 Kernel \u0026 Image files overview\n\nWhen building a custom Android kernel, several images are generated. Here’s a breakdown of the main images and their purpose:\n\n| Image               | Description                                                                                                         | How it’s generated                                                                              |\n| ------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |\n| `boot.img`        | Contains the **kernel** and **boot ramdisk** (initramfs for platform boot). This is used for platform startup.      | Generated by `make bootimage` or `build_\u003ccodename\u003e.sh`                                          |\n| `vendor_kernel_boot.img` | Contains **vendor kernel**, **vendor initramfs** (initramfs for vendor boot), optional **DTB**, and vendor modules. | Generated by AOSP with `TARGET_BOOTIMAGE_TARGETS=vendor_bootimage` or `build_\u003ccodename\u003e.sh`     |\n| `vdtb.img`         | Flattened **Device Tree Blob** for the kernel. Defines hardware configuration.                                      | Extracted from compiled kernel (`arch/arm64/boot/dts/vendor/*.dtb`) or generated via `mkdtb.py` |\n| `dtbo.img`        | **Device Tree Overlay** for modular SoC configuration. Allows optional hardware/board overlays.                     | Generated from DT overlay source: `dtc -I dts -O dtb dtbo_*.dts -o dtbo.img`                    |\n| `vendor_dlkm.img` | Vendor dynamically loadable kernel modules (DLKMs). Modules loaded by vendor boot.                                  | Built as part of GKI vendor modules in AOSP (`out/\u003ccodename\u003e/obj/vendor_dlkm`)                  |\n| `system_dlkm.img` | GKI modules shipped to system partition. Modules loaded by generic kernel.                                          | Built as part of GKI system modules (`out/\u003ccodename\u003e/obj/system_dlkm`)                          |\n\n💡 Notes:\n\u003e Note: `initramfs.img` is embedded inside `boot.img` (platform) and `vendor_boot.img` (vendor). You do not flash it separately.\n\n---\n\n### 📱 Flash custom kernel\n\n##### If you haven't disabled verification, you need to do it before flashing the custom kernel. Here is the command to do so:\n```bash\nfastboot oem disable-verification\n```\n\n##### ⚠️ Wipe device (if flashing on top of a platform build)\nThen you may need to wipe your device if there is a security patch level (SPL) downgrade associated with the new kernel. This process erases all of your personal data. Be sure to back up your data before wiping.\n```bash\nfastboot -w\n```\n\n##### Flash commands:\n```bash\nfastboot flash boot out/{{ codename }}/dist/boot.img\nfastboot flash dtbo out/{{ codename }}/dist/dtbo.img\nfastboot flash dtb out/{{ codename }}/dist/dtb.img\nfastboot reboot fastboot\nfastboot flash vendor_boot out/{{ codename }}/dist/vendor_kernel_boot.img\nfastboot flash vendor_dlkm out/{{ codename }}/dist/vendor_dlkm.img\nfastboot flash system_dlkm out/{{ codename }}/dist/system_dlkm.img\nfastboot reboot\n```\n\u003e Reboot into fastboot mode ensures the device is ready to accept vendor and system DLKMs.\n\n💡 Notes:\n- Do not flash `initramfs.img` directly; it is embedded inside `vendor_boot.img`.\n- Reboot into fastboot before flashing vendor_dlkm or system_dlkm to ensure the device is ready.\n- Order matters: Boot → DTBO/DTB → Vendor \u0026 System DLKM.\n\n##### Enable serial logs (optional):\n```bash\nfastboot oem uart enable\nfastboot oem uart config 3000000\n```\nExample:\n```bash\nscreen -fn /dev/ttyUSB* 3000000\n```\n\n##### Restore the factory images\nTo restore your device back to the factory images, you can use [flash.android.com](https://flash.android.com/welcome).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazagramac%2Fbuild-kernel-aosp-pixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazagramac%2Fbuild-kernel-aosp-pixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazagramac%2Fbuild-kernel-aosp-pixel/lists"}