aboutsummaryrefslogtreecommitdiff
path: root/mkfs.jffs2.c
AgeCommit message (Collapse)Author
2011-04-21mkfs.jffs2: fix casting of __off64_tAndy Shevchenko
The casting of __off64_t to unsigned long potentially wrong for values higher than ULONG_MAX. Let's fix that by using PRIu64 classifier. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-04-14mkfs.jffs2: fix casting of printf argumentAndy Shevchenko
The compiler warns us about cast mismatch for %9lu specifier. In original code the argument has __off64_t type. Here is a simple type casting fix. Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-01-16mkfs.jffs2: fix repeated dev nodesv1.4.2Thomas Chou
Fix the repeated nodes with the same primary name in device_table.txt. They were not generated correctly. /dev/tty c 666 0 0 5 0 0 0 - /dev/tty c 666 0 0 4 0 0 1 6 # IDE Devices /dev/hda b 640 0 0 3 0 0 0 - /dev/hda b 640 0 0 3 1 1 1 15 /dev/hdb b 640 0 0 3 64 0 0 - /dev/hdb b 640 0 0 3 65 1 1 15 Only created, /dev/tty /dev/hda /dev/hdb Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-01-16mkfs.jffs2: fix devtable count as mkfs.ubifs doesThomas Chou
The counting was incorrect. Follow that of mkfs.ubifs. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-10-02mkfs.jffs2: convert to xalloc.h helpersMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-10-01mkfs.jffs2: convert to common.h helpersMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-30mkfs.jffs2: use new xasprintf() helperMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-30mtd-utils: new memory wrappersMike Frysinger
The mkfs.jffs2 program has local wrappers for memory related functions that are useful beyond mkfs.jffs2, so break them out into a common header. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-27mtd-utils: standardize PROGRAM_NAMEMike Frysinger
Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-24mtd-utils: convert to common.h/minMike Frysinger
Kill off duplicated min() defines and convert to the common.h one. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-23mtd-utils: clean up zlib.h usage a bitMike Frysinger
Hide zlib's crc32 in compr_zlib.c and mkfs.ubifs/compr.c. jffs2reader.c and mkfs.jffs2.c don't actually use zlib, so punt the include from the file. mkfs.jffs2.c is implicitly using crc32 from zlib.h instead of the local mtd_crc32, so fix the local usage. otherwise we get warnings about undefined crc32 because the file was redirecting the prototype. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-08-30mtd-utils: fix compiler warningsBrian Norris
Fixed several compiler warnings, mainly when compiling on 64-bit architectures (where "size_t"-related types are not necessarily 32-bit). Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-07-30mtd-utils: clean up compile warningsKevin Cernekee
gcc 4.4.3 on x86_64: libcrc32.c:42: warning: ‘static’ is not at beginning of declaration libfec.c:120: warning: initialization discards qualifiers from pointer target type libfec.c:121: warning: initialization discards qualifiers from pointer target type libfec.c:417: warning: passing argument 2 of ‘my_malloc’ discards qualifiers from pointer target type recv_image.c:164: warning: comparison of unsigned expression < 0 is always false recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’ recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’ And many more along the same lines. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-07-18mkfs.jffs2: fixed warningsBrian Norris
Changed "char*" to "const char*" in certain function argument lists to prevent compiler warnings for passing a hard-coded string. Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-07-13mtd-utils: move libmtd source files to lib/ subdirectoryKevin Cernekee
Source files for libmtd, crc32, and fec are scattered throughout the tree. Move them to a central location so they can be built into a common "libmtd.a" library used by all mtd-utils programs. This patch only renames/deletes files and does not change the content. Also modify the build system and source code so that libmtd.a can be built from a "common" location (lib/). Statically link all utilities at the top level with libmtd.a . Minor changes to mkfs.ubifs to allow using the common crc32 implementation. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-03-31mkfs.jffs2: fix --enable-compressorAdrian Bunk
The short option -X was working, but the documented long option --enable-compressor was missing. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-27mkfs.jffs2: fix dir creation in /Mike Frysinger
With older mtd-utils, creating a directory in the root worked fine. With current git, the parent dir search algo breaks this. For example, just take the current git tree, build it up, and then run: $ ./mkfs.jffs2 -d . -D device_table.txt -o /dev/null mkfs.jffs2: skipping device_table entry '/dev': no parent directory! mkfs.jffs2: skipping device_table entry '/dev/mem': no parent directory! ... Doing `mkdir ./dev` first works around the issue, but where's the fun in that. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-06-18mkfs.jffs2: Add Support for Symlinks to Device TableGrant Erickson
Added support for symbolic links to the grammar of the device table file such that links that already exist in the root working directory may have their permissions and ownership changed. Creating symbolic links anew is still unsupported. Added a note to this effect in the manual reference page. Print out the type character when encountering an unsupported file type (e.g. symbolic links when created anew). Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Josh Boyer <jwboyer@vader.jdub.homelinux.org>
2008-06-18mkfs.jffs2: Remove Incorrect Find OptimizationGrant Erickson
Remove performance optimization in find_filesystem_entry that prevented the successful simultaneous use of --root and --devtable where the latter is only used to fix-up permissions and ownership and to create device nodes. As it stood, the performance optimization prevented a successful find where directory recursion was required or where the file being searched for had any mode permission bits set. See http://lists.infradead.org/pipermail/linux-mtd/2008-June/021997.html for additional information. Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Josh Boyer <jwboyer@vader.jdub.homelinux.org>
2008-04-17mkfs.jffs2.c: fix issue with crashing when using lzo compressionSiarhei Siamashka
Signed-off-by: Siarhei Siamashka <siarhei.siamashka@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-12-20mkfs.jffs2: Set mkfs.jffs2 page size runtime instead of fixedRicard Wanderlof
This patch reads the default PAGE_SIZE from sysconf(), i.e. the system mkfs.jffs2 is running on, instead of just setting it to 4096 (which of course is valid for most systems but not all). This is useful if mkfs.jffs2 is running on the target system, e.g. to create a backup image during firmware upgrade, so that the page size does not have to be set explicitly using a command line parameter. The --pagesize option is supported just as before. If the user has not set the page size explicitly with --pagesize, and the system page size is anything other than 4096, warn the user that an unusual page size is being used, since this behavior is different from before. Signed-off-by Ricard Wanderlöf <ricardw@axis.com> . Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2007-12-14mkfs.jffs2.c: use rbtrees for hardlink trackingDavid Woodhouse
I just couldn't live with myself. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-12-14mkfs.jffs2.c: detect hardlinksDavid Woodhouse
... with the stupidest possible algorithm for storing them and looking them up. Optimising that is simple enough, but left as an exercise for the user. This is userspace, after all. It's not as if I care. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-12-14mkfs.jffs2: use separate ino field in struct filesystem_entry for jffs2 ino#David Woodhouse
...because when we support hard links we'll want to preserve the original inode numbers... Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-08-03Increment mkfs.jffs2 version numberv1.1.0Josh Boyer
Several change have gone into mkfs.jffs2 since we switch from CVS, but the version number never got incremented. Bump the version number up so people can distinguish between older and newer versions. Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-11-15Patch from KaiGai Kohei to enable building without xattr supportKaiGai Kohei
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-10-09Fixup whitespaceJosh Boyer
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-09-18Report compressed file sizes (including node headers) in mkfs.jffs2 stats.Daniel P. Berrange
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-08-07Add xseqno into jffs2_raw_xref on mkfs.jffs2KaiGai Kohei
Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-05-14Remove XATTR struct typedefsDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-06Add XATTR support to mkfs.jffs2David Woodhouse
Since this is optional, it might as well go in immediately.
2006-04-11Fix cbuf free properly.David Woodhouse
Noted by Dan Berrange. Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-04-11Fix memory leak in write_regular_file()David Woodhouse
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-04-11- Update utils to build from in tree include filesJosh Boyer
- Revert any ebh stuff for now Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-04-11Initial commitDavid Woodhouse