[U-Boot] [PATCH 1/1] disk: part_dos: correctly detect DOS PBR
Tom Rini
trini at konsulko.com
Fri Nov 1 13:30:18 UTC 2019
On Tue, Oct 15, 2019 at 08:43:42PM +0200, Heinrich Schuchardt wrote:
> The signature 0x55 0xAA in bytes 510 and 511 of the first sector can either
> indicate a DOS partition table of the first sector of a FAT file system.
>
> The current code tries to check if the partition table is valid by looking
> at the boot indicator of the partition entries. But first of all it does
> not count from 0 to 3 but only from 0 to 2. And second it misses to
> increment the pointer for the partition entry.
>
> If it is a FAT file system can be discovered by looking for the text 'FAT'
> at offset 0x36 or 'FAT32' at offset 0x52. In a DOS PBR there are no
> partition entries, so those bytes are undefined. Don't require the byte at
> offset 0x1BE to differ from 0x00 and 0x80.
>
> With the patch the logic is changed as follows:
>
> If the partition table has either an invalid boot flag for any partition or
> has no partition at all, check if the first sector is a DOS PBR by looking
> at the FAT* signature.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191101/267a64af/attachment.sig>
More information about the U-Boot
mailing list