Initial module to interact with the android bcb.
PATCH v2 1/1 Initial module to interact with the android bcb.
Android uses a dedicated partition or mtd to handle communication between the bootloader and the recovery system, which handles system and firmware updates as well as factory resets. This is known as the bootloader control block, or "bcb".
The current form of the module allows the user to specify which partition should be used as the bcb, as well as reading the 'command' field of the message via the android_bcb_command env var. During a recovery operation, the recovery system populates the command field and only clears it once the operation is done, with the intended semantics being that the system reboots into recovery mode if the operation is interrupted. Thus, a grub configuration can check to see if android_bcb_command non-empty, and if so boot into recovery.
Future versions may give access to other fields, or allow write access.
--- grub-core/Makefile.core.def | 5 ++ grub-core/android/android_bcb.c | 104 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 grub-core/android/android_bcb.c
grub-core/Makefile.core.def +5 -0
@@ -2327,3 +2327,8 @@ module = { common = loader/i386/xen_file64.c; extra_dist = loader/i386/xen_fileXX.c; }; + +module = { + name = android_bcb; + common = android/android_bcb.c; +};
grub-core/android/android_bcb.c new file +104 -0
104 lines not on this page · raw message
Signature · 1 line
2.7.0