]> www.infradead.org Git - mtd-utils.git/log
mtd-utils.git
16 years agoflash_eraseall reports incorrect percentage
Ladislav Michl [Tue, 18 Nov 2008 18:56:52 +0000 (19:56 +0100)]
flash_eraseall reports incorrect percentage

Fix flash_eraseall percentage reporting:

# flash_eraseall /dev/mtd4
Erasing 128 Kibyte @ 2800000 -- 100 % complete.

flash_eraseall
 * fix percentage reporting
 * exit()ing from main() is overkill, just return

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubinize: correct subpage_size print and initialise vol_info to zero
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>
16 years agomkfs.ubifs: make program version 1.1.
Artem Bityutskiy [Thu, 23 Oct 2008 17:18:33 +0000 (20:18 +0300)]
mkfs.ubifs: make program version 1.1.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoFix favor LZO implementation
Artem Bityutskiy [Wed, 22 Oct 2008 15:12:14 +0000 (18:12 +0300)]
Fix favor LZO implementation

Use c->favor_percent, not c->favor_lzo.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoImplement favor LZO method
Artem Bityutskiy [Wed, 22 Oct 2008 12:15:52 +0000 (15:15 +0300)]
Implement favor LZO method

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoIntroduce favor_lzo compressor options
Artem Bityutskiy [Wed, 22 Oct 2008 11:58:05 +0000 (14:58 +0300)]
Introduce favor_lzo compressor options

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoMake "c" global
Artem Bityutskiy [Wed, 22 Oct 2008 12:04:52 +0000 (15:04 +0300)]
Make "c" global

We need to have access to "c" from various files.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoDefine the worst case compression constant
Artem Bityutskiy [Wed, 22 Oct 2008 11:23:00 +0000 (14:23 +0300)]
Define the worst case compression constant

It will be used in the next patches.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoUBIFS: rename crc32 function
Artem Bityutskiy [Wed, 22 Oct 2008 11:18:43 +0000 (14:18 +0300)]
UBIFS: rename crc32 function

Zlib headers also declare crc32 symbol and it confilicts
with our crc32 fuction. So rename it.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years ago[PATCH] [MTD] mtd-utils: fec.c: bzero->memset, bcopy->memcpy, bcmp->memcmp
Mitch Davis [Wed, 8 Oct 2008 02:36:13 +0000 (13:36 +1100)]
[PATCH] [MTD] mtd-utils: fec.c: bzero->memset, bcopy->memcpy, bcmp->memcmp

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>
16 years agoubinize: allow an absent 'image' in the ubinize configuration.
Richard Titmuss [Tue, 23 Sep 2008 20:32:10 +0000 (21:32 +0100)]
ubinize: allow an absent 'image' in the ubinize configuration.

Some recent changes to ubinize prevent the 'image' parameter from being
absent in the configuration file. The following patch fixes that.

Signed-off-by: Richard Titmuss <richard.titmuss@logitech.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agonanddump: Add Support for Quiet Option
Grant Erickson [Sun, 7 Sep 2008 20:45:57 +0000 (20:45 +0000)]
nanddump: Add Support for Quiet Option

Added support for the '-q,--quiet' option to suppress diagnostic output.
 Made the new option mutually-exclusive with the pretty print option.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonanddump: Clean-up Usage Output
Grant Erickson [Sun, 7 Sep 2008 20:45:51 +0000 (20:45 +0000)]
nanddump: Clean-up Usage Output

Realign help usage output to make it more explict when a description
needs to be wrapped.

Use sentence case for the help usage output option short descriptions.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonanddump: Use Boolean Mnemonics from stdbool.h
Grant Erickson [Sun, 7 Sep 2008 20:45:43 +0000 (20:45 +0000)]
nanddump: Use Boolean Mnemonics from stdbool.h

Added include directive for stdbool.h and leveraged where appropriate
to improve code readability by making variable intent and usage more
explicit.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonanddump: Pass Real Names as Arguments to perror
Grant Erickson [Sun, 7 Sep 2008 20:45:36 +0000 (20:45 +0000)]
nanddump: Pass Real Names as Arguments to perror

Pass the MTD device node and dump file name as arguments to perror
rather than more ambigous, static messages on open failures.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonanddump: Utilize Standard Exit Mnemonics
Grant Erickson [Sun, 7 Sep 2008 20:45:29 +0000 (20:45 +0000)]
nanddump: Utilize Standard Exit Mnemonics

