diff options
Diffstat (limited to 'tools/yaffs2/patches')
-rw-r--r-- | tools/yaffs2/patches/.svn/entries | 96 | ||||
-rw-r--r-- | tools/yaffs2/patches/.svn/text-base/100-compile.patch.svn-base | 125 | ||||
-rw-r--r-- | tools/yaffs2/patches/.svn/text-base/110-openbsd-compat.patch.svn-base | 14 | ||||
-rw-r--r-- | tools/yaffs2/patches/100-compile.patch | 125 | ||||
-rw-r--r-- | tools/yaffs2/patches/110-openbsd-compat.patch | 14 |
5 files changed, 374 insertions, 0 deletions
diff --git a/tools/yaffs2/patches/.svn/entries b/tools/yaffs2/patches/.svn/entries new file mode 100644 index 0000000..e856586 --- /dev/null +++ b/tools/yaffs2/patches/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/tools/yaffs2/patches +svn://svn.openwrt.org/openwrt + + + +2013-03-07T17:32:29.455175Z +35900 +nbd + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +100-compile.patch +file + + + + +2013-03-17T12:13:22.000000Z +7ffcfe8daece9d1d406cf30d74b559c9 +2010-07-22T02:59:14.592651Z +22345 +jow + + + + + + + + + + + + + + + + + + + + + +3828 + +110-openbsd-compat.patch +file + + + + +2013-03-17T12:13:22.000000Z +b8e97f27e17f2604d8191d5dcf038e1f +2013-03-07T17:32:29.455175Z +35900 +nbd + + + + + + + + + + + + + + + + + + + + + +552 + diff --git a/tools/yaffs2/patches/.svn/text-base/100-compile.patch.svn-base b/tools/yaffs2/patches/.svn/text-base/100-compile.patch.svn-base new file mode 100644 index 0000000..2f83e1f --- /dev/null +++ b/tools/yaffs2/patches/.svn/text-base/100-compile.patch.svn-base @@ -0,0 +1,125 @@ +--- a/yaffs2/utils/Makefile ++++ b/yaffs2/utils/Makefile +@@ -16,12 +16,11 @@ + + #KERNELDIR = /usr/src/kernel-headers-2.4.18 + +-CFLAGS = -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL +-CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations +-CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline ++CPPFLAGS = -I.. -DCONFIG_YAFFS_UTIL ++CFLAGS = -O2 + + ## Change if you are using a cross-compiler +-MAKETOOLS = ++MAKETOOLS = + + CC=$(MAKETOOLS)gcc + +@@ -41,7 +40,7 @@ $(COMMONLINKS) $(MKYAFFSLINKS) $(MKYAFFS + ln -s ../$@ $@ + + $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c +- $(CC) -c $(CFLAGS) $< -o $@ ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + + mkyaffsimage: $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) + $(CC) -o $@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) +--- a/yaffs2/utils/mkyaffs2image.c ++++ b/yaffs2/utils/mkyaffs2image.c +@@ -32,8 +32,6 @@ + #include <string.h> + #include <unistd.h> + +-#include <private/android_filesystem_config.h> +- + #include "yaffs_ecc.h" + #include "yaffs_guts.h" + +@@ -69,10 +67,12 @@ static int outFile; + + static int error; + +-#ifdef HAVE_BIG_ENDIAN ++#if BYTE_ORDER == BIG_ENDIAN + static int convert_endian = 1; +-#elif defined(HAVE_LITTLE_ENDIAN) ++#elif BYTE_ORDER == LITTLE_ENDIAN + static int convert_endian = 0; ++#else ++#error Unknown endian type + #endif + + static int obj_compare(const void *a, const void * b) +@@ -298,8 +298,8 @@ static int write_object_header(int objId + + static void fix_stat(const char *path, struct stat *s) + { +- path += source_path_len; +- fs_config(path, S_ISDIR(s->st_mode), &s->st_uid, &s->st_gid, &s->st_mode); ++ s->st_uid = 0; ++ s->st_gid = 0; + } + + static int process_directory(int parent, const char *path, int fixstats) +@@ -342,9 +342,8 @@ static int process_directory(int parent, + newObj = obj_id++; + nObjects++; + +- if (fixstats) { ++ if (fixstats) + fix_stat(full_name, &stats); +- } + + //printf("Object %d, %s is a ",newObj,full_name); + +@@ -473,13 +472,13 @@ int main(int argc, char *argv[]) + fprintf(stderr," -f fix file stat (mods, user, group) for device\n"); + fprintf(stderr," dir the directory tree to be converted\n"); + fprintf(stderr," image_file the output file to hold the image\n"); +- fprintf(stderr," 'convert' produce a big-endian image from a little-endian machine\n"); ++ fprintf(stderr," 'convert' produce a big-endian image\n"); + exit(1); + } + + if ((argc == 4) && (!strncmp(argv[3], "convert", strlen("convert")))) + { +- convert_endian = 1; ++ convert_endian = !convert_endian; + } + + if(stat(argv[1],&stats) < 0) +@@ -503,20 +502,9 @@ int main(int argc, char *argv[]) + exit(1); + } + +- if (fixstats) { +- int len = strlen(argv[1]); +- +- if((len >= 4) && (!strcmp(argv[1] + len - 4, "data"))) { +- source_path_len = len - 4; +- } else if((len >= 7) && (!strcmp(argv[1] + len - 6, "system"))) { +- source_path_len = len - 6; +- } else { +- fprintf(stderr,"Fixstats (-f) option requested but filesystem is not data or android!\n"); +- exit(1); +- } ++ if (fixstats) + fix_stat(argv[1], &stats); +- } +- ++ + //printf("Processing directory %s into image file %s\n",argv[1],argv[2]); + error = write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL); + if(error) +--- a/yaffs2/devextras.h ++++ b/yaffs2/devextras.h +@@ -37,7 +37,7 @@ typedef unsigned char __u8; + typedef unsigned short __u16; + typedef unsigned __u32; + +-#if defined(__APPLE__) ++#if defined(__APPLE__) || defined(__FreeBSD__) + typedef long long loff_t; + #endif + diff --git a/tools/yaffs2/patches/.svn/text-base/110-openbsd-compat.patch.svn-base b/tools/yaffs2/patches/.svn/text-base/110-openbsd-compat.patch.svn-base new file mode 100644 index 0000000..cfafc1c --- /dev/null +++ b/tools/yaffs2/patches/.svn/text-base/110-openbsd-compat.patch.svn-base @@ -0,0 +1,14 @@ +diff -Nur yaffs2_android.orig/yaffs2/yaffs_guts.h yaffs2_android/yaffs2/yaffs_guts.h +--- yaffs2_android.orig/yaffs2/yaffs_guts.h Sun Feb 15 16:23:50 2009 ++++ yaffs2_android/yaffs2/yaffs_guts.h Tue Mar 5 15:45:21 2013 +@@ -823,6 +823,10 @@ + int yaffs_SetAttributes(yaffs_Object * obj, struct iattr *attr); + int yaffs_GetAttributes(yaffs_Object * obj, struct iattr *attr); + ++#if defined(__OpenBSD__) ++#define loff_t off_t ++#endif ++ + /* File operations */ + int yaffs_ReadDataFromFile(yaffs_Object * obj, __u8 * buffer, loff_t offset, + int nBytes); diff --git a/tools/yaffs2/patches/100-compile.patch b/tools/yaffs2/patches/100-compile.patch new file mode 100644 index 0000000..2f83e1f --- /dev/null +++ b/tools/yaffs2/patches/100-compile.patch @@ -0,0 +1,125 @@ +--- a/yaffs2/utils/Makefile ++++ b/yaffs2/utils/Makefile +@@ -16,12 +16,11 @@ + + #KERNELDIR = /usr/src/kernel-headers-2.4.18 + +-CFLAGS = -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL +-CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations +-CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline ++CPPFLAGS = -I.. -DCONFIG_YAFFS_UTIL ++CFLAGS = -O2 + + ## Change if you are using a cross-compiler +-MAKETOOLS = ++MAKETOOLS = + + CC=$(MAKETOOLS)gcc + +@@ -41,7 +40,7 @@ $(COMMONLINKS) $(MKYAFFSLINKS) $(MKYAFFS + ln -s ../$@ $@ + + $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c +- $(CC) -c $(CFLAGS) $< -o $@ ++ $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + + mkyaffsimage: $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) + $(CC) -o $@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) +--- a/yaffs2/utils/mkyaffs2image.c ++++ b/yaffs2/utils/mkyaffs2image.c +@@ -32,8 +32,6 @@ + #include <string.h> + #include <unistd.h> + +-#include <private/android_filesystem_config.h> +- + #include "yaffs_ecc.h" + #include "yaffs_guts.h" + +@@ -69,10 +67,12 @@ static int outFile; + + static int error; + +-#ifdef HAVE_BIG_ENDIAN ++#if BYTE_ORDER == BIG_ENDIAN + static int convert_endian = 1; +-#elif defined(HAVE_LITTLE_ENDIAN) ++#elif BYTE_ORDER == LITTLE_ENDIAN + static int convert_endian = 0; ++#else ++#error Unknown endian type + #endif + + static int obj_compare(const void *a, const void * b) +@@ -298,8 +298,8 @@ static int write_object_header(int objId + + static void fix_stat(const char *path, struct stat *s) + { +- path += source_path_len; +- fs_config(path, S_ISDIR(s->st_mode), &s->st_uid, &s->st_gid, &s->st_mode); ++ s->st_uid = 0; ++ s->st_gid = 0; + } + + static int process_directory(int parent, const char *path, int fixstats) +@@ -342,9 +342,8 @@ static int process_directory(int parent, + newObj = obj_id++; + nObjects++; + +- if (fixstats) { ++ if (fixstats) + fix_stat(full_name, &stats); +- } + + //printf("Object %d, %s is a ",newObj,full_name); + +@@ -473,13 +472,13 @@ int main(int argc, char *argv[]) + fprintf(stderr," -f fix file stat (mods, user, group) for device\n"); + fprintf(stderr," dir the directory tree to be converted\n"); + fprintf(stderr," image_file the output file to hold the image\n"); +- fprintf(stderr," 'convert' produce a big-endian image from a little-endian machine\n"); ++ fprintf(stderr," 'convert' produce a big-endian image\n"); + exit(1); + } + + if ((argc == 4) && (!strncmp(argv[3], "convert", strlen("convert")))) + { +- convert_endian = 1; ++ convert_endian = !convert_endian; + } + + if(stat(argv[1],&stats) < 0) +@@ -503,20 +502,9 @@ int main(int argc, char *argv[]) + exit(1); + } + +- if (fixstats) { +- int len = strlen(argv[1]); +- +- if((len >= 4) && (!strcmp(argv[1] + len - 4, "data"))) { +- source_path_len = len - 4; +- } else if((len >= 7) && (!strcmp(argv[1] + len - 6, "system"))) { +- source_path_len = len - 6; +- } else { +- fprintf(stderr,"Fixstats (-f) option requested but filesystem is not data or android!\n"); +- exit(1); +- } ++ if (fixstats) + fix_stat(argv[1], &stats); +- } +- ++ + //printf("Processing directory %s into image file %s\n",argv[1],argv[2]); + error = write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL); + if(error) +--- a/yaffs2/devextras.h ++++ b/yaffs2/devextras.h +@@ -37,7 +37,7 @@ typedef unsigned char __u8; + typedef unsigned short __u16; + typedef unsigned __u32; + +-#if defined(__APPLE__) ++#if defined(__APPLE__) || defined(__FreeBSD__) + typedef long long loff_t; + #endif + diff --git a/tools/yaffs2/patches/110-openbsd-compat.patch b/tools/yaffs2/patches/110-openbsd-compat.patch new file mode 100644 index 0000000..cfafc1c --- /dev/null +++ b/tools/yaffs2/patches/110-openbsd-compat.patch @@ -0,0 +1,14 @@ +diff -Nur yaffs2_android.orig/yaffs2/yaffs_guts.h yaffs2_android/yaffs2/yaffs_guts.h +--- yaffs2_android.orig/yaffs2/yaffs_guts.h Sun Feb 15 16:23:50 2009 ++++ yaffs2_android/yaffs2/yaffs_guts.h Tue Mar 5 15:45:21 2013 +@@ -823,6 +823,10 @@ + int yaffs_SetAttributes(yaffs_Object * obj, struct iattr *attr); + int yaffs_GetAttributes(yaffs_Object * obj, struct iattr *attr); + ++#if defined(__OpenBSD__) ++#define loff_t off_t ++#endif ++ + /* File operations */ + int yaffs_ReadDataFromFile(yaffs_Object * obj, __u8 * buffer, loff_t offset, + int nBytes); |