27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main yerine android-latest-release kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Kablosuz (OTA) güncellemelerin uygulanması için önyükleyicinin, önyükleme sırasında bir kurtarma RAM diskine erişebilmesi gerekir. Cihaz, değiştirilmemiş bir AOSP kurtarma resmi kullanıyorsa bootloader, misc bölümündeki ilk 32 baytı okur. Buradaki veriler boot-recovery ile eşleşirse bootloader, recovery resmini başlatır. Bu yöntem, bekleyen tüm kurtarma çalışmalarının (ör. OTA uygulama veya veri kaldırma) tamamlanmaya devam etmesini sağlar.
A/B güncellemeleri kullanan cihazlarda OTA güncellemelerini desteklemek için cihaz önyükleyicisinin aşağıdaki ölçütleri karşıladığından emin olun.
Genel ölçütler
OTA üzerinden güncellenen tüm bölümler, ana sistem başlatılırken güncellenebilir olmalıdır (ve kurtarma modunda güncellenmez).
Önyükleme yükleyici, system bölümünü önyüklemek için çekirdek komut satırına aşağıdaki değeri iletir: ro root=/dev/[node] rootwait init=/init.
HAL'den markBootSuccessful çağırmak Android çerçevesinin sorumluluğundadır. Önyükleme yükleyici, bir bölümü hiçbir zaman başarıyla önyüklendi olarak işaretlememelidir.
Açılış kontrolü HAL'i desteği
Bootloader, hardware/libhardware/include/hardware/boot_control.h bölümünde tanımlandığı şekilde boot_control HAL'i desteklemelidir. Güncelleyici, boot control HAL'i sorgular, kullanılmayan önyükleme yuvasını günceller, HAL'i kullanarak etkin yuvanın yerini değiştirir ve güncellenmiş işletim sisteminde yeniden başlatır. Ayrıntılı bilgi için Başlatma denetimi HAL'ini uygulama başlıklı makaleyi inceleyin.
Yuva desteği
Önyükleyici, aşağıdakiler dahil olmak üzere bölümler ve yuvalarla ilgili işlevleri desteklemelidir:
Bölme adları, önyükleyicideki belirli bir yuvaya ait olan bölümleri tanımlayan bir son ek içermelidir. Bu tür her bölüm için, değeri yes olan has-slot:partition base name adlı bir değişken bulunur. Yuvalar, _a, _b, _c vb. son eklerine sahip bölümlere karşılık gelen a, b, c vb. şeklinde alfabetik olarak adlandırılır. Önyükleme yükleyici, androidboot.slot_suffix komut satırı mülkünü kullanarak işletim sistemini hangi yuvanın başlatıldığını bilgilendirmelidir. Bu özellik, Android 12 veya sonraki sürümlerle başlatılan cihazlar için bootconfig aracılığıyla ayarlanır.
slot-retry-count değeri, setActiveBootSlot geri çağırma işlevi aracılığıyla veya fastboot set_active komutu aracılığıyla önyükleme kontrolü HAL tarafından pozitif bir değere (genellikle 3) sıfırlanır. Bir yuvanın parçası olan bir bölüm değiştirilirken önyükleme yükleyici, "başarıyla başlatıldı" ifadesini temizler ve yuvanın yeniden deneme sayısını sıfırlar.
Bootloader, hangi yuvanın yükleneceğini de belirlemelidir. Şekilde örnek bir karar süreci gösterilmektedir.
Şekil 1. Önyükleyici slotting akışı
Hangi yuvada deneme yapılacağını belirleyin. slot-unbootable işaretli bir yuvayı yüklemeye çalışmayın. Bu yuva, fastboot tarafından döndürülen değerlerle tutarlı olmalıdır ve mevcut yuva olarak adlandırılır.
Mevcut slot slot-successful olarak işaretlenmemişse ve slot-retry-count = 0 varsa mevcut slotu slot-unbootable olarak işaretleyin. Ardından, unbootable işaretli olmayan ve slot-successful olarak işaretlenmiş farklı bir yuva seçin. Bu yuva artık seçili yuvadır. Mevcut bir yuva yoksa kurtarma moduna önyükleme yapın veya kullanıcıya anlamlı bir hata mesajı gösterin.
Uygun boot.img seçin ve çekirdek komut satırına doğru sistem bölümünün yolunu ekleyin.
fastboot yardımcı programı, herhangi bir flaş komutu çalıştırıldığında hangi bölümün flaşlanacağını belirler. Örneğin, fastboot flash system system.img komutu çalıştırıldığında önce current-slot değişkeni sorgulanır, ardından sonucu sistemle birleştirilerek önyüklenmesi gereken bölümün adı (system_a, system_b vb.) oluşturulur.
fastboot set_active komutu veya boot control HAL setActiveBootSlot komutu kullanılarak mevcut yuva ayarlanırken önyükleme yükleyici, mevcut yuvanın güncellenmesini, slot-unbootable ve slot-successful değerlerinin temizlenmesini ve yeniden deneme sayısının sıfırlanmasını sağlamalıdır (slot-unbootable değerinin temizlenmesinin tek yolu budur).
A/B güncellemeleri olmayan cihazlar
A/B güncellemeleri kullanmayan cihazlarda OTA güncellemelerini desteklemek için (A/B güncellemesi olmayan güncellenebilir cihazlar bölümüne bakın) cihaz önyükleyicisinin aşağıdaki ölçütleri karşıladığından emin olun.
recovery bölümü, desteklenen bir bölümden (cache, userdata) sistem görüntüsünü okuyup system bölümüne yazabilen bir görüntü içermelidir.
Önyükleme yükleyici, doğrudan kurtarma moduna önyüklemeyi desteklemelidir.
Radyo resim güncellemeleri destekleniyorsa recovery bölümü de radyoyu flaşlayabilir. Bu işlem iki şekilde yapılabilir:
Önyükleyici, radyoyu yanıp söner. Bu durumda, güncellemeyi tamamlamak için kurtarma bölümünden bootloader'a yeniden önyükleme yapabilirsiniz.
Kurtarma görüntüsü radyoyu yanıp söner. Bu işlev, ikili kitaplık veya yardımcı program olarak sağlanabilir.
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Implement OTA updates\n\nTo implement the [over-the-air (OTA) updates](/docs/core/ota), the\nbootloader must be able to access a recovery RAM disk during boot. If the device\nuses an unmodified AOSP recovery image, the bootloader reads the first 32 bytes\non the `misc` partition; if the data there matches `boot-recovery`, the\nbootloader boots into the `recovery` image. This method enables any pending\nrecovery work (for example, applying an OTA or removing data) to continue to\ncompletion.\n\nFor details on the content of a block in flash used for communications by\nrecovery and the bootloader, refer to\n[bootable/recovery/bootloader_message/bootloader_message.h](https://android.googlesource.com/platform/bootable/recovery/+/android16-release/bootloader_message/include/bootloader_message/bootloader_message.h#64).\n\nDevices with A/B updates\n------------------------\n\nTo support OTA updates on devices that use [A/B\nupdates](/docs/core/ota/ab), ensure that the device bootloader meets\nthe following criteria.\n\n### General criteria\n\n- All partitions updated through an OTA should be updatable while the main\n system is booted (and not updated in recovery).\n\n- To boot the `system` partition, the bootloader passes the following value on\n kernel command line: `ro root=/dev/[node] rootwait init=/init`.\n\n- It's the responsibility of the Android framework to call `markBootSuccessful`\n from the HAL. The bootloader should never mark a partition as successfully\n booted.\n\n### Support for boot control HAL\n\nThe bootloader must support the `boot_control` HAL as defined in\n`hardware/libhardware/include/hardware/boot_control.h`. The updater queries the\n[boot control\nHAL](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/boot/1.0/IBootControl.hal),\nupdates the boot slot not in use, changes the active slot using the\nHAL, and reboots into the updated operating system. For details, see\n[Implementing the boot control\nHAL](/docs/core/ota/ab/ab_implement#bootcontrol).\n\n### Support for slots\n\nThe bootloader must support functionality related to partitions and slots,\nincluding:\n\n- Partition names must include a suffix that identifies which partitions\n belong to a particular slot in the bootloader. For each such partition,\n there's a corresponding variable\n `has-slot:`\u003cvar translate=\"no\"\u003epartition base name\u003c/var\u003e with a value of\n `yes`. Slots are named alphabetically as a, b, c, etc. corresponding to\n partitions with the suffix `_a`, `_b`, `_c`, etc. The bootloader should inform\n the operating system which slot was booted using the command line property\n `androidboot.slot_suffix`. This property is set through bootconfig for devices\n launching with Android 12 or higher.\n\n- The `slot-retry-count` value is reset to a positive value (usually `3`),\n either by the boot control HAL through the `setActiveBootSlot` callback or\n through the `fastboot set_active` command. When modifying a partition that's\n part of a slot, the bootloader clears \"successfully booted\" and resets the\n retry count for the slot.\n\nThe bootloader should also determine which slot to load. The figure shows an\nexample decision process.\n**Figure 1.** Bootloader slotting flow\n\n1. Determine which slot to attempt. Don't attempt to load a slot marked\n `slot-unbootable`. This slot should be consistent with the values returned by\n fastboot, and is referred to as the current slot.\n\n2. If the current slot isn't marked as `slot-successful` and has a\n `slot-retry-count = 0`, mark the current slot as `slot-unbootable`. Then\n select a different slot that is not marked `unbootable` and is marked as\n `slot-successful`; this slot is now the selected slot. If no current slot is\n available, boot to recovery or display a meaningful error message to the\n user.\n\n3. Select the appropriate `boot.img` and include the path to correct system\n partition on the kernel command line.\n\n4. Populate the kernel command line `slot_suffix` parameter.\n\n5. Boot. If not marked `slot-successful`, decrement `slot-retry-count`.\n\nThe `fastboot` utility determines which partition to flash when running any\nflash commands. For example, running the `fastboot flash system system.img`\ncommand first queries the `current-slot` variable then concatenates the result\nto system to generate the name of the partition that should be flashed\n(`system_a`, `system_b`, etc.).\n\nWhen setting the current slot using the fastboot `set_active` command or the\nboot control HAL `setActiveBootSlot` command, the bootloader should update\nthe current slot, clear `slot-unbootable` and `slot-successful`, and reset the\nretry count (this is the only way to clear `slot-unbootable`).\n\nDevices without A/B updates\n---------------------------\n\nTo support OTA updates on devices that don't use A/B updates (see [Non-A/B\nupdatable devices](/docs/core/ota/nonab)), ensure that the device\nbootloader meets the following criteria.\n\n- The `recovery` partition should contain an image that is capable of reading a\n system image from some supported partition (`cache`, `userdata`) and writing\n it to the `system` partition.\n\n- The bootloader should support booting directly into recovery mode.\n\n- If radio image updates are supported, the `recovery` partition should also be\n able to flash the radio. This can be accomplished in one of two ways:\n\n - The bootloader flashes the radio. In this case, it should be possible to\n reboot from the recovery partition back into the bootloader to complete the\n update.\n\n - The recovery image flashes the radio. This functionality can be provided as\n a binary library or utility."]]