اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
التحديث عبر الهواء لأجهزة A/B التي تتضمّن أقسامًا ديناميكية
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يتيح نظام التشغيل Android 10 استخدام الأقسام الديناميكية، وهو نظام لقسمة مساحة المستخدمين يمكنه إنشاء الأقسام وتغيير حجمها ومحوها أثناء عمليات التحديث عبر الهواء.
توضِّح هذه الصفحة كيفية تغيير حجم الأقسام الديناميكية أثناء تحديث أجهزة A/B التي
تم طرحها مع ميزة دعم الأقسام الديناميكية، وذلك للأجهزة التي تعمل بنظام Android 9 والإصدارات
الأقدم.
الخلفية
يتوفّر قسم super واحد على الجهاز. لا يحتوي هذا القسم
على إضافة خانة. يجب أن يكون جهاز التخزين المؤقت متوفّرًا
مع إدخال blk_device للوحدة التنظيمية /misc في
fstab. على سبيل المثال، إذا كان ملف fstab يسرد ما يلي:
/dev/block/bootdevice/by-name/misc /misc # Other fields
بعد ذلك، يجب أن يكون جهاز الكتلة لـ super متوفّرًا في
/dev/block/bootdevice/by-name/super، ولكن ليس من الضروري إدراج قسم
super في ملف
fstab.
في القسم super، هناك مجرّد مجرّد
فتحتَا بيانات وصفية، تحملان الرقمَين 0 و1، وتتوافقان مع مجرّد مجرّد
فتحتَي A/B للقسمَين. في هذه الصفحة، تُعرف خانات البيانات الوصفية باسم
"البيانات الوصفية S" (المصدر) و"البيانات الوصفية T" (الهدف). وبالمثل، تتم الإشارة إلى الأقسام باسم system_svendor_t وما إلى ذلك.
قبل الترقية، يحتوي ملف Metadata S على معلومات عن القسمين الديناميكيين المُستخدَمين (عادةً system_s وvendor_s وproduct_s وما إلى ذلك). يقرأ النظام
امتدادات هذه الأقسام أثناء التحديث، لذا
لا يمكن حذفها.
حمِّل النطاقات للشرائح الديناميكية المصدر من البيانات الوصفية
S. لنفترض أنّ M هي البيانات الوصفية المحمَّلة.
أزِل المجموعات والفواصل المستهدفة (مثل
foo_t وbar_t) من M كي لا تحتوي M على سوى
الفواصل والمجموعات التي تحتوي على اللاحقة _s.
أضِف المجموعات والشرائح المستهدَفة وفقًا لحقل
dynamic_partition_metadata في بيان
التحديث.
يمكن العثور على حجم كل قسم في
new_partition_info.
اكتب M في حقل البيانات الوصفية T.
يمكنك ربط الأقسام المُضافة في أداة ربط الأجهزة على أنّها قابلة للكتابة.
طبِّق التحديث على الأجهزة المحظورة.
إذا لزم الأمر، يمكنك ربط أقسام المصدر في أداة ربط الأجهزة على أنّها
للقراءة فقط. هذا الإجراء ضروري لتحميل التطبيقات من مصدر غير معروف لأنّه لم يتم ربط أقسام المصدر
قبل التحديث.
تطبيق تحديث كامل أو تحديث دلتا على جميع أجهزة الكتلة في المربّع المستهدف
شغِّل الوحدات لتتمكّن من تشغيل النص البرمجي لعمليات ما بعد التثبيت، ثم
فكِّ ربط الوحدات.
أزِل الربط بين الأقسام المستهدَفة.
قبل التحديث وبعده، يجب أن تحتوي خصائص النظام التالية على
القيم ذات الصلة:
عند إجراء تحديث عبر الهواء على جهاز A/B يتضمّن أقسامًا ديناميكية،
أو جهاز A/B يضيف إمكانات استخدام الأقسام الديناميكية،
عليك إضافة المجموعات والأقسام إلى بيان التحديث. يعرض المقتطف أدناه معلومات إضافية عن بيان التحديث لتفعيل الأقسام الديناميكية. راجِع
update_metadata.proto
للحصول على مستندات تفصيلية حول كل حقل.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# OTA for A/B devices with dynamic partitions\n\nAndroid 10 supports\n[dynamic partitions](/docs/core/ota/dynamic_partitions), a userspace partitioning\nsystem that can create, resize, and destroy partitions during over-the-air (OTA) updates.\n\nThis page describes how to resize dynamic partitions during an update for A/B devices that\nlaunched with dynamic partitions support, for devices running **Android 9 and\nlower**.\n\nBackground\n----------\n\n\nThere's one `super` partition on the device. This\npartition isn't slot suffixed. The block device must exist along\nwith the `blk_device` entry for `/misc` in\n`fstab`. For example, if the `fstab` file lists: \n\n```text\n/dev/block/bootdevice/by-name/misc /misc # Other fields\n```\n\n\nThen the block device for `super` must exist in\n`/dev/block/bootdevice/by-name/super`, but the\n`super` partition doesn't need to be listed in the\n`fstab` file.\n\n\nIn the `super` partition, there are two\n*metadata slots* , numbered 0 and 1, corresponding to\nA/B slots for partitions. In this page, the metadata slots are\ncalled Metadata S (source) and Metadata T (target). Similarly,\npartitions are referred to as `system_s`,\n`vendor_t`, and so on.\n\n\nBefore the upgrade, Metadata S contains the information for the\ndynamic partitions being used (typically, `system_s`,\n`vendor_s`, `product_s`, and so on). The system\nreads the extents for these partitions during the update, so they\ncan't be deleted.\n\n\nPartitions belong to *update groups* . See\n[Implementing\nDynamic Partitions](/docs/core/ota/dynamic_partitions/implement) for details.\n\n\nAn example of metadata on a device is as follows.\n\n- Metadata 0\n - Group `foo_a`\n - Partition `system_a`\n - Partition `product_services_a`\n - Other partitions updated by Foo\n - Group bar_a\n - Partition `vendor_a`\n - Partition `product_a`\n - Other partitions updated by Bar\n - Group `foo_b` (leftover from previous upgrade)\n - Group `bar_b` (leftover from previous upgrade)\n- Metadata 1\n - Group `foo_a` (leftover from previous upgrade)\n - Group `bar_a` (leftover from previous upgrade)\n - Group `foo_b`\n - Partition `system_b`\n - Partition `product_services_b`\n - Other partitions updated by Foo\n - Group `bar_b`\n - Partition `vendor_b`\n - Partition `product_b`\n - Other partitions updated by Bar\n\n\nYou can use the `lpdump` tool (source code under\n`system/extras/partition_tools`) to dump the metadata on\nyour device. For example: \n\n lpdump --slot 0 /dev/block/bootdevice/by-name/super\n lpdump --slot 1 /dev/block/bootdevice/by-name/super\n\nUpdate flow\n-----------\n\n1. **Initialize the `super` partition metadata.**\n 1. Load the extents for the source dynamic partitions from Metadata S. Let M be the loaded metadata.\n 2. Remove target groups and partitions (for example, `foo_t`, `bar_t`) from M so that M contains only partitions and groups with the `_s` suffix.\n 3. Add target groups and partitions according to the `dynamic_partition_metadata` field in the update manifest. \n The size of each partition can be found in `new_partition_info`.\n 4. Write M to Metadata T.\n 5. Map the added partitions on the device mapper as writable.\n2. **Apply the update on the block devices.**\n 1. If necessary, map the source partitions on the device mapper as read only. This is necessary for sideloading because the source partitions aren't mapped prior to the update.\n 2. Apply a full or delta update to all block devices at the target slot.\n 3. Mount the partitions to run the post-install script, and then unmount the partitions.\n3. **Unmap the target partitions.**\n\n| **Note:** The extents for both source and target dynamic partitions span across the entire `super` partition. As a result, you must load the source metadata so that these extents aren't used as part of any target partitions.\n\n\nBefore and after the update, the following system properties should have\nthe respective values: \n\n```scdoc\nro.boot.dynamic_partitions=true\nro.boot.dynamic_partitions_retrofit=true\n```\n\nAdd groups and partitions to the update manifest\n------------------------------------------------\n\n\nWhen performing an OTA update on an A/B device with dynamic partitions,\nor an A/B device that is adding support for dynamic partitions, you\nneed to add groups and partitions to the update manifest. The snippet\nbelow shows additional information on the update manifest to support\ndynamic partitions. See\n[update_metadata.proto](https://android.googlesource.com/platform/system/update_engine/+/android16-release/update_metadata.proto)\nfor detailed documentation on each field. \n\n```scdoc\nmessage DeltaArchiveManifest {\n optional DynamicPartitionMetadata dynamic_partition_metadata;\n}\n\nmessage DynamicPartitionMetadata {\n repeated DynamicPartitionGroup groups;\n}\n\nmessage DynamicPartitionGroup {\n required string name;\n optional uint64 size; // maximum size of group\n repeated string partition_names;\n}\n```"]]