diff options
author | Lukasz Majewski <lukma@denx.de> | 2018-05-11 16:51:18 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2018-06-18 15:44:21 +0200 |
commit | 0f05512d1135b034d09b058e2826d9c59cc26a7d (patch) | |
tree | 43410ece4c02757a1f932c63c279b816d2a421b4 /include/configs/display5.h | |
parent | bfb504bc7efb0bae6f0f8e865f79062d5ed6b014 (diff) |
display5: config: Add GPT verification and restoration code on SWUpdate entry
If GPT gets broken, then after N boot attempts we will run the SWUpdate
restoration image.
On its enter we will check GPT and restore it if needed.
To test it:
display5 > mmc write 0x12000000 4 8
It will overwrite the primary GPT table.
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'include/configs/display5.h')
-rw-r--r-- | include/configs/display5.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/configs/display5.h b/include/configs/display5.h index 1456cf497d..f3c8757385 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -144,6 +144,16 @@ "echo '#######################';" \ "echo '# RECOVERY SWUupdate #';" \ "echo '#######################';" \ + "echo '#######################';" \ + "echo '# GPT verify #';" \ + "if gpt verify mmc ${mmcdev} ${partitions}; then " \ + "echo '# OK ! #';" \ + "else " \ + "echo '# FAILED ! #';" \ + "echo '# GPT RESTORATION #';" \ + "gpt write mmc ${mmcdev} ${partitions};" \ + "fi;" \ + "echo '#######################';" \ "setenv loadaddr_swu_initramfs 0x14000000;" \ "setenv bootargs console=${console} " \ "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ |