2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
ブロックベースの OTA
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 5.0 を搭載する新しいデバイスでは、ブロックベースの無線(OTA)アップデートを有効にできます。OTA とは、OEM がリモートでデバイスの system パーティションをアップデートするメカニズムです。
-
Android 5.0 以降のバージョンはブロック OTA アップデートを使用して、各デバイスが完全に同じパーティションを使用するようにします。個々のファイルを比較してバイナリパッチを算出する代わりに、ブロック OTA はパーティション全体を 1 つのファイルとして処理して 1 つのバイナリパッチを算出し、結果としてパーティションに完全に意図したとおりのデータを含むようにします。これにより、fastboot や OTA を使用してデバイスのシステム イメージを同じ状態にできます。
- Android 4.4 以前のバージョンではファイル OTA アップデートを使用していました。これにより、デバイスに同様のファイル内容、権限、モードが含まれますが、タイムスタンプや基盤となるストレージのレイアウトなどのメタデータをアップデート メソッドに基いてデバイス間で変えることが可能でした。
ブロック OTA では各デバイスが同じパーティションを使用するため、dm-verity を使用して system パーティションに暗号署名をすることができます。
dm-verity の詳細については、確認付きブートをご覧ください。
注: dm-verity を使用する前に、稼働中のブロック OTA システムが必要です。
推奨事項
Android 5.0 以降でリリースするデバイスの場合は、工場出荷時の ROM でブロック OTA アップデートを使用します。後続の更新でブロックベース OTA を生成するには、--block
オプションを ota_from_target_files
に渡します。
Android 4.4 以前でリリースしたデバイスの場合は、ファイル OTA アップデートを使用します。Android 5.0 以降のフルブロック OTA を送信することでデバイスを移行することも可能ですが、増分 OTA よりも大幅に大きいフル OTA を送信する必要があるため、行わないようにしてください。
dm-verity は、Android 5.0 以降で出荷される新しいデバイスでのみサポートされるブートローダーが必要なため、既存のデバイスでは dm-verity を有効にできません。
リカバリ イメージと OTA を生成するスクリプトである Android OTA システムを開発しているデベロッパーは、android-ota@googlegroups.com のメーリング リストに登録して、変更についての最新情報をチェックできます。
ファイル OTA とブロック OTA
ファイルベースの OTA では、Android はファイル システム レイヤの system パーティションの内容をファイルごとに変更しようとします。アップデートでは、ファイルを一貫した順序で書き込むことや、最終更新時刻やスーパーブロックを一貫して保つこと、ブロック デバイスの同じ場所にブロックを配置することもできません。このため、dm-verity を有効にしたデバイスではファイルベースの OTA が失敗します。OTA の試行後、デバイスは起動しません。
ブロックベースの OTA の際に、Android はデバイスに、2 つのファイルセットではなく 2 つのブロック イメージの差分を配信します。この更新では、ファイル システムの下にあるブロックレベルの対応するビルドサーバーに対して、次のいずれかの方法でデバイスビルドをチェックします。
-
フル アップデート。システム イメージ全体を簡単にコピーできるため、パッチを簡単に作成できます。ただし生成されるイメージが大きくなり、パッチの適用にコストが掛かります。
-
増分アップデート。バイナリ差分ツールを使用すると、イメージが小さくなり、パッチ適用が簡単になりますが、パッチ自体を生成するときにメモリが大量に消費されます。
注:adb fastboot
フル OTA とまったく同じビットをデバイスに配置します。したがって、フラッシュはブロック OTA と互換性があります。
未修正の system のアップデート
未修正の system パーティションがあり Android 5.0 を実行しているデバイスの場合、ブロック OTA のダウンロードとインストールのプロセスは、ファイル OTA の場合と同じです。ただし、OTA アップデート自体には、次のような相違点があります。
-
ダウンロード サイズ。
フルブロック OTA アップデートは、フルファイル OTA アップデートとほぼ同じサイズで、増分アップデートはわずか数メガバイト大きいだけです。
図 1. Android 5.0 リリースと Android 5.1 リリース間での Nexus 6 OTA サイズの比較(ターゲット ビルドの変更により変化)
通常、増分ブロック OTA アップデートは、増分ファイル OTA アップデートよりも大きくなります。
-
データの保存。ブロックベース OTA は、ファイルベース OTA よりも多くのデータ(ファイル メタデータ、dm-verity データ、ext4 レイアウトなど)を保持します。
-
計算アルゴリズムの違い。ファイル OTA アップデートでは、ファイルパスが両方のビルドで同一である場合、OTA パッケージにはそのファイルのデータは含まれません。ブロック OTA アップデートでは、パッチの計算アルゴリズムの品質と、ソースシステムとターゲット システムの両方でのファイルデータのレイアウトによって、ファイルの変更はほとんどしないか、まったく行わないかを判断します。
-
フラッシュ メモリと RAM の欠陥に対する感度。ファイルが破損している場合、ファイル OTA は破損したファイルにはアクセスしない限り成功しますが、ブロック OTA は system パーティション内に破損を検出すると失敗します。
修正済みの system のアップデート
修正済みの system パーティションがあり、Android 5.0 を実行しているデバイスの場合、次のようになります。
-
増分ブロック OTA アップデートが失敗する。system パーティションは、
adb remount
または不正なソフトウェアが原因で修正される可能性があります。ファイル OTA は、ソースビルドやターゲット ビルドに含まれないファイルの追加など、パーティションへの変更を許容します。ただし、ブロック OTA はパーティションへの追加を許容しないため、フル OTA をインストールして system パーティションの変更を上書きするか、新しいシステム イメージをフラッシュして将来の OTA を有効にします。
-
修正済みファイルを変更しようとしまたが失敗する。ファイル OTA アップデートとブロック OTA アップデートの両方で、OTA が修正済みファイルを変更しようとすると、OTA アップデートは失敗します。
-
修正済みファイルにアクセスしようとするとエラーが発生する (dm-verity のみ)。ファイル OTA アップデートとブロック OTA アップデートの両方で、dm-verity が有効な場合に、OTA がシステムのファイル システムの修正部分にアクセスしようとすると、OTA はエラーを生成します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 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-07-27 UTC。"],[],[],null,["# Block-based OTAs\n\nYou can enable block-based over-the-air (OTA) updates for new devices running Android 5.0. OTA\nis the mechanism by which OEMs remotely update the system partition of a device:\n\n- **Android 5.0** and later versions use block OTA updates to ensure that each device uses the exact same partition. Instead of comparing individual files and computing binary patches, block OTA handles the entire partition as one file and computes a single binary patch, ensuring the resultant partition contains exactly the intended bits. This allows the device system image to achieve the same state via fastboot or OTA.\n- **Android 4.4** and earlier versions used file OTA updates, which ensured devices contained similar file contents, permissions, and modes, but allowed metadata such as timestamps and the layout of the underlying storage to vary between devices based on the update method.\n\n\nBecause block OTA ensures that each device uses the same partition, it enables the use of\ndm-verity to cryptographically sign the system partition. For details on dm-verity, see\n[Verified Boot](/docs/security/features/verifiedboot).\n\n\n**Note:** You must have a working block OTA system before using dm-verity.\n\nRecommendations\n---------------\n\n\nFor devices launching with Android 5.0 or later, use block OTA updates in the factory ROM. To\ngenerate a block-based OTA for subsequent updates, pass the `--block` option to\n`ota_from_target_files`.\n\n\nFor devices that launched with Android 4.4 or earlier, use file OTA updates. While it is\npossible to transition devices by sending a full block OTA of Android 5.0 or later, it\nrequires sending out a full OTA that is significantly larger than an incremental OTA (and is\ntherefore discouraged).\n\n\nBecause dm-verity requires bootloader support found only in new devices shipping with Android\n5.0 or later, you *cannot* enable dm-verity for existing devices.\n\n\nDevelopers working on the Android OTA system (the recovery image and the scripts that generate\nOTAs) can keep up with changes by subscribing to the\n[android-ota@googlegroups.com](https://groups.google.com/forum/#!forum/android-ota)\nmailing list.\n\nFile versus block OTAs\n----------------------\n\n\nDuring a file-based OTA, Android attempts to change the contents of the system partition at\nthe filesystem layer (on a file-by-file basis). The update is not guaranteed to write files in\na consistent order, have a consistent last modified time or superblock, or even place the\nblocks in the same location on the block device. For this reason, file-based OTAs fail on a\ndm-verity-enabled device; after the OTA attempt, the device does not boot.\n\n\nDuring a block-based OTA, Android serves the device the difference between the two block\nimages (rather than two sets of files). The update checks a device build against the\ncorresponding build server at the block level (below the filesystem) using one of the\nfollowing methods:\n\n- **Full update**. Copying the full system image is simple and makes patch generation easy but also generates large images that can make applying patches expensive.\n- **Incremental update**. Using a binary differ tool generates smaller images and makes patch application easy, but is memory-intensive when generating the patch itself.\n\n\n**Note:** `adb fastboot` places the exact same bits on the device as a\nfull OTA, so flashing is compatible with block OTA.\n\n### Update unmodified systems\n\n\nFor devices with *unmodified* system partitions running Android 5.0, the download and\ninstall process for a block OTA remains the same as for a file OTA. However, the OTA update\nitself might include one or more of the following differences:\n\n- **Download size** .\n\n\n Full block OTA updates are approximately the same size as full file OTA updates, and\n incremental updates can be just a few megabytes larger.\n\n\n **Figure 1.** Compare Nexus 6 OTA sizes between Android 5.0 and Android 5.1\n releases (varying target build changes)\n\n\n In general, incremental block OTA updates are larger than incremental file OTA updates due\n to:\n - *Data preservation*. Block-based OTAs preserve more data (file metadata, dm-verity data, ext4 layout, etc.) than file-based OTA.\n - *Computation algorithm differences*. In a file OTA update, if a file path is identical in both builds, the OTA package contains no data for that file. In a block OTA update, determining little or no change in a file depends on the quality of the patch computation algorithm and layout of file data in both source and target system.\n- **Sensitivity to faulty flash and RAM**. If a file is corrupted, a file OTA succeeds as long as it doesn't touch the corrupted file, but a block OTA fails if it detects any corruption on the system partition.\n\n### Update modified systems\n\nFor devices with *modified* system partitions running Android 5.0:\n\n- **Incremental block OTA updates fail** . A system partition might be modified during an `adb remount` or as a result of malware. File OTA tolerates some changes to the partition, such as the addition of files that are not part of the source or target build. However, block OTA does not tolerate additions to the partition, so users will need to install a full OTA overwriting any system partition modifications) or flash a new system image to enable future OTAs.\n- **Attempts to change modified files cause update failure**. For both file and block OTA updates, if the OTA attempts to change a file that has been modified, the OTA update fails.\n- **Attempts to access modified files generate errors** *(dm-verity only)*. For both file and block OTA updates, if dm-verity is enabled and the OTA attempts to access modified parts of the system filesystem, the OTA generates an error."]]