Replace main exit and return status codes with equivalent mnemonics.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonanddump: Qualifier Clean-up
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.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Add Support for Reading from Standard Input
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>.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Clean-up Usage Output
Grant Erickson [Sun, 7 Sep 2008 18:29:11 +0000 (18:29 +0000)]
nandwrite: Clean-up Usage Output

Realign help usage output to make it more explict when a description
needs to be wrapped.

Use sentence case for the help usage output option short descriptions.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Use Boolean Mnemonics from stdbool.h
Grant Erickson [Sun, 7 Sep 2008 18:29:03 +0000 (18:29 +0000)]
nandwrite: Use Boolean Mnemonics from stdbool.h

Added include directive for stdbool.h and leveraged where appropriate
to improve code readability by making variable intent and usage more
explicit.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Pass Real Names as Arguments to perror
Grant Erickson [Sun, 7 Sep 2008 18:28:56 +0000 (18:28 +0000)]
nandwrite: Pass Real Names as Arguments to perror

Pass the MTD device node and input file name as arguments to perror
rather than more ambigous, static messages on open failures.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Utilize Standard Exit Mnemonics
Grant Erickson [Sun, 7 Sep 2008 18:28:24 +0000 (18:28 +0000)]
nandwrite: Utilize Standard Exit Mnemonics

Replace main exit and return status codes with equivalent mnemonics.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agonandwrite: Qualifier Clean-up
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.

Signed-off-by: Grant Erickson <gerickson@nuovations.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
16 years agofs-tests: also preserve mount options when mounting again
Adrian Hunter [Mon, 8 Sep 2008 08:39:29 +0000 (11:39 +0300)]
fs-tests: also preserve mount options when mounting again

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomkfs.ubifs: amend help print
Artem Bityutskiy [Sun, 7 Sep 2008 13:46:41 +0000 (16:46 +0300)]
mkfs.ubifs: amend help print

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomkfs.ubifs: update ubifs-media.h
Artem Bityutskiy [Sun, 7 Sep 2008 13:38:15 +0000 (16:38 +0300)]
mkfs.ubifs: update ubifs-media.h

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubiupdatevol: remove non-existing option from help message
Artem Bityutskiy [Fri, 5 Sep 2008 08:56:59 +0000 (11:56 +0300)]
ubiupdatevol: remove non-existing option from help message

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomkfs.ubifs: check max_leb_count
Artem Bityutskiy [Fri, 5 Sep 2008 08:56:22 +0000 (11:56 +0300)]
mkfs.ubifs: check max_leb_count

Complain and exit if max. count of LEBs was not specified.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubirmvol: learn to remove volume by name
Artem Bityutskiy [Wed, 3 Sep 2008 16:18:29 +0000 (19:18 +0300)]
ubirmvol: learn to remove volume by name

Add -N option to ubirmvol to support deleting volumes
by name.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-utils: minor rename
Artem Bityutskiy [Tue, 2 Sep 2008 14:41:47 +0000 (17:41 +0300)]
ubi-utils: minor rename

We use term "volume ID", not "volume number". So change few
vol_num variables to vol_id to be consistent.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubimkvol: check for free LEBs
Artem Bityutskiy [Tue, 2 Sep 2008 13:46:48 +0000 (16:46 +0300)]
ubimkvol: check for free LEBs

Check for free LEBs before trying to create a volume. This fixes
the following issue:

$ ubimkvol /dev/ubi0 -n 0 -N test_fs -m
ubimkvol: error!: cannot UBI create volume
          error 22 (Invalid argument)
Error: cannot create UBI volume

"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.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubiattach: minor help text fix
Artem Bityutskiy [Tue, 2 Sep 2008 13:31:27 +0000 (16:31 +0300)]
ubiattach: minor help text fix

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-utils: added missing linefeed in 'ubinfo'
Enrico Scholz [Tue, 26 Aug 2008 09:13:57 +0000 (11:13 +0200)]
ubi-utils: added missing linefeed in 'ubinfo'

Trivial patch to add a missing linefeed in static volume info:

| Data bytes:  113112 bytes (110.5 KiB)State:       OK

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-utils: allow 'ubiformat' to read from stdin
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

  nc -l -p 1234 | ubiformat -f - -S 25427968

else.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-utils: fixed and enhanced '--flash-image' option
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.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-utils: use 'stat(2)' instead of 'lstat(2)'
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.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomtd-utils: add support for 4k pages.
Thomas Gleixner [Wed, 20 Aug 2008 10:32:14 +0000 (12:32 +0200)]
mtd-utils: add support for 4k pages.

