summaryrefslogtreecommitdiffstats
path: root/src/fat.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-06-30 07:55:27 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-06-30 07:55:27 +0200
commite0f52d0d477f267bcbffad4feb17c3eceeb3575b (patch)
tree052d174acd073812cbc8f1e404170124ca1eb845 /src/fat.c
parentab41e37ba5fde8fa63dfaa9b898b2c9931156333 (diff)
FAT32 partition named EFI are now set as GPT_ENT_TYPE_EFI by default
Diffstat (limited to 'src/fat.c')
-rw-r--r--src/fat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fat.c b/src/fat.c
index 3eca20c..5a8a438 100644
--- a/src/fat.c
+++ b/src/fat.c
@@ -848,6 +848,7 @@ int recover_FAT(disk_t *disk_car, const struct fat_boot_sector*fat_header, parti
partition->sborg_offset=0;
partition->sb_size=512;
partition->sb_offset=0;
+ set_FAT_info(disk_car,fat_header,partition,verbose);
switch(partition->upart_type)
{
case UP_FAT12:
@@ -890,7 +891,10 @@ int recover_FAT(disk_t *disk_car, const struct fat_boot_sector*fat_header, parti
else
partition->part_type_i386=P_32FAT_LBA;
partition->part_type_mac=PMAC_FAT32;
- partition->part_type_gpt=GPT_ENT_TYPE_MS_BASIC_DATA;
+ if(memcmp(partition->fsname,"EFI",4)==0)
+ partition->part_type_gpt=GPT_ENT_TYPE_EFI;
+ else
+ partition->part_type_gpt=GPT_ENT_TYPE_MS_BASIC_DATA;
if(backup)
{
partition->sb_offset=6*512;
@@ -901,7 +905,6 @@ int recover_FAT(disk_t *disk_car, const struct fat_boot_sector*fat_header, parti
log_critical("recover_FAT unknown FAT type\n");
return 1;
}
- set_FAT_info(disk_car,fat_header,partition,verbose);
return 0;
}