diff options
author | Zahari Doychev <zahari.doychev@linux.com> | 2014-11-04 08:54:01 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-11-05 14:53:28 +0100 |
commit | f95ce0fff0775c04954ae2e4542308baaa434ac8 (patch) | |
tree | 72266c00d1af91a67d6be1d327d799a91dfbc386 /include/filetype.h | |
parent | c0d6aa097d8f32102f1a7034a9b230ff6a3d469b (diff) | |
download | barebox-f95ce0fff0775c04954ae2e4542308baaa434ac8.tar.gz barebox-f95ce0fff0775c04954ae2e4542308baaa434ac8.tar.xz |
common: fix mbr filetype detection
Sometimes mbr is erroneously recocognised as FAT partion. Due to this the mbr
partition parser is not being called and the partitions on the media are not
detected. This patch should fix the problem. The checking is done as in the
linux kernel.
I have seen the problem using usb sticks. Although partitioning and formatting
them under linux. The file system type field in the mbr remains there which
causes the wrong detections as FAT32 type and not as mbr.
Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/filetype.h')
-rw-r--r-- | include/filetype.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/filetype.h b/include/filetype.h index eedf4b4afe..2c3c38ddd8 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -44,6 +44,7 @@ enum filetype file_detect_partition_table(const void *_buf, size_t bufsize); enum filetype file_detect_type(const void *_buf, size_t bufsize); enum filetype file_name_detect_type(const char *filename); enum filetype is_fat_or_mbr(const unsigned char *sector, unsigned long *bootsec); +int is_fat_boot_sector(const void *_buf); #define ARM_HEAD_SIZE 0x30 #define ARM_HEAD_MAGICWORD_OFFSET 0x20 |