Age | Commit message (Collapse) | Author |
|
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>
|
|
Some 'install' versions (e.g. this of OpenEmbedded) require the mode
to be a separate argument and don't understand the '-m0755' syntax:
.../staging/x86_64-linux/usr/bin/install-sh: ./-m0755 does not exist.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Add -N option to ubirmvol to support deleting volumes
by name.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
-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>
|
|
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>
|
|
Check that volume names and IDs are unique
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Undo my weird change which slipped accidentally to the commit.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
... and fix help message.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
-t option does not require image file.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
A new utility to erase MTD devices and flash UBI images, while
preserving erase counters
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
Just collection of functions to make it easier to work with MTD devices.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
... when it is expected that UBI is not necessarily present
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Zoltan Sogor <weth@inf.u-szeged.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
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>
|
|
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|
|
Somehow calling ubi_update_start was forgotten and caused the
tool not to write but silently ignore the write.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
|