diff options
author | Franck Jullien <franck.jullien@gmail.com> | 2012-09-19 13:09:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-20 08:57:58 +0200 |
commit | 010ee209b75c5732ae4144e3ee9ce14158193c1f (patch) | |
tree | 1bff850f196d666b8bdbc98a09b8bd3e37354c95 /include/filetype.h | |
parent | dadcac8b382cd912199530f6e5920c7232f7ae1f (diff) | |
download | barebox-010ee209b75c5732ae4144e3ee9ce14158193c1f.tar.gz barebox-010ee209b75c5732ae4144e3ee9ce14158193c1f.tar.xz |
filetype: Improve FAT detection
We may have some disk with MBR as a first sector. In this case, the
current FAT check returns an error. However, the FAT sector exist and
the MBR can tell us where it is.
This patch add to file_name_detect_type function the ability to find
the FAT boot sector on the first sector of the first partition in case
it is not on sector 0.
It also introduce is_fat_or_mbr to check if a buffer is a FAT boot
or MBR sector
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/filetype.h')
-rw-r--r-- | include/filetype.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/filetype.h b/include/filetype.h index 179ec0f5eb..37eb62020d 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -19,10 +19,12 @@ enum filetype { filetype_sh, filetype_mips_barebox, filetype_fat, + filetype_mbr, }; const char *file_type_to_string(enum filetype f); enum filetype file_detect_type(void *_buf); enum filetype file_name_detect_type(const char *filename); +enum filetype is_fat_or_mbr(const unsigned char *sector, unsigned long *bootsec); #endif /* __FILE_TYPE_H */ |