summaryrefslogtreecommitdiffstats
path: root/bootloader_message/include
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader_message/include')
-rw-r--r--bootloader_message/include/bootloader_message/bootloader_message.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h
index bc5104ddf..4ad18f2d9 100644
--- a/bootloader_message/include/bootloader_message/bootloader_message.h
+++ b/bootloader_message/include/bootloader_message/bootloader_message.h
@@ -65,6 +65,16 @@ struct bootloader_message {
char status[32];
char recovery[768];
+#ifdef USE_OLD_BOOTLOADER_MESSAGE
+ // The 'recovery' field used to be 1024 bytes. It has only ever
+ // been used to store the recovery command line, so 768 bytes
+ // should be plenty. We carve off the last 256 bytes to store the
+ // stage string (for multistage packages) and possible future
+ // expansion.
+ char stage[32];
+ char slot_suffix[32];
+ char reserved[192];
+#else
// The 'recovery' field used to be 1024 bytes. It has only ever
// been used to store the recovery command line, so 768 bytes
// should be plenty. We carve off the last 256 bytes to store the
@@ -77,13 +87,14 @@ struct bootloader_message {
// 1184-byte so that the entire bootloader_message struct rounds up
// to 2048-byte.
char reserved[1184];
+#endif
};
/**
* We must be cautious when changing the bootloader_message struct size,
* because A/B-specific fields may end up with different offsets.
*/
-#if (__STDC_VERSION__ >= 201112L) || defined(__cplusplus)
+#if !defined(USE_OLD_BOOTLOADER_MESSAGE) && ((__STDC_VERSION__ >= 201112L) || defined(__cplusplus))
static_assert(sizeof(struct bootloader_message) == 2048,
"struct bootloader_message size changes, which may break A/B devices");
#endif
@@ -116,7 +127,7 @@ struct bootloader_message_ab {
* Be cautious about the struct size change, in case we put anything post
* bootloader_message_ab struct (b/29159185).
*/
-#if (__STDC_VERSION__ >= 201112L) || defined(__cplusplus)
+#if !defined(USE_OLD_BOOTLOADER_MESSAGE) && ((__STDC_VERSION__ >= 201112L) || defined(__cplusplus))
static_assert(sizeof(struct bootloader_message_ab) == 4096,
"struct bootloader_message_ab size changes");
#endif