From: Tom Rini Date: Wed, 6 Jun 2018 07:15:54 -0400 Subject: [U-Boot] disk: efi: Correct backing up the MBR boot code In-Reply-To: <20180521230421.4627-1-semen.protsenko@linaro.org> References: <20180521230421.4627-1-semen.protsenko@linaro.org> Message-ID: <20180606111554.GX21194@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Cc: Alejandro Hernandez > Tested-by: Andy Shevchenko 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: