From: Tom Rini Date: Fri, 1 Nov 2019 09:30:18 -0400 Subject: [U-Boot] [PATCH 1/1] disk: part_dos: correctly detect DOS PBR In-Reply-To: <20191015184342.10530-1-xypron.glpk@gmx.de> References: <20191015184342.10530-1-xypron.glpk@gmx.de> Message-ID: <20191101133018.GE11173@bill-the-cat> 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, 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 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: