हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
बूटलोडर के बारे में खास जानकारी
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
बूटलोडर, वेंडर की मालिकाना हक वाली इमेज होती है. यह डिवाइस पर कर्नेल को चालू करने के लिए ज़िम्मेदार होती है. बूटलोडर, डिवाइस की स्थिति की सुरक्षा करता है. साथ ही, ट्रस्टेड एक्ज़ीक्यूशन एनवायरमेंट (टीईई) को शुरू करने और उसके रूट ऑफ़ ट्रस्ट को बांधने की ज़िम्मेदारी भी इसकी होती है. बूटलोडर, कोर में प्रोग्राम को चलाने से पहले, boot
और recovery
के सेगमेंट के सही होने की पुष्टि भी करता है.
बूटलोडर फ़्लो का उदाहरण
यहां बूटलोडर फ़्लो का उदाहरण दिया गया है:
मेमोरी लोड और शुरू करना.
पुष्टि किए गए बूट मोड के मुताबिक, डिवाइस की पुष्टि करें.
वेरिफ़ाइड बूट फ़्लो के मुताबिक, boot
, dtbo
, init_boot
, और
recovery
जैसे बूट पार्टिशन की पुष्टि करें. इस चरण के तहत, बूट इमेज हेडर का वर्शन देखें और उसके हिसाब से हेडर को पार्स करें.
अगर A/B अपडेट का इस्तेमाल किया जाता है, तो बूट करने के लिए मौजूदा स्लॉट तय करें.
यह तय करना कि रिकवरी मोड को बूट करना है या नहीं. ज़्यादा जानकारी के लिए, ओटीए अपडेट की सुविधा लेख देखें.
boot.img
, vendor_boot.img
,
init_boot.img
जैसी बूट इमेज और वेंडर की मालिकाना हक वाली अन्य बूट इमेज लोड करें. इन बूट इमेज में, कर्नेल और रैमडिस्क इमेज शामिल होती हैं.
कर्नेल को मेमोरी में, अपने-आप चलने वाले संपीड़ित बिटरी के तौर पर लोड करें. इसके बाद, कर्नेल अपने-आप डिकंप्रेस हो जाता है और मेमोरी में काम करना शुरू कर देता है.
initramfs
बनाने के लिए, रैमडिस्क और बूट कॉन्फ़िगरेशन सेक्शन को मेमोरी में लोड करें.
बूटलोडर से जुड़ी अन्य सुविधाएं
यहां बूटलोडर से जुड़ी अन्य सुविधाओं की सूची दी गई है, जिन्हें लागू किया जा सकता है:
डिवाइस ट्री ओवरले (डीटीओ).
डिवाइस ट्री ओवरले की मदद से, बूटलोडर अलग-अलग हार्डवेयर कॉन्फ़िगरेशन के साथ काम कर सकता है. डीटीओ को डिवाइस ट्री ब्लॉब (डीटीबी) में कंपाइल किया जाता है. इसका इस्तेमाल बूटलोडर करता है.
कर्नेल इमेज के वर्चुअल पते को रैंडमाइज़ करना. बूटलोडर, उस वर्चुअल पते को रैंडमाइज़ करने की सुविधा देता है जिस पर कर्नेल इमेज लोड की जाती है. पते को यादृच्छिक बनाने के लिए, kernel config में RANDOMIZE_BASE
को true
पर सेट करें.
बूटलोडर को /chosen/kaslr-seed
डिवाइस ट्री नोड में कोई रैंडम u64 वैल्यू पास करके, एन्ट्रापी देनी होगी.
वेरिफ़ाइड बूट. पुष्टि किए गए बूट की मदद से, बूटलोडर यह पक्का करता है कि चलाया गया कोड, भरोसेमंद सोर्स से आया हो.
बूट कॉन्फ़िगरेशन.
बूट कॉन्फ़िगरेशन, Android 12 और उसके बाद के वर्शन में उपलब्ध है. यह एक ऐसा तरीका है जिसकी मदद से, कॉन्फ़िगरेशन की जानकारी को बिल्ड और बूटलोडर से ऑपरेटिंग सिस्टम में भेजा जाता है.
Android 12 से पहले, androidboot
प्रीफ़िक्स वाले कर्नेल कमांड-लाइन पैरामीटर का इस्तेमाल किया जाता था.
ओवर-द-एयर (ओटीए) अपडेट. फ़ील्ड में मौजूद Android डिवाइसों को, सिस्टम, ऐप्लिकेशन सॉफ़्टवेयर, और टाइम ज़ोन के नियमों के लिए, ओटीए अपडेट मिल सकते हैं और उन्हें इंस्टॉल किया जा सकता है. इस सुविधा का असर, बूटलोडर को लागू करने पर पड़ता है. ओटीए के बारे में सामान्य जानकारी के लिए, ओटीए अपडेट देखें. बूटलोडर के हिसाब से OTA लागू करने के बारे में जानकारी पाने के लिए, OTA अपडेट के साथ काम करना लेख देखें.
वर्शन बाइंडिंग.
वर्शन बाइंडिंग, ऑपरेटिंग सिस्टम और पैच लेवल वर्शन के साथ सुरक्षा कुंजियों को बाइंड करता है. वर्शन बाइंडिंग की मदद से यह पक्का किया जाता है कि अगर किसी हमलावर को सिस्टम या टीईई सॉफ़्टवेयर के पुराने वर्शन में कोई कमजोरी मिलती है, तो वह डिवाइस को उस वर्शन पर वापस नहीं ला सकता जिसमें कमजोरी है. साथ ही, वह नए वर्शन से बनाई गई कुंजियों का इस्तेमाल भी नहीं कर सकता. वर्शन बाइंडिंग की सुविधा के साथ काम करने के लिए, बूटलोडर को कुछ जानकारी देनी होगी. ज़्यादा जानकारी के लिए, एवीबी प्रॉपर्टी में वर्शन की जानकारी देखें.
कर्नेल कमांड लाइन
इन जगहों से, कर्नेल कमांड लाइन को जोड़ें:
बूटलोडर कमांड लाइन: बूटलोडर के हिसाब से तय किए गए स्टैटिक और डाइनैमिक पैरामीटर का सेट
डिवाइस ट्री: chosen/bootargs
नोड से
defconfig
: CONFIG_CMDLINE
से
boot.img
: कमांड लाइन से (ऑफ़सेट और साइज़ के लिए, system/core/mkbootimg/bootimg.h
देखें
Android 12 के बाद, androidboot.*
पैरामीटर के लिए, हमें Android यूज़रस्पेस में पास करने की ज़रूरत होती है. इसके लिए, कर्नेल कमांड लाइन के बजाय, bootconfig का इस्तेमाल किया जा सकता है.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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,["# Bootloader overview\n\nA *bootloader* is a vendor-proprietary image responsible for bringing up the\nkernel on a device. The bootloader guards the device state and is responsible\nfor initializing the [Trusted Execution Environment (TEE)](/docs/security/features/trusty)\nand binding its root of trust. The bootloader also verifies the integrity of the\n`boot` and `recovery` partitions before moving execution to the kernel.\n\nExample bootloader flow\n-----------------------\n\nHere's an example bootloader flow:\n\n1. Load and initialize memory.\n\n2. Verify the device according to [Verified Boot flow](/docs/security/features/verifiedboot).\n\n3. Verify the boot partitions, including `boot`, `dtbo`, `init_boot`, and\n `recovery`, according to the Verified Boot flow. As part of this step, check the\n [boot image header](/docs/core/architecture/bootloader/boot-image-header)\n version and parse the header accordingly.\n\n4. If [A/B updates](/docs/core/ota/ab) are used, determine the current slot to\n boot.\n\n5. Determine if recovery mode should be booted. For more\n information, see\n [Supporting OTA Updates](/docs/core/architecture/bootloader/updating).\n\n6. Load the boot images, such as `boot.img`, `vendor_boot.img`,\n `init_boot.img`, and other proprietary vendor boot images. These boot images\n contain the kernel and ramdisk images.\n\n 1. Load the kernel into memory as a self-executable compressed\n binary. The kernel decompresses itself and starts executing into memory.\n\n 2. Load ramdisks and the bootconfig section into memory\n to create `initramfs`.\n\nAdditional bootloader-related features\n--------------------------------------\n\nFollowing is a list of additional bootloader-related features that you can\nimplement:\n\n- *Device tree overlay (DTO).*\n A [device tree overlay](/docs/core/architecture/dto) lets the bootloader to\n support different hardware configurations. A DTO is compiled into a *device\n tree blob (DTB)* which is used by the bootloader.\n\n- *Kernel image virtual address randomization.* The bootloader supports\n randomizing the virtual address at which the kernel image is loaded. To\n randomize the address, set `RANDOMIZE_BASE` to `true` in the kernel config.\n The bootloader must provide entropy by passing a random u64 value in the\n `/chosen/kaslr-seed` device tree node.\n\n- *Verified Boot.* [Verified Boot](/docs/security/features/verifiedboot) lets\n the bootloader to ensure all executed code comes from a trusted source.\n\n- *Boot config.*\n [Boot config](/docs/core/architecture/bootloader/implementing-bootconfig)\n is available in Android 12 and higher and is a mechanism for passing\n configuration details from the build and bootloader to the operating system.\n Prior to Android 12, kernel command-line parameters with the prefix of\n `androidboot` are used.\n\n- *Over-the-air (OTA) updates.* Android devices in the field can receive and\n install OTA updates to the system, app software, and\n time zone rules. This feature has implications on your bootloader\n implementation. For general information on OTA, see\n [OTA updates](/docs/core/ota). For bootloader-specific OTA implementation\n details, see\n [Supporting OTA updates](/docs/core/architecture/bootloader/updating).\n\n- *Version binding* .\n [Version binding](/docs/security/features/keystore/version-binding) binds\n security keys to the operating system and patch level version. Version binding\n ensures that an attacker who discovers a weakness in an old version of the\n system or the TEE software can't roll a device back to the vulnerable version\n and use keys created with the newer version. The bootloader must provide certain\n information to support version binding. For further information, see\n [Version information in AVB properties](/docs/core/architecture/bootloader/version-info-avb).\n\nKernel command line\n-------------------\n\nConcatenate the kernel command line from the following locations:\n\n- Bootloader command line: set of static and dynamic parameters determined by\n the bootloader\n\n- Device tree: from the `chosen/bootargs` node\n\n- `defconfig`: from `CONFIG_CMDLINE`\n\n- `boot.img`: from the command line (for offsets and sized, refer to\n [`system/core/mkbootimg/bootimg.h`](https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/android16-release/include/bootimg/bootimg.h)\n\nAs of Android 12, for `androidboot.*` parameters that\nwe need to pass to Android userspace, we can use\n[bootconfig](/docs/core/architecture/bootloader/implementing-bootconfig) instead\nof the kernel command line."]]