]> git.sur5r.net Git - u-boot/commitdiff
display5: config: Add GPT verification and restoration code on SWUpdate entry
authorLukasz Majewski <lukma@denx.de>
Fri, 11 May 2018 14:51:18 +0000 (16:51 +0200)
committerStefano Babic <sbabic@denx.de>
Mon, 18 Jun 2018 13:44:21 +0000 (15:44 +0200)
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>
include/configs/display5.h

index 1456cf497d79e3bc102131d5cf71fe12958719b2..f3c875738563556ab87ff144da22bb2ea28c34f6 100644 (file)
        "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}" \