À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release au lieu de aosp-main pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Implémentation
Les appareils Android équipés d'Android 9 ou version antérieure qui disposent de partitions A/B peuvent utiliser la partition system_other inactive (par exemple, system_b lorsque slot_a est actif) pour stocker des fichiers VDEX/ODEX préoptimisés. Lorsque system_other est utilisé, ro.cp_system_other_odex est défini sur 1 pour que le service de gestionnaire de paquets définisse sys.cppreopt=requested pour que cppreopts.rc puisse y agir.
Dans Android 10, libfs_avb est introduit pour prendre en charge la validation AVB autonome pour la partition system_other. La struct VBMeta d'une telle partition est ajoutée à la fin de la partition, pour être validée par une clé publique attendue du système de fichiers. Le système de compilation Android prend en charge la signature system_other.img tout en incluant la clé de signature correspondante sous /product/etc/security/avb/system_other.avbpubkey. L'outil de publication sign_target_files_apks.py permet également de remplacer la clé de signature par une version de publication.
Les appareils A/B lancés avant Android 10 disposent d'une partition system_other physique, même s'ils sont mis à niveau vers Android 10 avec PRODUCT_RETROFIT_DYNAMIC_PARTITIONS défini sur true.
Les appareils A/B lancés avec Android 10 doivent disposer d'une partition system_other logique. L'exemple suivant présente un fichier fstab.postinstall type qui active l'AVB sur system_other.
Les appareils qui doivent activer AVB sur la partition system_other doivent placer le fichier fstab dans la partition du produit et définir la propriété ro.postinstall.fstab.prefix sur /product.
# Use /product/etc/fstab.postinstall to mount system_other. PRODUCT_PRODUCT_PROPERTIES += \ro.postinstall.fstab.prefix=/product
PRODUCT_COPY_FILES+=\$(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# Verify system_other partition\n\nImplementation\n--------------\n\nAndroid-powered devices with Android 9 and lower that have A/B partitions can\nuse the inactive `system_other` partition (for example,\n`system_b`when `slot_a` is active) to store preoptimized\nVDEX/ODEX files. When `system_other` is used,\n`ro.cp_system_other_odex` is set to 1 for the package manager\nservice to set `sys.cppreopt=requested` for `cppreopts.rc`\nto act on it.\n\nIn Android 10, [`libfs_avb`](https://android.googlesource.com/platform/system/core/+/refs/heads/android16-release/fs_mgr/libfs_avb/)\nis introduced to support standalone AVB verification for the\n`system_other` partition. The VBMeta struct of such a partition is\nappended to the end of the partition, to be verified by an expected public key\nfrom the file system. The Android build system supports signing\n`system_other.img` while including the corresponding signing key\nunder `/product/etc/security/avb/system_other.avbpubkey`. The release\ntool `sign_target_files_apks.py` also supports replacing the signing\nkey to a release version.\n\nA/B devices launched before Android 10 have a physical\n`system_other` partition, even if it's upgraded to Android 10 with\n`PRODUCT_RETROFIT_DYNAMIC_PARTITIONS` set to `true`.\n\n| **Note:** It isn't recommended to enable AVB on these devices. `system_other.img` isn't included in the over-the-air package, which can lead to verification errors after a few A/B updates.\n\nA/B devices launched with Android 10 must have a logical\n`system_other` partition. The following example shows a typical\n`fstab.postinstall` file that enables AVB on\n`system_other`. \n\n```carbon\n#\u003cdev\u003e \u003cmnt_point\u003e \u003ctype\u003e \u003cmnt_flags options\u003e \u003cfs_mgr_flags\u003e\nsystem /postinstall ext4 ro,nosuid,nodev,noexec\nslotselect_other,logical,avb_keys=/product/etc/security/avb/system_other.avbpubkey\n```\n\nDevices that need to enable AVB on the `system_other` partition\nshould place the `fstab` file in the product partition and set the\nproperty `ro.postinstall.fstab.prefix` to `/product`. \n\n```makefile\n# Use /product/etc/fstab.postinstall to mount system_other. PRODUCT_PRODUCT_PROPERTIES += \\\nro.postinstall.fstab.prefix=/product\n\nPRODUCT_COPY_FILES += \\\n$(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall\n```"]]