Skip to contentSkip to conversation

Support for devices with FAT32 PBR

PATCH Superseded Igor Luri 2 participants 4 messages May 10, 2010 – May 11, 2010 VFAT/FAT/msdos filesystem

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Igor Luri

author
#0 lore raw

PATCH v3 1/1 Support for devices with FAT32 PBR

---
 disk/part_dos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
disk/part_dos.c +2 -1
index 887b75e..d91f773 100644
@@ -77,7 +77,8 @@ static int test_block_type(unsigned char *buffer)
 	    (buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
 		return (-1);
 	} /* no DOS Signature at all */
-	if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+	if((strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0) ||
+	   (strncmp((char *)&buffer[DOS_PBR_FAT32_FSTYPE_OFFSET],"FAT32",5)==0)	)
 		return DOS_PBR; /* is PBR */
 	return DOS_MBR;	    /* Is MBR */
 }
Signature · 5 lines
1.5.4.3

---
 disk/part_dos.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
disk/part_dos.h +1 -0
index ac93f20..6383c58 100644
@@ -35,6 +35,7 @@
 #define DOS_PART_TBL_OFFSET	0x1be
 #define DOS_PART_MAGIC_OFFSET	0x1fe
 #define DOS_PBR_FSTYPE_OFFSET	0x36
+#define DOS_PBR_FAT32_FSTYPE_OFFSET	0x52
 #define DOS_PBR_MEDIA_TYPE_OFFSET	0x15
 #define DOS_MBR	0
 #define DOS_PBR	1
Signature · 5 lines
1.5.4.3

---
 fs/fat/fat.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
fs/fat/fat.c +5 -2
index 2445f1e..4da4351 100644
@@ -50,6 +50,7 @@ static int cur_part = 1;
 #define DOS_PART_TBL_OFFSET	0x1be
 #define DOS_PART_MAGIC_OFFSET	0x1fe
 #define DOS_FS_TYPE_OFFSET	0x36
+#define DOS_FS_FAT32_TYPE_OFFSET	0x52
 
 int disk_read (__u32 startblock, __u32 getsize, __u8 * bufptr)
 {
@@ -94,7 +95,8 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
 	if (!get_partition_info (dev_desc, part_no, &info)) {
 		part_offset = info.start;
 		cur_part = part_no;
-	} else if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3)) {
+	} else if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET], "FAT", 3) ||
+			   !strncmp((char *)&buffer[DOS_FS_FAT32_TYPE_OFFSET], "FAT32", 5)) {
 		/* ok, we assume we are on a PBR only */
 		cur_part = 1;
 		part_offset = 0;
@@ -105,7 +107,8 @@ fat_register_device(block_dev_desc_t *dev_desc, int part_no)
 	}
 
 #else
-	if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3)) {
+	if (!strncmp((char *)&buffer[DOS_FS_TYPE_OFFSET],"FAT",3) ||
+		!strncmp((char *)&buffer[DOS_FS_FAT32_TYPE_OFFSET], "FAT32", 5)	) {
 		/* ok, we assume we are on a PBR only */
 		cur_part = 1;
 		part_offset = 0;
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH v3 1/1 Support for devices with FAT32 PBR

Hello.

Quoted 11 lines · Igor Luri
---
 disk/part_dos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
disk/part_dos.c +0 -0
index 887b75e..d91f773 100644

disk/part_dos.c static int test_block_type(unsigned char *buffer) · line 84

Quoted 9 lines
disk/part_dos.c +2 -1
@@ -77,7 +77,8 @@ static int test_block_type(unsigned char *buffer)
 	    (buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
 		return (-1);
 	} /* no DOS Signature at all */
-	if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+	if((strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0) ||
+	   (strncmp((char *)&buffer[DOS_PBR_FAT32_FSTYPE_OFFSET],"FAT32",5)==0)	)
 		return DOS_PBR; /* is PBR */
 	return DOS_MBR;	    /* Is MBR */
 }

This was not a single patch, that was tree patches in the single
email. :-)

WBR, Sergei

author
#2 lore raw

PATCH v3 1/1 Support for devices with FAT32 PBR

Dear Sergei,

I have readen git-format-patch commands manual and I don't find any option to create a single patch, by default creates a patch per commit change.

How can I create a single patch?

I would apreciate any help.

Best regards.

El lun, 10-05-2010 a las 19:22 +0400, Sergei Shtylyov escribi?:

Quoted 31 lines

Hello.

Quoted 11 lines · Igor Luri
---
 disk/part_dos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
disk/part_dos.c +0 -0
index 887b75e..d91f773 100644

disk/part_dos.c static int test_block_type(unsigned char *buffer) · line 84

Quoted 9 lines
disk/part_dos.c +2 -1
@@ -77,7 +77,8 @@ static int test_block_type(unsigned char *buffer)
 	    (buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
 		return (-1);
 	} /* no DOS Signature at all */
-	if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+	if((strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0) ||
+	   (strncmp((char *)&buffer[DOS_PBR_FAT32_FSTYPE_OFFSET],"FAT32",5)==0)	)
 		return DOS_PBR; /* is PBR */
 	return DOS_MBR;	    /* Is MBR */
 }

This was not a single patch, that was tree patches in the single
email. :-)

WBR, Sergei

Signature · 9 lines
Igor Luri
R&D Software Department
Fagor Aotek S. Coop.
P. O. Box 144
E-20500 Mondrag?n-Arrasate
Tel.    ++34 943 71 92 00 
        ++34 943 71 92 01 (Ext. 44268)
Fax.    ++34 943 79 92 03
www.aotek.es
#3 lore raw

PATCH v3 1/1 Support for devices with FAT32 PBR

Hello.

Quoted 8 lines · Igor Luri

Dear Sergei,

I have readen git-format-patch commands manual and I don't find any option to create a single patch, by default creates a patch per commit change.

How can I create a single patch?

You need to redo your several commits as a single commit --
git-format-patch won't help here.

Quoted 37 lines

I would apreciate any help.

Best regards.

El lun, 10-05-2010 a las 19:22 +0400, Sergei Shtylyov escribi?:

Quoted 29 lines

Hello.

Quoted 12 lines · Igor Luri
---
 disk/part_dos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
disk/part_dos.c +0 -0
index 887b75e..d91f773 100644

disk/part_dos.c static int test_block_type(unsigned char *buffer) · line 84

Quoted 9 lines
disk/part_dos.c +2 -1
@@ -77,7 +77,8 @@ static int test_block_type(unsigned char *buffer)
 	    (buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
 		return (-1);
 	} /* no DOS Signature at all */
-	if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+	if((strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0) ||
+	   (strncmp((char *)&buffer[DOS_PBR_FAT32_FSTYPE_OFFSET],"FAT32",5)==0)	)
 		return DOS_PBR; /* is PBR */
 	return DOS_MBR;	    /* Is MBR */
 }

This was not a single patch, that was tree patches in the single
email. :-)

WBR, Sergei