Mike Frysinger [Tue, 9 Dec 2008 13:28:03 +0000 (08:28 -0500)]
ubiformat.c: fix printf(%d, size_t) warning
A size_t should be printed using %zu (unsigned size_t) rather than %d. This
fixes the following warning on my system:
gcc -O2 -Werror -Wall -Iinclude -Isrc -I../../include src/ubiformat.c -c -o ubiformat.o
cc1: warnings being treated as errors
src/ubiformat.c: In function ‘read_all’:
src/ubiformat.c:345: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
src/ubiformat.c:352: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
make: *** [ubiformat.o] Error 1
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tom Rini [Mon, 8 Dec 2008 08:02:00 +0000 (01:02 -0700)]
ubi-utils: various fixes
gcc-4.3.x introduces a number of new warnings (and we use -Werror) for
things like not checking scanf return values and not using explicit
formatting. Finally, it caught that we were overflowing our own buffer
in unubi.c, so increate the variable size as we want to declare and
clear PATH_MAX + 1, then use only PATH_MAX of the variable.
Signed-off-by: Tom Rini <trini@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Let's have the "new ubi-utils" makefile handle CFLAGS like the other
makefiles. This is important when cross compiling and CFLAGS is
externally provided. Without this, local include files are not found due
to the various -I arguments which are then lost.
Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Adrian Hunter [Mon, 3 Nov 2008 08:41:58 +0000 (10:41 +0200)]
ubinize: correct subpage_size print and initialise vol_info to zero
J. Scott Merritt wrote:
> Dear list,
>
> I believe that I have stumbled upon two problems with the latest version
> of ubinize.c in mtd-utils - one serious, and one not so serious.
>
> - First, the easy one: At line 457, I believe that we should be printing
> args.subpage_size rather than ui.min_io_size.
>
> - More seriously, I believe that the "flags" field in the ubigen_vol_info
> structures is not being properly initialized. Line 494 allocates memory
> for these structures with malloc, so they are not cleared to zero. The
> read_section function updates the flag field if the AUTO-RESIZE flag is
> specified, but does not otherwise initialize or clear it.
>
> I reckon the latter problem could be repaired either with calloc, or by
> modifying read_section to more directly set/clear the flag.
>
> Thanks, Scott.
Reported-by: J. Scott Merritt <merrij3@rpi.edu> Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This patch alters fec.c so it does not use the deprecated bzero, bcopy
and bcmp functions. This can help on platforms that do not have these
functions.
Signed-off-by: Mitch Davis <mitch.davis@symstream.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Grant Erickson [Sun, 7 Sep 2008 20:45:21 +0000 (20:45 +0000)]
nanddump: Qualifier Clean-up
Static-qualified all globals except 'main' because they have no use
beyond file scope.
Constant-qualified MTD device and input positional parameter globals.
Constant-qualified argv array.
Grant Erickson [Sun, 7 Sep 2008 18:29:19 +0000 (18:29 +0000)]
nandwrite: Add Support for Reading from Standard Input
Added suppport for reading in band data from standard input based on a
patch originally generated by Richard Titmuss <titmuss@slimdevices.com>
at <http://lists.slimdevices.com/pipermail/jive-checkins/2008-May/001918.html>.
Grant Erickson [Sun, 7 Sep 2008 18:24:54 +0000 (18:24 +0000)]
nandwrite: Qualifier Clean-up
Static-qualified all globals except 'main' because they have no use
beyond file scope.
Constant-qualified MTD device and input positional parameter globals.
Constant-qualified argv array.
"Invalid argument" ? Not understandable. But the thing is that
-m makes ubimkvol use available space, which is zero, then it
passes zero to the ioctl, which fails in request validation
code, because 0 invalid volume size.
Enrico Scholz [Mon, 25 Aug 2008 19:09:51 +0000 (21:09 +0200)]
ubi-utils: allow 'ubiformat' to read from stdin
This patch allows to read the image from stdin and adds an
'--image-size' option to specify its size. 'upiupdatevol' has this
feature already and it is useful for 'ubiformat' too.
It adds a read_all() function which reads a block of data. Plain
'read(2)' can fail on
Enrico Scholz [Mon, 25 Aug 2008 19:09:50 +0000 (21:09 +0200)]
ubi-utils: fixed and enhanced '--flash-image' option
The '--flash-image' option of 'ubiformat' requires an argument and
'.has_arg' must not be 0 hence. The patch adds this option to the
commandline synopsis too.
Enrico Scholz [Mon, 25 Aug 2008 09:21:48 +0000 (11:21 +0200)]
ubi-utils: use 'stat(2)' instead of 'lstat(2)'
The UBI tools refuse to work with symlinks like
'/dev/ubi/bootloader -> ../ubi0_2' because they use 'lstat(2)' and get
information about the symlink but not about the device. This is
unwanted and fixed by this patch.
This patch renames 'struct stat stat' variables to 'st' to avoid
compilation errors.
Mike Frysinger [Wed, 20 Aug 2008 17:52:05 +0000 (13:52 -0400)]
use $(MAKE) rather than make
If you execute straight `make`, this prevents the active make env from
being passed on to sub children. This prevents parallel building as well
as build flag passing.
I also dropped the recursive make in ubi-utils/Makefile for the all target
as this causes problems when building in parallel. All of the targets
that we actually care about are handled by the $(NTARGETS) target anyways.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Grant Erickson [Wed, 18 Jun 2008 14:35:39 +0000 (07:35 -0700)]
Makefile: Add Optional ZLIB and LZO CPPFLAGS and LDFLAGS
This adds support for allowing the specification of unique CPPFLAGS and
LDFLAGS for both LZO and ZLIB. In addition, it allows for independently
specifying both PREFIX and EXEC_PREFIX.
The former is useful in some cross-compilation environments where the
LZO and ZLIB versions being built against are not those installed in the
standard locations.
The latter is useful when installing mtd-utils in a multi-architecture
installation area.
Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Bernard Blackham [Wed, 25 Jun 2008 13:17:24 +0000 (21:17 +0800)]
ubiformat: reverse question about vid offset change
Users can pass the -O option to ubiformat to override the VID header
offset on the command-line. If for some reason, the new offset does
not match what is on flash, ubiformat currently prompts the user if
they'd rather use the *old* offsets. This means that calling
ubiformat with --yes will not do what was requested on the
command-line.
This patch reverses the question so --yes is actually useful for
running in batch-mode.
Signed-off-by: Bernard Blackham <bernard@largestprime.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Grant Erickson [Fri, 13 Jun 2008 15:46:37 +0000 (01:46 +1000)]
mkfs.jffs2: Add Support for Symlinks to Device Table
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>
Grant Erickson [Fri, 13 Jun 2008 15:46:29 +0000 (01:46 +1000)]
mkfs.jffs2: Remove Incorrect Find Optimization
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>