Add support for 4K pages in nanddump & nandwrite.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomkfs.ubifs: remove debugging leftovers from Makefile
Artem Bityutskiy [Thu, 21 Aug 2008 08:57:37 +0000 (11:57 +0300)]
mkfs.ubifs: remove debugging leftovers from Makefile

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agouse $(MAKE) rather than make
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>
16 years agomkfs.ubifs: set CFLAGS/LDLIBS properly
Mike Frysinger [Wed, 20 Aug 2008 17:57:09 +0000 (13:57 -0400)]
mkfs.ubifs: set CFLAGS/LDLIBS properly

CFLAGS should only be set as a default instead of overriding the user's
choices.  LDLIBS is for adding libraries, not LDFLAGS.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agomtd-utils: enable parallel build process
Sebastian Siewior [Wed, 20 Aug 2008 19:50:18 +0000 (21:50 +0200)]
mtd-utils: enable parallel build process

-j 2 build was not possible without this patch.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 years agomkfs.ubifs: set program version as 1.0
Artem Bityutskiy [Tue, 19 Aug 2008 10:21:47 +0000 (13:21 +0300)]
mkfs.ubifs: set program version as 1.0

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoAdd mkfs.ubifs
Artem Bityutskiy [Tue, 19 Aug 2008 10:18:07 +0000 (13:18 +0300)]
Add mkfs.ubifs

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agofs-tests: allow for symlink name too long in integrity test
Adrian Hunter [Tue, 12 Aug 2008 11:08:14 +0000 (14:08 +0300)]
fs-tests: allow for symlink name too long in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agofs-tests: fix max file name length in integrity test
Adrian Hunter [Tue, 12 Aug 2008 11:08:11 +0000 (14:08 +0300)]
fs-tests: fix max file name length in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agofs-tests: fix symlink bug in integrity test
Adrian Hunter [Tue, 12 Aug 2008 11:08:06 +0000 (14:08 +0300)]
fs-tests: fix symlink bug in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubinize: fix static volumes generation
Artem Bityutskiy [Mon, 28 Jul 2008 09:52:24 +0000 (12:52 +0300)]
ubinize: fix static volumes generation

When static volumes is generated, the 'used_ebs' field of VID
header has to be calculated based on image file size, not on
the volume size. Fix this.

This patch also improves error reporting a little and re-arrages
the code so that all the validation is done in 'read_section()'

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-tests: fix run script
Artem Bityutskiy [Mon, 14 Jul 2008 09:59:26 +0000 (12:59 +0300)]
ubi-tests: fix run script

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubi-tests: fix makefile
Artem Bityutskiy [Mon, 14 Jul 2008 09:51:07 +0000 (12:51 +0300)]
ubi-tests: fix makefile

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agouninize: add more ini-file validation
Artem Bityutskiy [Tue, 8 Jul 2008 12:26:42 +0000 (15:26 +0300)]
uninize: add more ini-file validation

Check that volume names and IDs are unique

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubinize: validate number of sections
Artem Bityutskiy [Tue, 8 Jul 2008 11:06:35 +0000 (14:06 +0300)]
ubinize: validate number of sections

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoMakefile: Add Optional ZLIB and LZO CPPFLAGS and LDFLAGS
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>
16 years agoubiupdatevol: minor tweak v1.2.0
Artem Bityutskiy [Fri, 27 Jun 2008 16:21:28 +0000 (19:21 +0300)]
ubiupdatevol: minor tweak

Undo my weird change which slipped accidentally to the commit.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
16 years agoubiupdate: support reading from stdio
Hamish Moffatt [Fri, 27 Jun 2008 16:13:10 +0000 (19:13 +0300)]
ubiupdate: support reading from stdio

