1 diff -r 3c9d84425ba7 utils/fstype.c
2 --- a/utils/fstype.c Thu Feb 14 02:09:30 2008 +0200
3 +++ b/utils/fstype.c Thu Feb 14 02:13:46 2008 +0200
8 +#include <linux/types.h>
13 #include <netinet/in.h>
14 +#if __BYTE_ORDER == __BIG_ENDIAN
15 +#include <linux/byteorder/big_endian.h>
17 +#include <linux/byteorder/little_endian.h>
21 #define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */
23 @@ -105,6 +112,27 @@ static int romfs_image(const unsigned ch
27 +static int jffs2_image(const unsigned char *buf, unsigned long *blocks)
30 + if (*buf == 0x85 && buf[1] == 0x19)
36 +static int vfat_image(const unsigned char *buf, unsigned long *blocks)
38 + const struct romfs_super_block *sb =
39 + (const struct romfs_super_block *)buf;
40 + if (!strncmp(buf + 54, "FAT12 ", 8)
41 + || !strncmp(buf + 54, "FAT16 ", 8)
42 + || !strncmp(buf + 82, "FAT32 ", 8))
48 static int minix_image(const unsigned char *buf, unsigned long *blocks)
50 const struct minix_super_block *sb =
51 @@ -167,8 +195,6 @@ static int xfs_image(const unsigned char
52 (const struct xfs_sb *)buf;
54 if (__be32_to_cpu(sb->sb_magicnum) == XFS_SB_MAGIC) {
55 - *blocks = __be64_to_cpu(sb->sb_dblocks) *
56 - (__be32_to_cpu(sb->sb_blocksize) / BLOCK_SIZE);
60 @@ -184,6 +210,8 @@ static struct imagetype images[] = {
61 { 0, "gzip", gzip_image },
62 { 0, "cramfs", cramfs_image },
63 { 0, "romfs", romfs_image },
64 + { 0, "jffs2", jffs2_image },
65 + { 0, "vfat", vfat_image },
66 { 0, "xfs", xfs_image },
67 { 1, "minix", minix_image },
68 { 1, "ext3", ext3_image },