--- a/Makefile
+++ b/Makefile
-@@ -42,10 +42,15 @@ $(SYMLINKS):
+@@ -43,10 +43,15 @@ $(SYMLINKS):
ln -sf ../fs/jffs2/$@ $@
$(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\
-diff --git a/mkfs.ubifs/Makefile b/mkfs.ubifs/Makefile
-index a678b0a..919ce89 100644
--- a/mkfs.ubifs/Makefile
+++ b/mkfs.ubifs/Makefile
@@ -6,7 +6,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch]
LDLIBS_mkfs.ubifs += -L$(BUILDDIR)/../lib -lmtd -lcrc32
LDLIBS_mkfs.ubifs += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
-diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c
-index e378c5d..0208f80 100644
--- a/mkfs.ubifs/compr.c
+++ b/mkfs.ubifs/compr.c
@@ -24,7 +24,9 @@
#include <linux/types.h>
#define crc32 __zlib_crc32
-@@ -85,6 +87,16 @@ static int zlib_deflate(void *in_buf, si
+@@ -86,6 +88,16 @@ static int zlib_deflate(void *in_buf, si
return 0;
}
static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
size_t *out_len)
{
-@@ -103,14 +115,16 @@ static int lzo_compress(void *in_buf, si
+@@ -104,14 +116,16 @@ static int lzo_compress(void *in_buf, si
return 0;
}
static char *zlib_buf;
static int favor_lzo_compress(void *in_buf, size_t in_len, void *out_buf,
-@@ -197,9 +211,11 @@ int compress_data(void *in_buf, size_t i
+@@ -198,9 +212,11 @@ int compress_data(void *in_buf, size_t i
int init_compression(void)
{
zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR);
if (!zlib_buf) {
-@@ -213,7 +229,9 @@ int init_compression(void)
+@@ -214,7 +230,9 @@ int init_compression(void)
void destroy_compression(void)
{
free(zlib_buf);
#include "compr.h"
--- a/compr_zlib.c
+++ b/compr_zlib.c
-@@ -35,7 +35,6 @@
- #include <stdint.h>
+@@ -39,7 +39,6 @@
#include <zlib.h>
+ #undef crc32
#include <stdio.h>
-#include <asm/types.h>
#include <linux/jffs2.h>
+ #include "common.h"
#include "compr.h"
-
--- a/rbtree.h
+++ b/rbtree.h
@@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
#include <sys/types.h>
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
-@@ -773,8 +773,8 @@ int write_leb(int lnum, int len, void *b
+@@ -805,8 +805,8 @@ int write_leb(int lnum, int len, void *b
if (ubi_leb_change_start(ubi, out_fd, lnum, c->leb_size, dtype))
return sys_err_msg("ubi_leb_change_start failed");
(long long)pos);
if (write(out_fd, buf, c->leb_size) != c->leb_size)
-@@ -1029,6 +1029,7 @@ static int add_inode_with_data(struct st
+@@ -1063,6 +1063,7 @@ static int add_inode_with_data(struct st
if (c->default_compr != UBIFS_COMPR_NONE)
use_flags |= UBIFS_COMPR_FL;
if (flags & FS_COMPR_FL)
use_flags |= UBIFS_COMPR_FL;
if (flags & FS_SYNC_FL)
-@@ -1039,6 +1040,7 @@ static int add_inode_with_data(struct st
+@@ -1073,6 +1074,7 @@ static int add_inode_with_data(struct st
use_flags |= UBIFS_APPEND_FL;
if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
use_flags |= UBIFS_DIRSYNC_FL;
memset(ino, 0, UBIFS_INO_NODE_SZ);
-@@ -1108,7 +1110,9 @@ static int add_dir_inode(DIR *dir, ino_t
+@@ -1142,7 +1144,9 @@ static int add_dir_inode(DIR *dir, ino_t
fd = dirfd(dir);
if (fd == -1)
return sys_err_msg("dirfd failed");
flags = 0;
}
-@@ -1293,10 +1297,12 @@ static int add_file(const char *path_nam
+@@ -1327,10 +1331,12 @@ static int add_file(const char *path_nam
key_write(&key, &dn->key);
dn->size = cpu_to_le32(bytes_read);
out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
use_compr = c->default_compr;
compr_type = compress_data(buf, bytes_read, &dn->data,
&out_len, use_compr);
-@@ -1338,7 +1344,9 @@ static int add_non_dir(const char *path_
+@@ -1372,7 +1378,9 @@ static int add_non_dir(const char *path_
if (fd == -1)
return sys_err_msg("failed to open file '%s'",
path_name);
+
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
-@@ -75,6 +75,14 @@
- #include "crc32.h"
- #include "rbtree.h"
+@@ -76,6 +76,14 @@
+
+ #include "common.h"
+#ifdef __CYGWIN__
+#include <cygwin/ioctl.h>
/* Do not use the weird XPG version of basename */
#undef basename
-@@ -474,7 +482,7 @@ static struct filesystem_entry *recursiv
+@@ -375,7 +383,7 @@ static struct filesystem_entry *recursiv
the following macros use it if available or use a hacky workaround...
*/
#define SCANF_PREFIX "a"
#define SCANF_STRING(s) (&s)
#define GETCWD_SIZE 0
-@@ -557,6 +565,14 @@ static int interpret_table_entry(struct
+@@ -458,6 +466,14 @@ static int interpret_table_entry(struct
}
entry = find_filesystem_entry(root, name, mode);
if (entry) {
/* Ok, we just need to fixup the existing entry
* and we will be all done... */
entry->sb.st_uid = uid;
-@@ -566,11 +582,21 @@ static int interpret_table_entry(struct
+@@ -467,11 +483,21 @@ static int interpret_table_entry(struct
entry->sb.st_rdev = makedev(major, minor);
}
} else {
+ }
free(tmp);
if (parent == NULL) {
- error_msg ("skipping device_table entry '%s': no parent directory!", name);
-@@ -584,6 +610,7 @@ static int interpret_table_entry(struct
+ errmsg ("skipping device_table entry '%s': no parent directory!", name);
+@@ -485,6 +511,7 @@ static int interpret_table_entry(struct
add_host_filesystem_entry(name, hostpath, uid, gid, mode, 0, parent);
break;
case 'f':
case 'p':
--- a/ubi-utils/src/libubi.c
+++ b/ubi-utils/src/libubi.c
-@@ -30,6 +30,9 @@
+@@ -32,6 +32,9 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
---- a/Makefile
+--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
ifeq ($(WITHOUT_XATTR), 1)
CPPFLAGS += -DWITHOUT_XATTR
-@@ -51,7 +51,9 @@ $(SYMLINKS):
+@@ -52,7 +52,9 @@ $(SYMLINKS):
ln -sf ../fs/jffs2/$@ $@
$(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\
compr.o rbtree.o)
LDFLAGS_mkfs.jffs2 := $(ZLIBLDFLAGS)
LDLIBS_mkfs.jffs2 := -lz
---- a/compr.c 2009-06-05 16:59:08.000000000 +0200
-+++ b/compr.c 2010-03-20 23:16:14.556367000 +0100
-@@ -520,6 +520,9 @@
+--- a/compr.c
++++ b/compr.c
+@@ -520,6 +520,9 @@ int jffs2_compressors_init(void)
#ifdef CONFIG_JFFS2_LZO
jffs2_lzo_init();
#endif
return 0;
}
-@@ -534,5 +537,8 @@
+@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void)
#ifdef CONFIG_JFFS2_LZO
jffs2_lzo_exit();
#endif
+#endif
return 0;
}
---- a/compr.h 2010-03-20 23:08:46.289595000 +0100
-+++ b/compr.h 2010-03-20 23:51:41.953345921 +0100
+--- a/compr.h
++++ b/compr.h
@@ -18,13 +18,14 @@
#define CONFIG_JFFS2_ZLIB
+
#endif /* __JFFS2_COMPR_H__ */
---- a/compr_lzma.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/compr_lzma.c 2010-03-20 23:16:15.048654497 +0100
+--- /dev/null
++++ b/compr_lzma.c
@@ -0,0 +1,128 @@
+/*
+ * JFFS2 -- Journalling Flash File System, Version 2.
+ jffs2_unregister_compressor(&jffs2_lzma_comp);
+ lzma_free_workspace();
+}
---- a/include/linux/jffs2.h 2009-06-05 16:59:08.000000000 +0200
-+++ b/include/linux/jffs2.h 2010-03-20 23:16:15.305246000 +0100
+--- a/include/linux/jffs2.h
++++ b/include/linux/jffs2.h
@@ -47,6 +47,7 @@
#define JFFS2_COMPR_DYNRUBIN 0x05
#define JFFS2_COMPR_ZLIB 0x06
/* Compatibility flags. */
#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
#define JFFS2_NODE_ACCURATE 0x2000
---- a/include/linux/lzma.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma.h 2010-03-20 23:16:16.380508712 +0100
+--- /dev/null
++++ b/include/linux/lzma.h
@@ -0,0 +1,61 @@
+#ifndef __LZMA_H__
+#define __LZMA_H__
+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free};
+
+#endif
---- a/include/linux/lzma/LzFind.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzFind.h 2010-03-20 23:19:44.189059515 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzFind.h
@@ -0,0 +1,116 @@
+/* LzFind.h -- Match finder for LZ algorithms
+2008-04-04
+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
+
+#endif
---- a/include/linux/lzma/LzHash.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzHash.h 2010-03-20 23:19:44.588791287 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzHash.h
@@ -0,0 +1,56 @@
+/* LzHash.h -- HASH functions for LZ algorithms
+2008-03-26
+ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
+
+#endif
---- a/include/linux/lzma/LzmaDec.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzmaDec.h 2010-03-20 23:19:43.766328000 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzmaDec.h
@@ -0,0 +1,232 @@
+/* LzmaDec.h -- LZMA Decoder
+2008-04-29
+ ELzmaStatus *status, ISzAlloc *alloc);
+
+#endif
---- a/include/linux/lzma/LzmaEnc.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzmaEnc.h 2010-03-20 23:19:47.392642470 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzmaEnc.h
@@ -0,0 +1,74 @@
+/* LzmaEnc.h -- LZMA Encoder
+2008-04-27
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
+
+#endif
---- a/include/linux/lzma/Types.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/Types.h 2010-03-20 23:19:44.013465852 +0100
+--- /dev/null
++++ b/include/linux/lzma/Types.h
@@ -0,0 +1,130 @@
+/* Types.h -- Basic types
+2008-04-11
+#define IAlloc_Free(p, a) (p)->Free((p), a)
+
+#endif
---- a/lzma/LzFind.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzFind.c 2010-03-20 23:19:47.990406000 +0100
+--- /dev/null
++++ b/lzma/LzFind.c
@@ -0,0 +1,753 @@
+/* LzFind.c -- Match finder for LZ algorithms
+2008-04-04
+ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
+ }
+}
---- a/lzma/LzmaDec.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzmaDec.c 2010-03-20 23:19:44.413562000 +0100
+--- /dev/null
++++ b/lzma/LzmaDec.c
@@ -0,0 +1,1014 @@
+/* LzmaDec.c -- LZMA Decoder
+2008-04-29
+ LzmaDec_FreeProbs(&p, alloc);
+ return res;
+}
---- a/lzma/LzmaEnc.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzmaEnc.c 2010-03-20 23:19:47.815156000 +0100
+--- /dev/null
++++ b/lzma/LzmaEnc.c
@@ -0,0 +1,2335 @@
+/* LzmaEnc.c -- LZMA Encoder
+2008-04-28
+ LzmaEnc_Destroy(p, alloc, allocBig);
+ return res;
+}
---- a/mkfs.jffs2.c 2009-06-05 16:59:08.000000000 +0200
-+++ b/mkfs.jffs2.c 2010-03-20 23:16:16.877026000 +0100
-@@ -1761,11 +1761,11 @@ int main(int argc, char **argv)
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
+@@ -1691,11 +1691,11 @@ int main(int argc, char **argv)
}
erase_block_size *= units;