【读书笔记】https://source.android.google.cn/devices/bootloader

https://source.android.google.cn/devices/bootloader
本文主要记录aosp官网关于bootloader的相关资料
AuthorBlog:秋城https://www.cnblogs.com/houser0323/

Bootloader

A bootloader is a vendor-proprietary image responsible for bringing up the kernel on a device. It guards the device state and is responsible for initializing the Trusted Execution Environment (TEE) and binding >its root of trust.

The bootloader is comprised of many things including splash screen. To start boot, the bootloader may directly flash a new image into an appropriate partition or optionally use recovery to start the reflashing >process that will match how it is done for OTA. Some device manufacturers create multi-part bootloaders and then combine them into a single bootloader.img file. At flash time, the bootloader extracts the >individual bootloaders and flashes them all.

Most importantly, the bootloader verifies the integrity of the boot and recovery partitions before moving execution to the kernel and displays the warnings specified in the section Boot state.

我们目前ATV9是非A/B分区,到 ATV10的时候需要分区调整,应为system-as-root必须要求为A/B分区。
Android10会支持动态分区,即通过支持OTA升级的方式重新分区。

Partition Layout

In Android 10, the root file system is no longer included in ramdisk.img and is instead merged into system.img (that is, system.img is always created as if BOARD_BUILD_SYSTEM_ROOT_IMAGE was set). Devices >launching with Android 10:

Use a system-as-root partition layout (automatically enforced by the build with no options to change the behavior).
Must use a ramdisk, which is required for dm-linear.
Must set BOARD_BUILD_SYSTEM_ROOT_IMAGE to false. This setting is used only to differentiate between devices that use a ramdisk and devices that don't use a ramdisk (and instead mount system.img >directly).

The meaning of a system-as-root configuration differs between Android 9 and Android 10. In an Android 9 system-as-root configuration, BOARD_BUILD_SYSTEM_ROOT_IMAGE is set to true, which forces the build to >merge the root file system into system.img then mount system.img as the root file system (rootfs). This configuration is mandatory for devices launching with Android 9 but is optional for devices upgrading >to Android 9 and for devices running lower versions of Android. In an Android 10 system-as-root configuration, the build always merges $TARGET_SYSTEM_OUT and $TARGET_ROOT_OUT into system.img; this config is >the default behavior for all devices running Android 10.

Android 10 makes further changes to support dynamic partitions, a userspace partitioning system that enables over-the-air (OTA) updates to create, resize, or destroy partitions. As part of this change, the >Linux kernel can no longer mount the logical system partition on devices running Android 10, so this operation is handled by the first stage init.

在Android10中fastboot将从bootloader移动到用户空间,bootloader与recovery可合二为一

Moving Fastboot to User Space

Android 10 adds support for resizable partitions by relocating the fastboot implementation from bootloader to user space. This relocation enables moving the flashing code into a maintainable and testable >common location with only the vendor-specific parts of fastboot implemented by a Hardware Abstraction Layer (HAL).
Unified fastboot and recovery

Because userspace fastboot and recovery are similar, you can merge them into one partition/binary. Advantages include less space use and fewer partitions overall, as well as the ability for fastboot and >recovery to share their kernel and libraries.

To support fastbootd, the bootloader must implement a new boot control block (BCB) command of boot-fastboot. To enter fastbootd mode, bootloader should write boot-fastboot into the command field of the BCB >message and leave the recovery field of BCB unchanged (to enable restart of interrupted recovery tasks). The status, stage, and reserved fields remain unchanged as well. The bootloader is expected to load >and boot into the recovery image upon seeing boot-fastboot in the BCB command. Recovery then parses the BCB message and switches to fastbootd mode.

(0)

相关推荐

  • 斐讯N1盒子刷机安装ubuntu

    用到的设备 斐讯N1盒子 mac电脑 公对公usb线 16G U 盘 hdim线 显示器 准备工作 下载固件 网友提供的资源 文件分享 密码:nzwy53 下载系统文件 armbain 镜像: 下载地 ...

  • 这可能是酷安最详细的刷机教程了 来自 青雨染蓑衣

    #刷机# #玩机技巧# 之前看晨钟大佬吐槽好多小白,一点基础都没有,又有着一颗想折腾的心.遂打算写一篇教程,希望能够给真的小白一点帮助. 因个人水平有限,如有疏漏或错误,请各位大佬在评论区斧正,不胜感 ...

  • Android手机刷入Magisk的方法

    2020.3.24 介绍 这里引用来自少数派的一张图,所谓Magisk,在不改变系统分区的情况下,挂载一个与其文件系统隔离的Magisk分区,在必要的时候(或者说从系统角度而言)所作的一切从没有发生过 ...

  • 皮囊读书笔记,当没有倾听者时,它就是伙伴

    当没有倾听者时,你就与书对话,它就是你的伙伴. 书的前半段,我一直在思考,为什么叫皮囊,皮囊应该写的是, 我们的生命本来多轻盈,都是被这肉体和各种欲望的污浊给拖住. 从前面几章阿太和父亲的皮囊中似乎领 ...

  • 《大江东区》杂谈,读书笔记

    雷东宝出监狱,对小雷家重新安排,为了得到政府的支持,把小雷家镇政府所有制.对于人物的安排,士跟是不敢再用了,让红伟远走,隔了一大领军人物,提了一个后期新秀,让背后的一堆后期新秀站到了他队伍中,这就是权 ...

  • 读书笔记|为什么西方资本主义国家中,只有俄国爆发了社会主义革命?

    昨天看毛选的时候,想到一个问题:为什么在西方资本主义国家中,只有俄国爆发了十月革命,其它国家都没有社会主义革命? 一股君想到了三方面的因素: 1.俄国在西方列强中,本来就是较弱的一方,国内的资产阶级力 ...

  • 《游戏学》读书笔记(北大网研中心)

    《游戏学》读书笔记(北大网研中心)

  • 内在动机 读书笔记(非常不错)

    今天我们要讲的这本书很薄,但是分量很重.它是一本非常重要的书,跟每一个人都有关系.这本书叫作<内在动机>.   它的推荐人是我非常尊敬的清华大学的彭凯平教授.彭凯平教授说,"幸福 ...

  • 简放|读书笔记:跳空缺口买入点

    简放|读书笔记:跳空缺口买入点

  • 简放|读书笔记:口袋支点买入点

    简放|读书笔记:口袋支点买入点

  • 读书笔记之甘草泻心汤

    白塞氏综合征:经常口腔溃疡.生殖器溃疡,甚至全身多处溃疡. 原因:中医认为是狐惑病.多由感受湿热毒气所致,导致中阳受损,脾虚而聚湿生热,湿热内生而伤阴津. 方子:用甘草泻心汤加减.甘草20克(生).黄 ...

  • 经营战略全史:一部跨越百年的经营战略理念集结之作(读书笔记)

    前言 作为职场人士,尤其是负责策划的职场人都需要全面了解经营战略.只是片面知道科特勒.迈克尔·波特.艾·里斯和杰克特劳特等人的战略思想,均如盲人摸象一般,只知道经营战略的局部,不知道经营战略的本质,最 ...