[U-Boot] disk: efi: Correct backing up the MBR boot code

Tom Rini trini at konsulko.com
Wed Jun 6 11:15:54 UTC 2018


On Tue, May 22, 2018 at 02:04:21AM +0300, Sam Protsenko wrote:

> In commit e163a931af34 ("cmd: gpt: backup boot code before writing MBR")
> there was added the procedure for storing old boot code when doing "gpt
> write". But instead of storing just backup code, the whole MBR was
> stored, and only specific fields were replaced further, keeping
> everything else intact. That's obviously not what we want.
> 
> Fix the code to actually store only old boot code and zero out
> everything else. This fixes next testing case:
> 
>     => mmc write $loadaddr 0x0 0x7b
>     => gpt write mmc 1 $partitions
> 
> In case when $loadaddr address and further memory contains 0xff, the
> board was bricked (ROM-code probably didn't like partition entries that
> were clobbered with 0xff). With this patch applied, commands above don't
> brick the board.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> Cc: Alejandro Hernandez <ajhernandez at ti.com>
> Tested-by: Andy Shevchenko <andy.shevchenko at gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180606/8d1d131e/attachment.sig>


More information about the U-Boot mailing list