2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
汎用カーネル イメージ(GKI)プロジェクト
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このページでは、汎用カーネル イメージ(GKI)プロジェクトについて説明し、GKI によって Android の安定性とセキュリティが向上する仕組みについて解説します。
履歴
すべての Android 搭載デバイスには本番環境カーネルが必要です。GKI 以前のカーネルは Android Common Kernel(ACK)をベースとしたカスタム カーネルで、デバイス固有の変更はシステム オン チップ(SoC)ベンダーや OEM が実施していました。
こうしたカスタマイズの結果、カーネルコードの 50% がアップストリームの Linux カーネルや ACK に由来しないツリー外のコードになることがありました。このような GKI 以前のカーネルの性質が、カーネルの深刻な断片化につながっていました。
断片化の代償
カーネルの断片化は、Android コミュニティに悪影響を及ぼします。
セキュリティ アップデートに手間がかかる
Android のセキュリティに関する公開情報(ASB)に記載されているセキュリティ パッチは、各デバイス カーネルにバックポートする必要があります。しかし、カーネルの断片化が原因で、実際に利用中の Android デバイスにセキュリティ修正を反映させるには膨大なコストがかかります。
長期サポートのアップデートの統合が困難
長期サポート(LTS)リリースには、セキュリティ修正やその他の重要なバグの修正が含まれています。LTS リリースを最新の状態に保つことは、セキュリティ修正を提供する最も効果的な方法であることが証明されています。Pixel デバイスにおいて、ASB でレポートされたカーネル セキュリティに関する問題の 90% が、最新の状態のデバイスではすでに修正されていることが判明しました。
しかし、デバイス カーネルのカスタム変更をすべて適用しても、LTS 修正をデバイス カーネルに統合することは困難です。
断片化により、カーネルの変更を必要とする Android の新機能を、利用中のデバイスに追加することが困難になります。Android フレームワークのコードではさまざまなカーネルをサポートする必要があり、カーネルに実装されている Android の新機能に依存することはできませんでした。これにより革新が遅れ、コードのサイズと複雑さの増大につながっていました。
アップストリームの Linux にカーネル変更を反映することが困難
本番環境カーネルにパッチを適用する方法が断片的だったため、LTS リリースがアップストリームで利用可能になってからデバイスに適用されるまでの間に、最大 18 か月の遅延が生じていました。アップストリームのカーネル リリースとプロダクトの間のこうした大きな遅延のため、Android コミュニティが必要な機能とドライバをアップストリームのカーネルに組み込むことは困難です。ユーザーが改善点の提案を送信する頃にはコードベースが変更されており、パッチの関連性を示すことも困難です。
断片化の修正: 汎用カーネル イメージ
汎用カーネル イメージ(GKI)プロジェクトは、コアカーネルを統合し、SoC とボードのサポートをコアカーネルから読み込み可能ベンダー モジュールに移動することで、カーネルの断片化に対処しています。また、GKI はベンダー モジュール用に安定版のカーネル モジュール インターフェース(KMI)を提供しています。これにより、モジュールとカーネルを別々に更新できます。以下に、GKI カーネルの特徴をいくつか示します。
- GKI カーネルは ACK ソースからビルドされます。
- GKI カーネルは、単一カーネル バイナリに、アーキテクチャごと、LTS リリースごとの関連する読み込み可能モジュールを加えたものです。
- GKI カーネルは、関連する ACK でサポートされるすべての Android プラットフォーム リリースでテストされます。GKI カーネル バージョンの全期間を通じて、機能が非推奨になることはありません。
- GKI カーネルは、特定の LTS 内のドライバに対して安定版の KMI を公開します。
- GKI カーネルには、SoC 固有またはボード固有のコードは含まれません。
GKI アーキテクチャのイメージについては、カーネルの概要をご覧ください。
一般的なイメージ
Android 12 以降では、出荷時にカーネル バージョン 5.10 以上を搭載するデバイスの場合、GKI カーネルを搭載して出荷する必要があります。汎用カーネル イメージ(GKI)リリースビルドは、LTS と重要なバグ修正で定期的に更新されます。KMI 用にバイナリの安定性が維持されるため、ベンダー イメージを変更しなくても、このようなブートイメージをインストールできます。GKI プロジェクトの目標は以下のとおりです。
- プロダクト カーネルを GKI カーネルに置き換える際に、パフォーマンスまたは電力の大幅な低下が発生しないようにする。
- ベンダーの関与なしでパートナーがカーネルのセキュリティ修正とバグ修正を提供できるようにする。
- デバイスのメジャー カーネル バージョンの uprev のコストを削減する。
- アップグレードの明確なプロセスを定めてカーネル バージョンを更新することにより、アーキテクチャごとに単一の GKI カーネル バイナリを保持する。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-06 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-06 UTC。"],[],[],null,["# Generic Kernel Image (GKI) project\n\nThis page describes the Generic Kernel Image (GKI) project\nand how it increases Android stability and improves security.\n\nHistory\n-------\n\nEvery Android-powered device needs a production kernel. Prior to GKI, kernels\nwere custom and based on the Android Common Kernel (ACK), with device-specific\nchanges made by system on chip (SoC) vendors and OEMs.\n\nThis customization could result in as much as 50% of kernel\ncode being out-of-tree code and not from upstream Linux kernels or ACKs.\nAs such, the custom nature of pre-GKI kernels resulted in\nsignificant kernel fragmentation.\n\nCosts of fragmentation\n----------------------\n\nKernel fragmentation has several negative effects on the Android community.\n\n### Security updates are labor intensive\n\nSecurity patches cited in the\n[Android Security Bulletin (ASB)](/docs/security/bulletin)\nmust be backported into each of the device kernels. However, due to kernel\nfragmentation, it's prohibitively expensive to propagate security fixes to\nAndroid devices in the field.\n\n### Difficult to merge Long-Term Supported updates\n\nThe *Long-Term Supported (LTS)* releases include security fixes and\nother critical bug fixes. Staying up to date with LTS releases has proven\nto be the\nmost effective way to provide security fixes. On Pixel devices, it was\ndiscovered that 90% of the kernel security issues reported in the ASB had\nalready been fixed for devices that stay up to date.\n\nHowever, with all of the custom modifications in the device kernels, it's\ndifficult to just merge the LTS fixes into device kernels.\n\n### Inhibit Android platform release upgrades\n\nFragmentation makes it difficult for new Android features requiring\nkernel changes to be added to devices in the field. Android Framework\ncode had to account for the different kernel variations and couldn't\nrely on new Android features being implemented in the kernel\nThis slowed down innovation and caused increased code size and\ncomplexity.\n\n### Difficult to contribute kernel changes back to upstream Linux\n\nThe fragmented way of pulling patches into the production kernels caused a\ndelay of up to 18 months from the point where an LTS release was available\nupstream, to when it was in a device.\nThis long delay between upstream kernel release and products makes it difficult\nfor the Android community to feed needed features and drivers into the\nupstream kernels. By the time a user submitted suggestions for improvements, the\ncodebase had changed, making it hard to show the relevance\nof the patch.\n\nFix the fragmentation: Generic Kernel Image\n-------------------------------------------\n\nThe **Generic Kernel Image (GKI) project** addresses kernel fragmentation by\nunifying the core kernel and moving SoC and board support out of the core kernel\ninto loadable vendor modules. GKI also presents a stable Kernel Module\nInterface (KMI) for vendor modules, so modules and kernel can be updated\nindependently. Some characteristics of the GKI kernel are:\n\n- The GKI kernel is built from the ACK sources.\n- The GKI kernel is a single-kernel binary plus associated loadable modules per architecture, per LTS release.\n- The GKI kernel is tested with all Android Platform releases that are supported for the associated ACK. There's no feature deprecation for the lifetime of a GKI kernel version.\n- The GKI kernel exposes a stable KMI to drivers within a given LTS.\n- The GKI kernel doesn't contain SoC-specific or board-specific code.\n\nFor an image of GKI architecture, refer to the\n[Kernel overview](/docs/core/architecture/kernel).\n\n### Common Image\n\nBeginning with Android 12, devices shipping with kernel version 5.10 or higher\nmust ship with the GKI kernel. [Generic Kernel Image (GKI) release\nbuilds](/docs/core/architecture/kernel/gki-release-builds) are updated regularly\nand updated regularly with LTS and critical bug fixes.\nBecause binary stability is maintained for the KMI, you can install these boot\nimages without making changes to vendor images. The GKI project has these goals:\n\n- Don't introduce significant performance or power regressions when replacing the product kernel with the GKI kernel.\n- Enable partners to deliver kernel security fixes and bug fixes without vendor involvement.\n- Reduce the cost of upreving the major kernel version for devices.\n- Maintain a single GKI kernel binary per architecture by updating kernel versions with a clear process for upgrading."]]