Commit Graph

7 Commits

Author SHA1 Message Date
Alessandro Astone
5667feb0ac recovery: wipe bootloader message from index 0 when using custom offsets
* We may use a custom offset to:
   a) preserve data that oem wrote to the first bytes of misc
   b) skip recovery flags written by the bootloader (e.g. --wipe_data)

   For case a) one should set the offset 'x' to be at least greater than
   the size of bootloader_message struct (2048 bytes). If this is the case,
   then we zero out bytes x ~ x + 2047

   For case b) one should set the offset to be strictly smaller than
   the size of bootloader_message struct. If this is the case, then we
   zero out bytes 0 ~ 2047.
   This allows to clear any additional flag set by the bootloader,
   that would otherwise be forgotten in misc.
   This also guarantees that we do not involountarily wipe any data that
   the oem may have written starting at byte 2048 (coff coff LG)

Change-Id: I2d4e0702a2d8cbbef6274a87ce9499b0f69310dd
2019-12-22 21:20:48 +00:00
Alessandro Astone
7ec5fd9e6d recovery: Move bldrmsg offset symbols to bootloader_message.cpp
* bootloader_message.cpp is the only file using
  BOOTLOADER_MESSAGE_OFFSET_IN_MISC and WIPE_PACKAGE_OFFSET_IN_MISC,
  so we can move their definitions to the cpp.
  This prevents the need to set BOARD_RECOVERY_BLDRMSG_OFFSET
  in every module that includes the header.

* Global cflags are no longer supported Oreo and up,
  so set the BOARD_RECOVERY_BLDRMSG_OFFSET via make variable

* Simplify logic, always set BOARD_RECOVERY_BLDRMSG_OFFSET.

Change-Id: I2b902bcce7f5ca13472e0ac30ac01b4991294dbe
2019-12-22 20:21:16 +00:00
Ethan Yonker
606cc915f1 Fix compile error with IGNORE_MISC_WIPE_DATA in some trees
Change-Id: I4a57e4e90158d50a9e9c9aef8ed1da9ee9179554
2017-11-30 10:24:33 -06:00
Ethan Yonker
7c997913e2 Fix more compile errors in bootloader_message_twrp
Change-Id: I3b1b540f404efcd153d0b75d29e5b6ee8b0caa85
2017-11-30 07:24:06 -06:00
Ethan Yonker
917331b968 Fix build error in old 5.0 tree
Change-Id: I3faa0b6cc964a148dcc1bae7fdeba877fd795cf7
2017-11-28 22:28:27 -06:00
Ethan Yonker
32e803a474 Fix compile error in bootloader_message_twrp on 6.0 tree
Change-Id: Ifcfff60fab1cd73b524cd521a7094c344f8e9e1d
2017-11-18 08:10:51 -06:00
Ethan Yonker
8373cfe28c Update to AOSP 8.0 base
Change-Id: I29fe722b4eb9718765327902779046840a01433e
2017-09-08 07:14:59 -05:00