1. Adds -s/--size switch;
2. Allows the image file to be specified as '-', meaning stdin; if used,
the size must be specified.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubiformat: reverse question about vid offset change
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>
17 years agomkfs.jffs2: Add Support for Symlinks to Device Table
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>
17 years agomkfs.jffs2: Remove Incorrect Find Optimization
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>
17 years agorespect CFLAGS/CPPFLAGS from build environment
Mike Frysinger [Wed, 11 Jun 2008 21:49:08 +0000 (07:49 +1000)]
respect CFLAGS/CPPFLAGS from build environment

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
17 years agofs-tests: fix rename bug in integrity test
Adrian Hunter [Tue, 17 Jun 2008 10:54:23 +0000 (13:54 +0300)]
fs-tests: fix rename bug in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: add symlinks to integrity test
Adrian Hunter [Thu, 12 Jun 2008 07:57:29 +0000 (10:57 +0300)]
fs-tests: add symlinks to integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: check link count in integrity test
Adrian Hunter [Wed, 11 Jun 2008 12:34:00 +0000 (15:34 +0300)]
fs-tests: check link count in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: add rename to integrity test
Adrian Hunter [Wed, 11 Jun 2008 12:32:52 +0000 (15:32 +0300)]
fs-tests: add rename to integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: add linking/unlinking to integrity test
Adrian Hunter [Wed, 11 Jun 2008 07:41:11 +0000 (10:41 +0300)]
fs-tests: add linking/unlinking to integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: make integrity test shrink faster
Adrian Hunter [Fri, 6 Jun 2008 10:41:51 +0000 (13:41 +0300)]
fs-tests: make integrity test shrink faster

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: add mmapping to integrity test for ubifs
Adrian Hunter [Fri, 6 Jun 2008 07:23:18 +0000 (10:23 +0300)]
fs-tests: add mmapping to integrity test for ubifs

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: preserve mount options when mounting again
Adrian Hunter [Thu, 5 Jun 2008 11:11:29 +0000 (14:11 +0300)]
fs-tests: preserve mount options when mounting again

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: stop integrity test looping forever
Adrian Hunter [Thu, 5 Jun 2008 11:00:11 +0000 (14:00 +0300)]
fs-tests: stop integrity test looping forever

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: fix bug in integrity test
Adrian Hunter [Tue, 13 Nov 2007 10:38:00 +0000 (12:38 +0200)]
fs-tests: fix bug in integrity test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: add simple performance test
Adrian Hunter [Tue, 6 Nov 2007 11:08:12 +0000 (13:08 +0200)]
fs-tests: add simple performance test

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: make integrity test record truncations
Adrian Hunter [Mon, 29 Oct 2007 12:45:37 +0000 (14:45 +0200)]
fs-tests: make integrity test record truncations

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: make integrity test shrink better
Adrian Hunter [Mon, 22 Oct 2007 11:06:07 +0000 (14:06 +0300)]
fs-tests: make integrity test shrink better

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agofs-tests: allow for ENOSPC in test fwrite00
Adrian Hunter [Mon, 8 Oct 2007 14:43:16 +0000 (17:43 +0300)]
fs-tests: allow for ENOSPC in test fwrite00

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
17 years agoubi-tests: fix compilation
Artem Bityutskiy [Wed, 4 Jun 2008 16:23:52 +0000 (19:23 +0300)]
ubi-tests: fix compilation

libubi_open interface was changed, but the tests were not
amended. Fix this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix typo in ubiformat
Artem Bityutskiy [Thu, 29 May 2008 10:05:36 +0000 (13:05 +0300)]
ubi-utils: fix typo in ubiformat

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoFix recv_image build harder
David Woodhouse [Thu, 22 May 2008 11:44:14 +0000 (12:44 +0100)]
Fix recv_image build harder

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
17 years agoubi-utils: remove unnecessary ubinize warning
Artem Bityutskiy [Fri, 16 May 2008 08:53:42 +0000 (11:53 +0300)]
ubi-utils: remove unnecessary ubinize warning

... and fix help message.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: add ubiformat to Makefile
Artem Bityutskiy [Fri, 16 May 2008 08:08:30 +0000 (11:08 +0300)]
ubi-utils: add ubiformat to Makefile

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fixe ubiupdatevol
Artem Bityutskiy [Tue, 13 May 2008 11:28:45 +0000 (14:28 +0300)]
ubi-utils: fixe ubiupdatevol

