summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-12-16 21:35:13 -0800
committerTianjie Xu <xunchang@google.com>2020-02-26 12:16:22 -0800
commit19e876f0b53c09a25693e2a5687864ad3e91830d (patch)
tree75ff501441cb431ee26327453d65654fb1ae0bca
parented1c6372f90e6dcdb5280cebdd6d9350864ed722 (diff)
downloadextras-19e876f0b53c09a25693e2a5687864ad3e91830d.tar.gz
Remove the dependency on bootloader_message
Now that we move libboot_control to boot/1.1, the definition of bootloader_message_ab will hide behind the implementation details for vendor HALs. As this library isn't used in practice, we just inline the offset here. Bug: 131775112 Test: build Change-Id: I64babcad6a421cab5858ab818f392eca196a0fe2 (cherry picked from commit b6934a07d2b7e0d41a15ff29bd6b157e7c2993c4)
-rw-r--r--boot_control_copy/Android.bp1
-rw-r--r--boot_control_copy/bootinfo.cpp20
2 files changed, 14 insertions, 7 deletions
diff --git a/boot_control_copy/Android.bp b/boot_control_copy/Android.bp
index a6712087..6c9dbc24 100644
--- a/boot_control_copy/Android.bp
+++ b/boot_control_copy/Android.bp
@@ -20,7 +20,6 @@ cc_library_shared {
"libcutils",
],
static_libs: [
- "libbootloader_message",
"libfs_mgr",
],
}
diff --git a/boot_control_copy/bootinfo.cpp b/boot_control_copy/bootinfo.cpp
index 364c1985..55319178 100644
--- a/boot_control_copy/bootinfo.cpp
+++ b/boot_control_copy/bootinfo.cpp
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <string.h>
-#include <bootloader_message/bootloader_message.h>
#include <cutils/properties.h>
#include <fs_mgr.h>
@@ -106,11 +105,20 @@ int boot_info_open_partition(const char *name, uint64_t *out_size, int flags)
}
// As per struct bootloader_message_ab which is defined in
-// bootable/recovery/bootloader.h we can use the 32 bytes in the
-// bootctrl_suffix field provided that they start with the active slot
-// suffix terminated by NUL. It just so happens that BrilloBootInfo is
-// laid out this way.
-#define BOOTINFO_OFFSET offsetof(struct bootloader_message_ab, slot_suffix)
+// boot/1.1/default.
+// struct bootloader_message_ab {
+// struct bootloader_message message;
+// char slot_suffix[32];
+// char update_channel[128];
+//
+// // Round up the entire struct to 4096-byte.
+// char reserved[1888];
+// };
+//
+// We can use the 32 bytes in the bootctrl_suffix field provided that they
+// start with the active slot suffix terminated by NUL. It just so happens
+// that BrilloBootInfo is laid out this way.
+#define BOOTINFO_OFFSET 2048
bool boot_info_load(BrilloBootInfo *out_info)
{