aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch')
-rw-r--r--meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch b/meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch
new file mode 100644
index 0000000000..3fec98d2cc
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/fstype-sane-vfat-and-jffs2-for-1.5.patch
@@ -0,0 +1,74 @@
+Patch was imported from the OpenEmbedded git server
+(git://git.openembedded.org/openembedded)
+as of commit id 2a98e2a2c1b55a0eb0ac09f2f9b55db2e4c23553
+Signed-off-by: Thomas Kunze <thommycheck@gmx.de>
+Refresh and fixes as of commit id 5dbd8d611f3cb7eb8baddb17211d6077e2060fdb
+Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
+
+Index: klibc-1.5.22/usr/kinit/fstype/fstype.c
+===================================================================
+--- a/usr/kinit/fstype/fstype.c
++++ b/usr/kinit/fstype/fstype.c
+@@ -20,7 +20,7 @@
+ #include <netinet/in.h>
+ #include <sys/utsname.h>
+ #include <sys/vfs.h>
+-
++#include <linux/types.h>
+ #define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */
+
+ #include "btrfs.h"
+@@ -38,6 +38,12 @@
+ #include "squashfs_fs.h"
+ #include "xfs_sb.h"
+
++#if __BYTE_ORDER == __BIG_ENDIAN
++#include <linux/byteorder/big_endian.h>
++#else
++#include <linux/byteorder/little_endian.h>
++#endif
++
+ /*
+ * Slightly cleaned up version of jfs_superblock to
+ * avoid pulling in other kernel header files.
+@@ -60,6 +66,30 @@
+ /* Swap needs the definition of block size */
+ #include "swap_fs.h"
+
++static int jffs2_image(const void *buf, unsigned long long *blocks)
++{
++ const unsigned char *p = buf;
++
++ if (p[0] == 0x85 && p[1] == 0x19) {
++ *blocks=0;
++ return 1;
++ }
++ return 0;
++}
++
++static int vfat_image(const void *buf, unsigned long long *blocks)
++{
++ const char *p = buf;
++
++ if (!strncmp(p + 54, "FAT12 ", 8)
++ || !strncmp(p + 54, "FAT16 ", 8)
++ || !strncmp(p + 82, "FAT32 ", 8)) {
++ *blocks=0;
++ return 1;
++ }
++ return 0;
++}
++
+ static int gzip_image(const void *buf, unsigned long long *bytes)
+ {
+ const unsigned char *p = buf;
+@@ -495,6 +525,8 @@ static struct imagetype images[] = {
+ {1, "ext3", ext3_image},
+ {1, "ext2", ext2_image},
+ {1, "minix", minix_image},
++ {0, "jffs2", jffs2_image},
++ {0, "vfat", vfat_image},
+ {1, "nilfs2", nilfs2_image},
+ {2, "ocfs2", ocfs2_image},
+ {8, "reiserfs", reiserfs_image},
+