summaryrefslogtreecommitdiff
path: root/debuggerd/handler/debuggerd_handler.cpp
diff options
context:
space:
mode:
authorSam Protsenko <semen.protsenko@linaro.org>2019-12-26 21:55:08 +0200
committerSam Protsenko <semen.protsenko@linaro.org>2020-01-03 18:03:04 +0200
commit2c7c3c7402827addf47686099e990161072b49e8 (patch)
treeb3425e335ac0d65ba3f17060d49fb77a56f1faab /debuggerd/handler/debuggerd_handler.cpp
parentaceb837ced74592aa5f5a6cbfbfa7821712b2540 (diff)
init: Fix writing "reboot recovery" to BCB
When BCB (bootloader message structure inside of misc partition) is malformed (contains some non-printable characters in its fields), "reboot recovery" command won't be able to write required string to "command" field. It can happen for example when partition table was created anew and 'misc' partition area contains some garbage. Also this behavior can be emulated with this command: $ fastboot erase misc which leads to 'misc' partition to be filled with 0xFF characters. Hence this code: if (boot.command[0] == '\0') { won't let us to set new string to "command" field. Let's check if "command" field is malformed and fix it, before actually checking for previously set content. "fastboot erase" shouldn't be used for testing purposes though, as it doesn't work sometimes due to alignment, on bootloader side: Erasing blocks 6144 to 6144 due to alignment ........ erased 0 bytes from 'misc' Instead one might use "dd" command to fill 'misc' with 0xFF's: $ dd if=/dev/zero ibs=2k count=1 | tr "\000" "\377" >misc.img $ fastboot flash misc misc.img Test: Fill 'misc' partition with 0xFF's, then do "adb reboot recovery" Change-Id: Ica8ca31012b9b2249645e7305830c07a20dd013c Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
0 files changed, 0 insertions, 0 deletions