-t option does not require image file.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix long options
Artem Bityutskiy [Wed, 23 Apr 2008 15:21:03 +0000 (18:21 +0300)]
ubi-utils: fix long options

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: make sure only one volume is auto-resize
Artem Bityutskiy [Wed, 23 Apr 2008 15:13:04 +0000 (18:13 +0300)]
ubi-utils: make sure only one volume is auto-resize

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: improve input parameters checks
Artem Bityutskiy [Wed, 23 Apr 2008 15:05:05 +0000 (18:05 +0300)]
ubi-utils: improve input parameters checks

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agomtd-utils: fix input parameter checks
Artem Bityutskiy [Wed, 23 Apr 2008 10:48:09 +0000 (13:48 +0300)]
mtd-utils: fix input parameter checks

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix percent output in ubiformat
Artem Bityutskiy [Mon, 21 Apr 2008 16:13:58 +0000 (19:13 +0300)]
ubi-utils: fix percent output in ubiformat

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix the output print
Artem Bityutskiy [Mon, 21 Apr 2008 15:09:17 +0000 (18:09 +0300)]
ubi-utils: fix the output print

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: improve input parameters checks
Artem Bityutskiy [Sun, 20 Apr 2008 10:22:34 +0000 (13:22 +0300)]
ubi-utils: improve input parameters checks

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: add ubiformat
Artem Bityutskiy [Sun, 20 Apr 2008 09:35:32 +0000 (12:35 +0300)]
ubi-utils: add ubiformat

A new utility to erase MTD devices and flash UBI images, while
preserving erase counters

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: add libscan
Artem Bityutskiy [Sun, 20 Apr 2008 09:34:32 +0000 (12:34 +0300)]
ubi-utils: add libscan

A library to scan MTD devices. For now it only reads EC header.
Later it may be improved if needed.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: add libmtd
Artem Bityutskiy [Sun, 20 Apr 2008 09:33:32 +0000 (12:33 +0300)]
ubi-utils: add libmtd

Just collection of functions to make it easier to work with MTD devices.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: various clean-ups and preparations
Artem Bityutskiy [Sun, 20 Apr 2008 15:14:37 +0000 (18:14 +0300)]
ubi-utils: various clean-ups and preparations

This patch introduces many clean-ups, nicifications and preparations
to the following ubiformat utility. There are also fixes.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: use common.h in libubi
Artem Bityutskiy [Thu, 17 Apr 2008 13:43:20 +0000 (16:43 +0300)]
ubi-utils: use common.h in libubi

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agomkfs.jffs2.c: fix issue with crashing when using lzo compression
Siarhei Siamashka [Thu, 17 Apr 2008 13:32:28 +0000 (16:32 +0300)]
mkfs.jffs2.c: fix issue with crashing when using lzo compression

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agocompr_lzo.c: allocate enough memory for lzo compressor.
Riku Voipio [Fri, 11 Apr 2008 09:33:37 +0000 (12:33 +0300)]
compr_lzo.c: allocate enough memory for lzo compressor.

This is the same bug as in kernel, pointed out the LZO author
(Markus Oberhumer):

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f2a11b158a24301e9158e9c873fa88e5eb775486

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
17 years agoUse LSB locations for manpages
Riku Voipio [Fri, 11 Apr 2008 09:27:38 +0000 (12:27 +0300)]
Use LSB locations for manpages

LSB says manpages belong to /usr/share/man, adjust makefile
defaults accordingly.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
17 years agoTeach libubi_open not to prirnt error message
Artem Bityutskiy [Thu, 17 Apr 2008 12:53:35 +0000 (15:53 +0300)]
Teach libubi_open not to prirnt error message

... when it is expected that UBI is not necessarily present

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubinize: correctly calculate VID offset when min I/O unit is 1
Artem Bityutskiy [Wed, 16 Apr 2008 17:47:13 +0000 (20:47 +0300)]
ubinize: correctly calculate VID offset when min I/O unit is 1

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix a typo
Artem Bityutskiy [Mon, 7 Apr 2008 19:19:01 +0000 (22:19 +0300)]
ubi-utils: fix a typo
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix printing typos
Artem Bityutskiy [Wed, 2 Apr 2008 08:04:51 +0000 (11:04 +0300)]
ubi-utils: fix printing typos

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: fix wrong variable printout
Zoltan Sogor [Thu, 27 Mar 2008 11:26:49 +0000 (12:26 +0100)]
ubi-utils: fix wrong variable printout

Signed-off-by: Zoltan Sogor <weth@inf.u-szeged.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoubi-utils: don't use argp.h
Hamish Moffatt [Wed, 26 Mar 2008 05:17:59 +0000 (16:17 +1100)]
ubi-utils: don't use argp.h

Don't include argp.h as it's glibc-specific, and not used anyway.

Signed-Off-By: Hamish Moffatt <hamish@cloud.net.au>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 years agoFix recv_image compilation with new glibc
David Woodhouse [Sat, 23 Feb 2008 13:28:36 +0000 (22:28 +0900)]
Fix recv_image compilation with new glibc

struct ip_mreq is hidden behind __USE_MISC now