[PATCH 1/3] PReP FAT support

Leonardo Rangel lrangel at linux.vnet.ibm.com
Fri Nov 9 04:48:58 EST 2007


On this first part, we detect many types of FAT filesystems and add  
them in partition_fdisk_lookup



Index: yaboot/include/fdisk-part.h
===================================================================
--- yaboot.orig/include/fdisk-part.h    2007-11-08 11:48:11.000000000 -0200
+++ yaboot/include/fdisk-part.h 2007-11-08 11:48:27.000000000 -0200
@@ -29,6 +29,19 @@
  #define LINUX_EXTENDED  0x85
  #define LINUX_RAID      0xfd

+#define FAT12                   0x01
+#define FAT16_LT32              0x04
+#define FAT16                   0x06
+#define W95_FAT32               0x0b
+#define W95_FAT32_LBA           0x0c
+#define W95_FAT16_LBA           0x0e
+#define HIDDEN_FAT12            0x11
+#define HIDDEN_FAT16_LT32       0x14
+#define HIDDEN_FAT16            0x16
+#define HIDDEN_W95_FAT32        0x1b
+#define HIDDEN_W95_FAT32_LBA    0x1c
+#define HIDDEN_W95_FAT16_LBA    0x1e
+#define EFI_FAT12_16_32         0xef
  struct fdisk_partition {
     unsigned char boot_ind;         /* 0x80 - active */
     unsigned char head;             /* starting head */
Index: yaboot/second/partition.c
===================================================================
--- yaboot.orig/second/partition.c  2007-11-08 11:48:58.000000000 -0200
+++ yaboot/second/partition.c   2007-11-08 11:51:02.000000000 -0200
@@ -179,7 +179,30 @@
                    le32_to_cpu(*(unsigned int *)part->size4),
                    512 /*blksize*/,
                    part->sys_ind /* partition type */ );
-     }
+
+              continue;
+         }
+
+         char fats[] = { FAT12, FAT16_LT32, FAT16, W95_FAT32, W95_FAT32_LBA,\
+          W95_FAT16_LBA, HIDDEN_FAT12, HIDDEN_FAT16_LT32, HIDDEN_FAT16,\
+          HIDDEN_W95_FAT32, HIDDEN_W95_FAT32_LBA, HIDDEN_W95_FAT16_LBA,\
+          EFI_FAT12_16_32 };
+         int fat;
+         for (fat = 0; fat < sizeof(fats); fat++ )
+                 if ( part->sys_ind == fats[fat] ) {
+                         DEBUG_F("found fat partition: %d\n", partition);
+                         add_new_partition(
+                               list,
+                               partition,
+                               "Fat",
+                               '\0',
+                               swab32(*(unsigned int *)(part->start4)),
+                               swab32(*(unsigned int *)(part->size4)),
+                               512 /*blksize*/,
+                               part->sys_ind /* partition type */ );
+                         break;
+
+                }
       }
  }






More information about the Yaboot-devel mailing list