[oe-commits] org.oe.dev klibc: add missing patch

thesing commit openembedded-commits at lists.openembedded.org
Sun Mar 2 20:06:01 UTC 2008


klibc: add missing patch

Author: thesing at openembedded.org
Branch: org.openembedded.dev
Revision: 16882b53b725e8d7bfbf2d2909cfbf1f3a8a90fc
ViewMTN: http://monotone.openembedded.org/revision/info/16882b53b725e8d7bfbf2d2909cfbf1f3a8a90fc
Files:
1
packages/klibc/files/fstype-sane-vfat-and-jffs2-for-1.5.patch
Diffs:

#
# mt diff -r452ba8f483cc1f311d5139e2d406dd21e8edcce5 -r16882b53b725e8d7bfbf2d2909cfbf1f3a8a90fc
#
# 
# 
# add_file "packages/klibc/files/fstype-sane-vfat-and-jffs2-for-1.5.patch"
#  content [89bfe802816f7fdaf10df01ec23cd9b28f9380dc]
# 
============================================================
--- packages/klibc/files/fstype-sane-vfat-and-jffs2-for-1.5.patch	89bfe802816f7fdaf10df01ec23cd9b28f9380dc
+++ packages/klibc/files/fstype-sane-vfat-and-jffs2-for-1.5.patch	89bfe802816f7fdaf10df01ec23cd9b28f9380dc
@@ -0,0 +1,63 @@
+Index: klibc-1.5/usr/kinit/fstype/fstype.c
+===================================================================
+--- klibc-1.5.orig/usr/kinit/fstype/fstype.c	2008-02-28 00:48:35.319254938 +0100
++++ klibc-1.5/usr/kinit/fstype/fstype.c	2008-02-28 00:52:20.583257793 +0100
+@@ -20,7 +20,7 @@
+ #include <endian.h>
+ #include <netinet/in.h>
+ #include <sys/vfs.h>
+-
++#include <linux/types.h>
+ #define cpu_to_be32(x) __cpu_to_be32(x)	/* Needed by romfs_fs.h */
+ 
+ #include "romfs_fs.h"
+@@ -33,6 +33,12 @@
+ #include "lvm2_sb.h"
+ #include "iso9660_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.
+@@ -54,6 +60,27 @@
+ /* Swap needs the definition of block size */
+ #include "swap_fs.h"
+ 
++static int jffs2_image(const unsigned char *buf, unsigned long *blocks)
++{
++       // Very sloppy! ;-E
++       if (*buf == 0x85 && buf[1] == 0x19)
++               return 1;
++
++       return 0;
++}
++
++static int vfat_image(const unsigned char *buf, unsigned long *blocks)
++{
++        const struct romfs_super_block *sb =
++               (const struct romfs_super_block *)buf;
++       if (!strncmp(buf + 54, "FAT12   ", 8)
++           || !strncmp(buf + 54, "FAT16   ", 8)
++           || !strncmp(buf + 82, "FAT32   ", 8))
++               return 1;
++
++       return 0;
++}
++
+ static int gzip_image(const void *buf, unsigned long long *bytes)
+ {
+ 	const unsigned char *p = buf;
+@@ -277,6 +304,8 @@
+ 	{1, "ext3", ext3_image},
+ 	{1, "ext2", ext2_image},
+ 	{1, "minix", minix_image},
++	{0, "jffs2", jffs2_image},
++	{0, "vfat", vfat_image},
+ 	{8, "reiserfs", reiserfs_image},
+ 	{64, "reiserfs", reiserfs_image},
+ 	{32, "jfs", jfs_image},






More information about the Openembedded-commits mailing list