public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fat: Handle moved FAT32 root directory
@ 2011-06-10  7:36 Romain Izard
  0 siblings, 0 replies; only message in thread
From: Romain Izard @ 2011-06-10  7:36 UTC (permalink / raw)
  To: u-boot

The default location of the root directory in a FAT32 partition is the
same as its location in a FAT12/16 partition. But a difference is that
in FAT32, it is possible for the root directory to move.

This fix ensures that the parsing uses the root directory location
stored in the PBR, instead of always using the default location.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 fs/fat/fat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index c450bf6..22d34d3 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -798,6 +798,8 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
 	if (mydata->fatsize == 32) {
 		mydata->data_begin = mydata->rootdir_sect -
 					(mydata->clust_size * 2);
+		cursect = mydata->data_begin +
+				(root_cluster * mydata->clust_size);
 	} else {
 		rootdir_size = ((bs.dir_entries[1]  * (int)256 +
 				 bs.dir_entries[0]) *
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-10  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10  7:36 [U-Boot] [PATCH] fat: Handle moved FAT32 root directory Romain Izard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox