doc: misc and BootControl
parent
5f9f17601d
commit
2665fd0098
@ -0,0 +1,63 @@
|
|||||||
|
@startuml
|
||||||
|
|
||||||
|
package services {
|
||||||
|
class android_hardware_boot_1_1_service {
|
||||||
|
*cc_binary
|
||||||
|
}
|
||||||
|
class android_hardware_boot_1_0_service {
|
||||||
|
*cc_binary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
package impls {
|
||||||
|
class android_hardware_boot_1_0_impl {
|
||||||
|
*cc_library
|
||||||
|
}
|
||||||
|
|
||||||
|
class android_hardware_boot_1_1_impl {
|
||||||
|
*cc_library
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
package hidl_interface {
|
||||||
|
class android_hardware_boot_1_0 {
|
||||||
|
*hidl_interface
|
||||||
|
}
|
||||||
|
|
||||||
|
class android_hardware_boot_1_1 {
|
||||||
|
*hidl_interface
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
android_hardware_boot_1_0_impl --> android_hardware_boot_1_0
|
||||||
|
|
||||||
|
android_hardware_boot_1_0_service --> android_hardware_boot_1_0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
android_hardware_boot_1_1_impl --> android_hardware_boot_1_0
|
||||||
|
android_hardware_boot_1_1_impl --> android_hardware_boot_1_1
|
||||||
|
android_hardware_boot_1_1_impl --> libboot_control
|
||||||
|
android_hardware_boot_1_1_impl ..> libboot_control_defaults
|
||||||
|
|
||||||
|
|
||||||
|
android_hardware_boot_1_1_service --> android_hardware_boot_1_0
|
||||||
|
android_hardware_boot_1_1_service --> android_hardware_boot_1_1
|
||||||
|
class libboot_control_defaults {
|
||||||
|
*cc_defaults
|
||||||
|
}
|
||||||
|
libboot_control_defaults --> android_hardware_boot_1_1
|
||||||
|
libboot_control_defaults --> libbootloader_message_vendor
|
||||||
|
class libboot_control {
|
||||||
|
*cc_library_static
|
||||||
|
}
|
||||||
|
libboot_control ..> libboot_control_defaults
|
||||||
|
class bootctrl_default {
|
||||||
|
*cc_library
|
||||||
|
}
|
||||||
|
bootctrl_default --> libboot_control
|
||||||
|
bootctrl_default ..> libboot_control_defaults
|
||||||
|
@enduml
|
@ -1,20 +1,94 @@
|
|||||||
# /misc partition layout
|
# /misc partition layout
|
||||||
|
|
||||||
| - | - | - | size | description |
|
| - | - | - | Offset | Size | description |
|
||||||
| :---- | :------ | :---- | :---- | :---- |
|
| :---- | :------ | :---- | :---- | :---- | ----- |
|
||||||
| bootloader_message_ab | | | 4096 | |
|
| Legacy | bootloader_message | | 0 | (2K) | |
|
||||||
| | bootloader_message | | 2048 | |
|
| | |command | | 32 |updated by linux/bootloader |
|
||||||
| | |command | 32 |updated by linux/bootloader |
|
| | |status | | 32 |deprecated |
|
||||||
| | |status | 32 |deprecated |
|
| | |recovery | |768 |talking channel between normal/recovery modes |
|
||||||
| | |recovery |768 |talking channel between normal/recovery modes |
|
| | |stage | | 32 |format "#/#", eg, "1/3" |
|
||||||
| | |stage | 32 |format "#/#", eg, "1/3" |
|
| | |reserved | | 1184| |
|
||||||
| | |reserved | 1184| |
|
| - | - |- | - | - | - |
|
||||||
| |slot_suffix | | 32| |
|
| Vendor Area | vendor bootloader msg | N/A | 2K | 2K | Vendor Area |
|
||||||
| |update_channel | |128 | |
|
| | vendor bootloader msg | N/A | 4K | 12K | pure Vendor area |
|
||||||
| |reserved | | 1888| |
|
| - | - | - | - | - | - |
|
||||||
| | | | | |
|
| Wipe | wipe_package info | | 16K | 16K | offset 16KB, Used by uncrypt and recovery to store wipe_package for A/B devices |
|
||||||
| vendor bootloader msg | | | 12 KB | offset 4kB |
|
| - | - | - | - | - | - |
|
||||||
| wipe_package info | | | 48K | offset 16KB, Used by uncrypt and recovery to store wipe_package for A/B devices |
|
| System | system_space -> 1<br>misc_virtual_ab_message | | | (64) | |
|
||||||
|- |- |- |- |- |
|
| | | version | | 1 | |
|
||||||
| | | | | |
|
| | | magic | | 4 | |
|
||||||
|
| | | merge_status | | 1 | |
|
||||||
|
| | | source_slot | | 1 | |
|
||||||
|
| | | reserved | | 57 | |
|
||||||
|
| | | | | | |
|
||||||
|
| | | | | | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### vendor area implementation example from Google:
|
||||||
|
|
||||||
|
|
||||||
|
#### bootctrl.default.so (link libboot_control.a)貌似没人用
|
||||||
|
|
||||||
|
|
||||||
|
使用legacy_boot_control.cpp, 把libboot_control.a的实现的类android::bootable::BootControl包装进去
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### android.hardware.boot@1.1-impl
|
||||||
|
|
||||||
|
使用BootControl.cpp
|
||||||
|
|
||||||
|
```
|
||||||
|
android::hardware::boot::V1_1::implementation::BootControl
|
||||||
|
```
|
||||||
|
直接使用"android::bootable::BootControl"的实现
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### libboot_control.a
|
||||||
|
|
||||||
|
code location:
|
||||||
|
|
||||||
|
```hardware/interfaces/boot/1.1/default/boot_control```
|
||||||
|
|
||||||
|
https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/master/boot/1.1/default/boot_control/
|
||||||
|
|
||||||
|
| - | - | - | Offset | Size | description |
|
||||||
|
| :---- | :------ | :---- | :---- | :---- | ----- |
|
||||||
|
| Vendor Area | bootloader_message_ab | | 2K | (2K) | Vendor Area |
|
||||||
|
| | | slot_suffix | | 32| |
|
||||||
|
| | | update_channel | |128 | |
|
||||||
|
| | | reserved | | 1888| |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 32 BYTES "slot_suffix" part details:
|
||||||
|
|
||||||
|
| - | - | - | Offset | Size | description |
|
||||||
|
| :---- | :------ | :---- | :---- | :---- | ----- |
|
||||||
|
| | bootloader_control | | | (32) | |
|
||||||
|
| | | slot_suffix | | 4 | |
|
||||||
|
| | | magic | | 4 | |
|
||||||
|
| | | version | | 1 | |
|
||||||
|
| | | nb_slot | | 3bits | number slots |
|
||||||
|
| | | recovery_tries_remaining | | 3bits | |
|
||||||
|
| | | merge_status | | 3bits | |
|
||||||
|
| | | reserved0 | | 1 | |
|
||||||
|
| | | slot_info | | 8 | slot_metadata * 4 |
|
||||||
|
| | | reverved1 | | 8 | |
|
||||||
|
| | | crc32_le | | 4 | |
|
||||||
|
| | | | | | |
|
||||||
|
| | slot_metadata | | | (2) | |
|
||||||
|
| | | priority | | 4bits | |
|
||||||
|
| | | tries_remaining | | 3bits | |
|
||||||
|
| | | successful_boot | | 1bit | |
|
||||||
|
| | | verity_corrupted | | 1bit | |
|
||||||
|
| | | reserved | | 7bits | |
|
||||||
|
| | | | | | |
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue